LGT-92: Difference between revisions

From RevSpace
Jump to navigation Jump to search
 
(21 intermediate revisions by the same user not shown)
Line 1: Line 1:
{{Project
{{Project
  |Name=LGT-92
  |Name=LGT-92
  |Picture=lgt92.jpg
  |Picture=Lgt92.jpg
  |Omschrijving=Improving LGT-12 LoRaWAN tracker software
  |Omschrijving=Improving LGT-92 LoRaWAN tracker software
  |Status=Initializing
  |Status=Initializing
  |Contact=bertrik
  |Contact=bertrik
Line 12: Line 12:
The plan is to investigate if the firmware can be improved, e.g.:
The plan is to investigate if the firmware can be improved, e.g.:
* fix minor existing bugs
* fix minor existing bugs
** see the Issues page at github
** see the [https://github.com/dragino/LGT-92_-LoRa_GPS_Tracker/issues Issues page] on github
* add Cayenne encoding
* add Cayenne encoding
* collect information on how to interface with it (over the "USB" port)
* collect information on how to interface with it (over the "USB" port)
Line 21: Line 21:
* STM32L151 microcontroller, could also be STM32L072 I can't get this really clear
* STM32L151 microcontroller, could also be STM32L072 I can't get this really clear
* GPS
* GPS
* accelerometer
* accelerometer, MPU9250?
* button, 3 LEDs (R, G, B)
* button, 3 LEDs (R, G, B)
* 1000 mAh battery + charging circuit
* 1000 mAh battery + charging circuit


Information provided by Dragino: https://github.com/dragino/Lora/tree/master/LGT-92
Information provided by Dragino: https://github.com/dragino/Lora/tree/master/LGT-92
Manual: https://www.dragino.com/downloads/downloads/LGT_92/


== Software ==
== Software ==
* Dragino binary firmware downloads: https://www.dragino.com/downloads/downloads/LGT_92/firmware/
* Dragina source code: https://github.com/dragino/LGT-92_-LoRa_GPS_Tracker
* Decoder: https://www.dragino.com/downloads/index.php?dir=LGT_92/Decoder/
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
My fork of the Dragino firmware: https://github.com/bertrik/LGT-92_-LoRa_GPS_Tracker


Line 33: Line 42:


=== Flashing ===
=== Flashing ===
When you hold 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.
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 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 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
   ST-LINK v2 GND  <--> Dupont black pin
  ST-LINK v2 SWCLK <--> Dupont green pin
 
  ST-LINK v2 SWDIO <--> Dupont white pin
Official firmware binaries are available [https://www.dragino.com/downloads/downloads/LGT_92/firmware/ here]


For example:
For example:
   openocd -f /usr/share/openocd/scripts/interface/stlink.cfg -f /usr/share/openocd/scripts/target/stm32l0.cfg
   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 ===
=== TTN mapper configuration ===
Connect it at 9600 baud through a USB-UART converter, pins GND, RX, TX. Switch the LGT-92 on.
  USB serial TXD <--> Dupont white pin
  USB serial RXD <--> Dupont green pin
  USB serial GND <--> Dupont black pin
To reset settings after a firmware update
  AT+FDR
Run these commands to set it up with ABP keys, ADR off, uplink at SF7 every 15 seconds:
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+ADR=0
  AT+NJM=0
   AT+CFM=0
   AT+CFM=0
   AT+DR=5
   AT+DR=5
Line 59: Line 83:
   AT+PORT=1
   AT+PORT=1
   AT+FTIME=0
   AT+FTIME=0
  AT+PDOP=10.0
  AT+SGM=0
The AT+SGM=0 line allows the altitude and HDOP to be sent.

Latest revision as of 19:29, 10 August 2021

Project LGT-92
Lgt92.jpg
Improving LGT-92 LoRaWAN tracker software
Status Initializing
Contact bertrik
Last Update 2021-08-10

What

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
  • 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

Hardware

As far as I understand:

  • STM32L151 microcontroller, could also be STM32L072 I can't get this really clear
  • GPS
  • 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

Manual: https://www.dragino.com/downloads/downloads/LGT_92/

Software

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

Flashing

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

For example:

 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 at 9600 baud through a USB-UART converter, pins GND, RX, TX. Switch the LGT-92 on.

 USB serial TXD <--> Dupont white pin
 USB serial RXD <--> Dupont green pin
 USB serial GND <--> Dupont black pin

To reset settings after a firmware update

 AT+FDR

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
 AT+SGM=0

The AT+SGM=0 line allows the altitude and HDOP to be sent.