Skip to content

2.Tracker setup

Tony Yu Cao edited this page Aug 21, 2018 · 1 revision

Debugging/working with serial

Check the port of serial connection after plugging in the device.

dmesg | tail

Plug in USB to a computer, and open a serial terminal with a baud rate of 115200 (you may need to be root):

screen /dev/ttyACM0 115200

or on Mac it is /dev/cu.usbmodernXXXX

Copy new script to the board

  • put the script called autorun.lua on the SD card
  • delete the previous script from the internal memory: at+fsdel=autorun.lua
  • Copy the script from the SD card to the internal memory: at+fscopy=D:/autorun.lua,C:/autorun.lua

Since it is called "autorun.lua" it will be run automatically at every boot of the card

Configuration of the internet access

First you have to find the configuration of your specific operator: pdp configuration For giffgaff it is here.

For instance:

  • Giffgaff: APN: giffgaff.com / username: giffgaff, password empty / default PIN: 5555
  • Sonera: APN: internet / no password needed / default PIN: 1234

If the SIM card is locked, you may first need to unlock with pin code at+cpin=5555. Then you received the ack of the SIM card correctly unlock. Otherwise, the tracker will print +CPIN: READY on the start-up by default.

Configuration of the default socket

  • at+cgsockcon=1,"IP",[APN] [APN] is the APN name of your sim provider between " (the first 1 is an ID you refer later with at+csocksetpn)
  • at+csockauth=1, 1, [username],[password] put the username and password from your sim provider between ""
  • at+csocksetpn=1 => Set the active configuration for the socket. Use your configuration.

So for giffgaff it should be:

at+cgsockcont=1,"IP","giffgaff.com"  
at+csockauth=1,1,"giffgaff",""                 
at+csocksetpn=1    

For Sonera it is:

at+cpin=1234
at+cgsockcont=1,"IP","internet" 
at+csockauth=1,0                 # configure authentication for profile 1, 0 = no password needed
at+csocksetpn=1

Now your card should be configured !

Test your internet connection:

at+netopen=,,1: opens the internet connection (do not forget to plug the antenna)

NOTE: It can take some time for your first connection

at+csq gives the strength of the 3G signal, the higher the better i.e:20

Useful AT commands

Full list can be found here: https://drive.google.com/file/d/1GlGeSi39gG068aLJSKqB8qhYwQ9qBUsH/view

  • at+cscriptstop : stop current running script
  • at+cscriptstart="autorun.lua" run the script autorun.lua from the internal memory
  • at+csq give the strength of the 3G signal, the higher the better i.e:20

The autorun.lua script

The autorun.lua script configure the device and send real-time location via 3G network.

  • You may need to configure your own APN using the example shown before
  • Fill the token and tracker ID. The token for each tracker can be found on the tracking website when login as an admin user.
  • Change the IP address of the server around line 160 to your own.

Start sending/doing stuff and writing to screen after 60s

Complete documentation

https://drive.google.com/drive/folders/19swokUe9NwOqRDq6rClPNIValFrF405r?usp=sharing