This guide is heavily adapted from the guide published on the waveshare site, available here.
Notes: There seem to be numerous errors and omissions in the instructions as provided by Waveshare. This guide documents my process so that others may avoid many wasted hours of effort. It turns out that you do need udhcpc
even if you already have dhclient
installed (dhclient caused issues for me). You also don't need minicom
or screen
. There is a way to send and view serial using two terminal windows and built in commands cat
and echo
.
- Your host system is either Linux or OSX
- High degree of comfort with the commandline (i.e. compiling from source)
- Target PC
- Waveshare SIM7600A-H Hat
- Activated SIM with talk/text/data (Mint and T-Mobile are both tested and work)
- High-speed internet connection
- Power off target
- Install your activated SIM card in the holder on the underside of the SIM7600A-H hat
- Install the SIM7600A-H by attaching it via USB to the target
- Power on the target
- The
PWR
indicator should come on. - After a moment, the
NET
light should start blinking.
- Log into the target over
ssh
and complete the rest of the steps.
$ sudo apt-get update
$ sudo apt-get install udhcpc minicom
NOTE: It's also possible (and possibly easier) to use screen
. If you don't have time to deal with this, skip to the "Pure bash shell" instructions at the end of this section.
At this point, the instructions provided by Waveshare call for using minicom
, but don't provide any hint that it needs to be setup. Instructions for setup can be found here and are summarized below.
$ sudo minicom -s
will greet you with aconfiguration
menu
+-----[configuration]------+
| Filenames and paths |
| File transfer protocols |
| Serial port setup |
| Modem and dialing |
| Screen and keyboard |
| Save setup as dfl |
| Save setup as.. |
| Exit |
| Exit from Minicom |
+--------------------------+
- Arrow down to
Modem and Dialing
and pressenter
- Remove "Dialing prefix", "Dialing suffix", and "Hang-up string" entries to match:
+--------------------[Modem and dialing parameter setup]---------------------+
| |
| A - Init string ......... |
| B - Reset string ........ |
| C - Dialing prefix #1.... |
| D - Dialing suffix #1.... |
| E - Dialing prefix #2.... |
| F - Dialing suffix #2.... |
| G - Dialing prefix #3.... |
| H - Dialing suffix #3.... |
| I - Connect string ...... CONNECT |
| J - No connect strings .. NO CARRIER BUSY |
| NO DIALTONE VOICE |
| K - Hang-up string ...... |
| L - Dial cancel string .. ^M |
| |
| M - Dial time ........... 45 Q - Auto bps detect ..... No |
| N - Delay before redial . 2 R - Modem has DCD line .. Yes |
| O - Number of tries ..... 10 S - Status line shows ... DTE speed |
| P - DTR drop time (0=no). 1 T - Multi-line untag .... No |
| |
| Change which setting? Return or Esc to exit. Edit A+B to get defaults. |
+----------------------------------------------------------------------------+
- Escape to the
configuration
menu - Select
Screen and keyboard
and pressenter
. - Press
q
to toggleLocal echo
toYes
- Escape to the
configuration
menu - Select
Save setup as dfl
and pressenter
- Select
Exit from Minicom
and pressenter
For a full list of commands, see the AT Command Manual.
$ sudo minicom -D /dev/ttyUSB2
2 EnterATI
3 If you can't see your local echo, you may need to enable it:- Press
ctrl+a
thenz
to bring up the options menu. 2 Presse
to enable echo 3esc
to return to the console
- Press
ATI
Manufacturer: SIMCOM INCORPORATED
Model: SIMCOM_SIM7600G-H
Revision: SIM7600M22_V2.0
IMEI: 868822040061788
+GCAP: +CGSM
OK
ssh
into the target- Start listening to the SIM7600AH serial device:
$ cat < /dev/ttyUSB2
- Open a second terminal window and
ssh
into the target computer and complete the following steps. - Switch to root user:
$ sudo su
- Send a request for product identification info:
# echo -e 'ATI\r' > /dev/ttyUSB2
- Now check the first terminal window for the output.
- Check if the
wwan0
interface is present:$ ifconfig wwan0
- Enable the
wwan0
interface:$ sudo ifconfig wwan0 up
- Switch to root user:
$ sudo su
- Define network mode as automatic:
# echo -e 'AT+CNMP=2\r' > /dev/ttyUSB2
- Connect the NIC to the network:
# echo -e 'AT$QCRMCALL=1,1\r' > /dev/ttyUSB2
- Allocate IP:
$ sudo udhcpc -i wwan0
Now you can use 4G network!
There are scripts included in this repo that allow you to install 4G connectivity at boot using systemd
service files, a preup script and a poststop script to automate the steps in the "Setup Network Interface wwan0
" section above.
It's recommended that you clone the repo locally on the target computer.
$ git clone https://github.com/alphafox02/simcom_wwan-setup.git
$ cd simcom_wwan-setup
$ chmod +x install.sh uninstall.sh update.sh
- To install:
$ sudo ./install.sh
- To uninstall:
$ sudo ./uninstall.sh
- To update:
$ git pull; sudo ./update.sh
- This service is disabled by default and will not start at boot.
- To enable, run
$ sudo systemctl enable [email protected]
- To disable, run
$ sudo systemctl disable [email protected]
- To start the service and 4G LTE connectivity:
$ sudo systemctl start [email protected]
- To stop the service and 4G LTE connectivity:
$ sudo systemctl stop [email protected]
- To check the status of the service:
$ sudo systemctl status [email protected]
$ sudo nano /etc/udev/rules.d/99-usb-4g.rules
- Add the line:
SUBSYSTEM=="tty", KERNEL=="ttyUSB2", TAG+="systemd", ENV{SYSTEMD_WANTS}+="[email protected]"
- Ctrl-X, Y, Enter (Save and close)
$ sudo reboot