|Improving LGT-92 LoRaWAN tracker software|
This page is about the Dragino LGT-92, a GPS-enabled LoRaWAN tracker node.
The plan is to investigate if the firmware can be improved, e.g.:
- fix minor existing bugs
- see the Issues page on github
- add Cayenne encoding
- collect information on how to interface with it (over the "USB" port)
- perhaps write a replacement firmware, that can be easily compiled with platformio
As far as I understand:
- STM32L151 microcontroller, could also be STM32L072 I can't get this really clear
- accelerometer, MPU9250?
- button, 3 LEDs (R, G, B)
- 1000 mAh battery + charging circuit
Information provided by Dragino: https://github.com/dragino/Lora/tree/master/LGT-92
Dragino binary firmware downloads: https://www.dragino.com/downloads/downloads/LGT_92/firmware/
It's a bit peculiar that there are binary versions out there that have no correspondence to the source archive. Every commit in the official source archive consists of a huge number of changes, often includes also binary/intermediate files.
My fork of the Dragino firmware: https://github.com/bertrik/LGT-92_-LoRa_GPS_Tracker
Work in progress for an Arduino firmware: https://github.com/bertrik/lgt92
When holding the reset pin (e.g. push a dupont-pin in the hole next to the USB connector), you can communicate over SWCLK/SWDIO debug pins.
ST-Link pin connections (from: https://github.com/dragino/LGT-92_-LoRa_GPS_Tracker/issues/10):
ST-LINK v2 5.0v <--> Dupont red pin ST-LINK v2 SWDIO <--> Dupont white pin ST-LINK v2 SWCLK <--> Dupont green pin ST-LINK v2 GND <--> Dupont black pin
Official firmware binaries are available here
openocd -s /usr/share/openocd/scripts -f interface/stlink.cfg -f target/stm32l0.cfg
To program a HEX file:
openocd -s /usr/share/openocd/scripts -f interface/stlink.cfg -f target/stm32l0.cfg -c init -c "program LGT92-EU868-v1.6.2.hex verify reset exit"
This takes only a few seconds.
TTN mapper configuration
Connect it through a USB-UART converter, pins GND, RX, TX. Switch the LGT-92 on. Connect at 9600 baud.
Run these commands to set it up with ABP keys, ADR off, uplink at SF7 every 15 seconds:
AT+NJM=0 AT+ADR=0 AT+CFM=0 AT+DR=5 AT+LON=1 AT+MD=0 AT+DADDR=26 01 1A 30 AT+NWKSKEY=FB 09 6B 85 86 AF 47 12 E8 AE 67 CB 7F A9 CB 51 AT+APPSKEY=CB 9B 8F F5 E6 2C 8E 87 9E 0B 6B 1F 4B 69 14 FA AT+TDC=15000 AT+NMEA886=2 AT+PORT=1 AT+FTIME=0 AT+PDOP=10.0