---
title: "Send Pico LTE GPS data to web server or Telegram"
description: "Get the GPS position of the Pico LTE and send it to a web server or a Telegram chat over the cellular connection."
url: "https://docs.sixfab.com/cellular/pico-lte/micropython-sdk/send-gps-data-web-server-or-telegram/"
last_updated: "2026-10-12"
---

# Send Pico LTE GPS data to web server or Telegram

Get the GPS position of the Pico LTE and send it to a web server or a Telegram chat over the cellular connection.

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

**Required**

**Hardware**

- **Sixfab Pico LTE or Pico LTE 2**: Registered and active in Sixfab Connect, connected to the computer with the micro USB cable.
- **Passive GNSS antenna**: On the u.FL connector, for example the [Passive GNSS/GPS Antenna u.FL Plug, 100 mm](https://sixfab.com/product/passive-gnss-gps-antenna-u-fl-plug-100mm/). The board works with passive antennas only.

**Software**

- **Thonny with MicroPython and the Pico LTE SDK**: Set up as in the [quickstart](https://docs.sixfab.com/cellular/pico-lte/quickstart/).
- **config.json**: In the root of the board: [Prepare the configuration file](https://docs.sixfab.com/cellular/pico-lte/micropython-sdk/configuration-file/).

Connect the GNSS antenna to the u.FL connector:

![Sixfab Pico LTE with an Antenova SR4G031 passive GNSS antenna connected to its GNSS u.FL connector](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/Pico_LTE_Sending_GPS_Data_to_Web_Server__Telegram.webp)

## Set destination

In `config.json`, set the destination of the position.

**Web server**

The server URL, and the username and password if the server needs them; otherwise delete them:

```json
{
    "https": {
        "server": "YOUR_SERVER_URL",
        "username": "YOUR_USERNAME",
        "password": "YOUR_PASSWORD"
    }
}
```

**Telegram**

The bot token and the chat ID, found as in [Send message from Pico LTE to Telegram](https://docs.sixfab.com/cellular/pico-lte/micropython-sdk/send-message-telegram/):

```json
{
    "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](https://github.com/sixfab/pico_lte_micropython-sdk) in Thonny and click **Run**. The script waits for a GPS fix, then sends the latitude and longitude.

**Web server**

Script: `examples/gps/send_location_to_server.py`.

![Thonny with send_location_to_server.py open, showing the https server, username and password config](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/Pico_LTE_Sending_GPS_Data_to_Web_Server.webp)

```text
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.
```

**Telegram**

Script: `examples/gps/send_location_to_telegram.py`.

![Thonny with send_location_to_telegram.py open, showing the telegram token and chat_id config](https://docs.sixfab.com/wp-content/uploads/sixfab-docs/Pico_LTE_Sending_GPS_Data_to_Telegram_Channel.webp)

```text
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](https://docs.sixfab.com/cellular/pico-lte/hardware-reference/#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.
