Connecting your Beagle Bone Black (BBB) with internet opens a wide range of possibilities, eg connecting it via an USB. In this blog post I'm going to address connecting it to a 4G module [1] via USB and UART.
Check your device connection
Start by checking if your 4G module connected via Serial or USB is connected properly. Use sudo dmesg | grep tty this will list all the connected devices when you have connected via USB you will get a message like this
[ 55.066972] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB0
[ 55.082450] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB1
[ 55.111827] usb 1-1: GSM modem (1-port) converter now attached to ttyUSB2
Typically it means,
/dev/ttyUSB0
is for diag port.
/dev/ttyUSB1
is AT ports you can use it with screen/dev/ttyUSB1
or minicom to test with AT Commands.
/dev/ttyUSB2
is Modem port for ppp-dial.
/dev/ttyUSB3
appears for module with GSM/GNSS connectivity
if you are connecting via Serial make sure to configure your pins as Tx and Rx without fail, you can use config-pin p9.11 uart where you can replace p9.11 with your desired serial pin, check out BBB pin-out here.
PPP Dialup connection setup
navigate to /etc/ppp/peers and create three different files and paste the following contents onto them.
connect
ABORT "BUSY"
ABORT "NO CARRIER"
ABORT "ERROR"
ABORT "NO ANSWER"
TIMEOUT 30
"" AT
OK ATE0
OK ATI;+CSUB;+CSQ;+CPIN?;+COPS?;+CGREG?;&D2
OK AT+CGDCONT=1,"IP","airteliot.com",,0,0 // Replace "airteliot.com" with your operator's APN
OK ATD*99#
CONNECT
Disconnect
ABORT "ERROR"
ABORT "NO DIALTONE"
SAY "\nSending break to the modem\n"
"" +++
"" +++
"" +++
SAY "\nbyeeee!\n"
simcom-pppd
/dev/ttyS1 115200 #replace "ttyS1" with your port or if you're using an usb connection replace it with ttyUSB(1)
user "test" password "test"
#connect chat
connect 'chat -s -v -f /etc/ppp/peers/connect'
#disconnect
disconnect 'chat -s -v -f /etc/ppp/peers/disconnect'
#hide-password in debug messages
hide-password
noauth
debug
defaultroute
noipdefault
novj
novjccomp
noccp
ipcp-accept-local
ipcp-accept-remote
local
lock
modem
dump
nodetach
nocrtscts
remotename 3gppp
ipparam 3gppp
ipcp-max-failure 30
usepeerdns
Connect
You can now initiate connection using pppd call simcom-pppd & once it successfully connects you can verify the connection.
Notes
- While using UART to connect with your 4G module I recommend you to configure the reset pin aswell if you dont once there is a connection break you should do a manual reboot (power off -> power on) the 4G Module
- If you want to schedule your 4G module to auto connect upon booting you can make use of crontab to do it. Explained here.
- Thanks to all the beagle board org forum & discord members for their help.
[1] - So far I have tested this with 4 different simcom 4g modules; SIM A7672S - Parry tech, SIMA7670C - Adiy, SIM A7672S - Ktron, SIM7600EI
[2] - SIMCom Wireless Solutions, SIMCom A7600 Linux USB User Guide, Version 1.01.03, 2020. [Online]. Available: https://www.cika.com/soporte/Information/GSMmodules/A76xx/SIMCOM_A7600_Linux_USB_User_Guide_V1.01.03.pdf
[3] - https://github.com/2AB5/BBB4G
[4] - Integration of GSM LTE Modem A7672S & UART connection with 4G module.