Telit sandwich

From liteSOM Wiki
Jump to: navigation, search

Image generation

Project setup

See example on how to setup project on GitHub

Project configuration

To configure Buildroot for liteSOM + Telit sandwich configuration please use grinn_liteboard_telit_defconfig

make grinn_liteboard_telit_defconfig

Project compilation

You can compile project in this same way as usual

make all

Network connection setup

Power on Telit modem

By default Telit modem is powered off. To enable it a special sequence of low/high states is needed on it's ON_OFF pin. That sequence is implemented in /scripts/power_telit.sh. To enable modem simply run that script. After about 15 seconds messages about new USB devices should appear:

# /scripts/power_telit.sh 
# [  156.354107] usb 2-1.1: new high-speed USB device number 7 using ci_hdrc
[  156.555822] option 2-1.1:1.0: GSM modem (1-port) converter detected
[  156.586123] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB0
[  156.626295] option 2-1.1:1.3: GSM modem (1-port) converter detected
[  156.642568] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB1
[  156.660544] option 2-1.1:1.4: GSM modem (1-port) converter detected
[  156.676947] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB2
[  156.695298] option 2-1.1:1.5: GSM modem (1-port) converter detected
[  156.709941] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB3
[  156.729079] option 2-1.1:1.6: GSM modem (1-port) converter detected
[  156.745485] usb 2-1.1: GSM modem (1-port) converter now attached to ttyUSB4

Disabling Telit modem needs the same sequence on ON_OFF pin. There should be messages about disconnected USB devices after about 15 seconds after running /scripts/power_telit.sh:

# /scripts/power_telit.sh
# [  233.440034] usb 2-1.1: USB disconnect, device number 6
[  233.461925] option1 ttyUSB0: GSM modem (1-port) converter now disconnected from ttyUSB0
[  233.471264] option 2-1.1:1.0: device disconnected
[  233.592062] option1 ttyUSB1: GSM modem (1-port) converter now disconnected from ttyUSB1
[  233.616816] option 2-1.1:1.3: device disconnected
[  233.658070] option1 ttyUSB2: GSM modem (1-port) converter now disconnected from ttyUSB2
[  233.676643] option 2-1.1:1.4: device disconnected
[  233.711851] option1 ttyUSB3: GSM modem (1-port) converter now disconnected from ttyUSB3
[  233.728737] option 2-1.1:1.5: device disconnected
[  233.762848] option1 ttyUSB4: GSM modem (1-port) converter now disconnected from ttyUSB4
[  233.783548] option 2-1.1:1.6: device disconnected

Configure APN

In order to configure APN for used SIM card, there needs to be created new file in /etc/ppp/chatscripts with desired APN:

# echo 'AT+CGDCONT=1,"IP","custom_apn"' > /etc/ppp/chatscripts/apn.custom

Next step is to configure ppp to use that APN by default. In order to do so, a symlink /etc/ppp/chatscripts/apn needs to be replaced to point to the just created apn.custom file.

# ln -sf apn.custom /etc/ppp/chatscripts/apn

To check which APN is configured, just list the contents of the /etc/ppp/chatscripts directory as below:

# ls /etc/ppp/chatscripts/ -l
total 5
lrwxrwxrwx    1 root     root            10 Jan  1 01:05 apn -> apn.custom
-rw-r--r--    1 root     root            31 Jan  1 01:01 apn.custom
-rw-r--r--    1 root     root            29 Mar  9  2017 apn.play.pl
-rw-r--r--    1 root     root           396 Mar  9  2017 mobile-modem.chat
lrwxrwxrwx    1 root     root             9 Mar  9  2017 mode -> mode.NONE
-rw-r--r--    1 root     root             2 Mar  9  2017 mode.NONE
lrwxrwxrwx    1 root     root             8 Mar  9  2017 pin -> pin.NONE
-rw-r--r--    1 root     root             2 Mar  9  2017 pin.NONE

Setup network connection

After powering on Telit modem and configuring ppp scripts, the only thing to start network connection is to run pon command:

# pon

After that, there should appear a new network interface ppp0, which can be verified for example using ip l command.