These examples get the board’s GPS position and send it, over the cellular connection, to a web server or to a Telegram chat.
Before you begin
Hardware
- Sixfab Pico LTE or Pico LTE 2Registered and active in Sixfab Connect, connected to the computer with the micro USB cable.
- Passive GNSS antennaOn the u.FL connector, for example the Passive GNSS/GPS Antenna u.FL Plug, 100 mm. The board works with passive antennas only.
Software
- Thonny with MicroPython and the Pico LTE SDKSet up as in the quickstart.
- config.jsonIn the root of the board: Prepare the configuration file.
Connect the GNSS antenna to the u.FL connector:

Set destination
In config.json, set the destination of the position.
The server URL, and the username and password if the server needs them; otherwise delete them:
{
"https": {
"server": "YOUR_SERVER_URL",
"username": "YOUR_USERNAME",
"password": "YOUR_PASSWORD"
}
}
The bot token and the chat ID, found as in Send message from Pico LTE to Telegram:
{
"telegram": {
"token": "YOUR_TELEGRAM_TOKEN",
"chat_id": "YOUR_TELEGRAM_CHAT_ID"
}
}
Run example
Open the script from the examples/gps folder of the SDK repository in Thonny and click Run. The script waits for a GPS fix, then sends the latitude and longitude.
Script: examples/gps/send_location_to_server.py.

INFO: GPS Example
INFO: Trying to fix GPS...
INFO: {'status': 0, 'response': ['+QGPSLOC: 110915.000,3734.6884N,1219.2982W,1.4,22.8,3,0.00,0.0,0.0,070723,05', 'OK'], 'value': ['3734.6884N', '1219.2982W']}
INFO: Lat-Lon: ['3734.6884N', '1219.2982W']
INFO: Sending message to the server...
INFO: {'response': ['OK', '+QHTTPPOST: 0,200'], 'status': 0}
INFO: Message sent successfully.
Script: examples/gps/send_location_to_telegram.py.

INFO: GPS Example
INFO: Trying to fix GPS...
INFO: {'status': 0, 'response': ['+QGPSLOC: 071201.000,3734.6884N,1219.2982W,1.8,16.9,3,0.00,0.0,0.0,020713,04', 'OK'], 'value': ['3734.6884N', '1219.2982W']}
INFO: GPS Fixed. Getting location data...
INFO: Lat-Lon: ['3734.6884N', '1219.2982W']
INFO: Sending message to telegram channel...
INFO: {'status': 0, 'response': ['{"ok":true,"result":{"message_id":21,"from":{"id":*,"is_bot":true,"first_name":"Pico LTE","username":"***"},"chat":{"id":***,"first_name":"*","username":"*","type":"private"},"date":1688628491,"text":"3734.6884N,1219.2982W"}}'], 'interval': 0}
INFO: Message sent successfully.
The first fix can take a few minutes; under open sky it is faster. See also GNSS.
Troubleshooting
+CME ERROR: 516: the module has no fix. Use the board outdoors, or a better antenna.+CME ERROR: 504: a GPS operation is already running on the module. Continue, or stop it and restart your program.