Android + TTGO T-Beam GPS Tracker

by sqij in Circuits > Gadgets

7687 Views, 13 Favorites, 0 Comments

Android + TTGO T-Beam GPS Tracker

tbeam-shot.jpg

This is a follow up article from the one linked below, which outlined my GPS Tracker over a LoRa mesh. A number of people have asked for support of the TTGO T-Beam all-in-one LoRa+GPS board, and I have finally adapted the Ripple GPS Tracker firmware for this board, supporting all the modes.

https://www.instructables.com/LoRa-GPS-Tracker/

Supplies

Multiple Modes

The firmware supports all of the tracking modes available via the Ripple Commander app:

  • remote live monitoring
  • geofence mode, with in/out alerts
  • silent logging on timer to device's storage
  • remote standby into low power sleep
  • SOS alert (long press button on device)


Required Hardware

At a minimum you need a 'Home' radio module, which you connect to an Android handset or tablet (either via USB-OTG cable, or over Bluetooth), and a T-Beam module as the tracker device.

More ambitious setups can involve multiple T-Beam devices, all remotely monitored from the Android + Home radio. You can also deploy dedicated solar-powered repeaters to extend the coverage area that the tracker devices may be in.

The Home Radio

This can be one of a wide variety of LoRa development boards, including the Adafruit Feather (as in the cover picture), or the TTGO LoRa32 V2, or Heltec V2. You just have to flash the Ripple Messenger firmware onto this radio, for it to operate in this role with the Commander app.

NOTE: I will hopefully be producing a firmware for the 'Home' radio also for the T-Beam, as some of you might only have these in your projects and wish to use them in both roles.

Any of the 'RippleV5-*.bin' files are appropriate, eg.

https://github.com/spleenware/ripple/blob/master/RippleV5-Bluetooth-HeltecV2.bin

The T-Beam Devices

You can download the firmware.bin file from here:

https://github.com/spleenware/ripple/blob/master/RippleTrackerV5-TBeam.bin

Please refer to the github Readme section below for help on how to flash the firmware to the T-Beam:

https://github.com/spleenware/ripple#esp-targets-flashing

Configuring the Devices (IDs and Settings)

tracker-config.png

Each device in the LoRa mesh must have a unique ID in the range 1..254. The 'Home' radio must be 1, and is auto-assigned when you connect it when using the Commander app.

I recommend assigning lower number IDs to repeaters, or if not currently using them to start assigning IDs from, say, 20 and up to your tracker devices.

To program the ID and settings into the T-Beam device, you need to launch the DeviceProvision screen. Note that the Commander app has two Android launcher icons! The 'Device Provision' one is for doing this initial setup/config.

In this screen just connect the T-Beam with a USB-OTG cable, then select the 'allow' button in the Android security popup (to allow the app access to USB peripherals). A dialog box should then popup asking if it's OK to add the new device. Select 'Yes', then enter the ID you wish to assign, some unique name of the device, then click 'Save' button.

Tap on the '...' button to the right to setup custom configuration properties for this device (screen is pictured above)


If you want to use the SOS feature, select the ONBUTTON option, and enter some text to be sent on SOS being activated.

The 'Low Power' options for the various modes cause the device to go into deep sleep for varying periods:

  • Low Power1 - sleeps for 30 seconds
  • Low Power2 - sleeps for 2 minutes
  • Low Power3 - sleeps for 10 minutes
  • Low Power4 - sleeps for 30 minutes

After waking from deep sleep, the GPS is powered on (if the 'Peripheral' checkbox is ticked) and attempts to get a location fix. Depending on the mode, it then processes the location, then goes back to sleep.

The NORMAL power mode just keeps everything powered on.

Typically you want the LOGGER mode to use one of these Low Power modes, to configure how often you want to capture the geo location, and how much you need to conserve the battery.

Tap on the SAVE on the toolbar, then 'Save' on the device screen, to save the configuration options.

The 'Save' button should then change to 'Program'. Click this to then send all the settings to the T-Beam.

NOTE: If you ever want to change this config, you can, but afterwards you will need to attach the T-Beam again and click 'Program' again.

Testing the Tracking

new-device-info.png

Launch the main screen from the other launcher icon, labelled 'Ripple Commander'. You should see a list of devices you have configured.

Connect the 'Home' radio, either via USB-OTG cable or Bluetooth. The toolbar has an icon that shows the connection status which changes to solid white when connection has been established. Also, the 'Home' device's battery voltage will then also appear on the toolbar.

Tap on the T-Beam device in the list of devices, to see the device info screen (pictured above)

If the device is not reachable or something went wrong, the RSSI will say 'Timed out'. Tap on the refresh icon to the right to retry fetching the device's status.

NOTE: if the device is reset since you powered on your 'Home' radio, you must tap on this 'refresh' icon to re-sync the status of the tracker device.

Changing Modes

google-earth-snap.jpg

Tap on the radio buttons (Standby, Live Track, etc) to change the current tracking mode.

Note: if the device is currently sleeping, you will have to wait until its next wakeup to see the mode change.Alternatively, if you can physically access the device, you can reset it, in which case it will go back to LIVE mode.

Mode: Live Track

If changing from 'Standby', the GPS is remotely powered on. Once a fix has been established you should see the Location: property changing. You can also select the Back navigation, then select the 'Map' tab to view it as a pin on the map.

Mode: Geo Fence

When you select this mode you will be prompted to select the Circle or Polygon region (which you must previously create, from the Map tab).

The device then gets the geo region coordinates uploaded to it, and then silently monitors the geo location, ie. it doesn't transmit the changing location. If the device either goes into or out of the region an alert text is sent, and the message can be viewed in the History tab.

Mode: Logger

This will typically put the device into deep sleep (you should see the red LEDs on the T-Beam go off), and on waking writing the acquired geo location and timestamp to the T-Beam's SPIFFs partition.

At any time you can switch the mode back to LIVE TRACK, then click on the 'Download' button to download the captured data. Note that this will be quite slow, as LoRa is only a low bandwidth modulation technology. But the cool things is this can be done remotely, so for something like wildlife tracking collars means you don't have to re-capture the animal!

The data will be presented as CSV data in the box below the progress bar. If the download stalls/fails you can click on Download again and it should resume.

Click on the 'Copy to Clipboard' button to copy the CSV data to the Android clipboard.

For example, you can then either paste this into an email, or paste it into a note in an app like Google Keep, then process it on the desktop.

In this test, I had the tracker on the dash of my car (configured with Low Power1). I copy/pasted the CSV data to a Google Keep note, then on my laptop copied the data to a.csv file, imported to a CSV to KML converter, then drag-n-drop the KML file onto Google Earth (pictured above).

Battery Endurance (estimates)

In NORMAL power mode, ie. always on, and in LIVE TRACK, I measured the battery over 9 hours and the 18650 lithium went from 3.952 volts to 3.792 volts, which is approx 20% of the battery's capacity.

So, there is an estimated 45 hours the tracker could be powered for in this mode.

In the most battery efficient mode, Low Power4 (30 minute sleep), I only have some preliminary estimates of around 20-30 days in LOGGER mode.

Conclusion

I am now really happy with the tracker firmware, and it's become a bit of a Swiss Army knife of trackers, as it can handle a number of different modes/roles, and has quite decent battery efficiency.

And now, the T-Beam offers the least fuss for DIYers as it doesn't require any soldering or hackery, and the 18650 batteries are everywhere and easily obtainable.