Stefano Costa sent me a Choral Greenwich for evaluation. I’ve had my eyes on that or something similar for a while now because my brother in law has been fascinated by OwnTracks, and he’s interested in tracking a number of tour buses they operate.

Choral Greenwich

The Greenwich is a lovely little device which comes preloaded with a demo-application which Choral calls OrionMQTT – an application which periodically reports the device’s location over MQTT. (The too-shiny coin on the photo above is a 1 Euro piece.)

Some notable features of the Greenwich:

  • Powered by 8-32 V DC
  • Li-Ion battery with internal charger
  • GSM/GPRS chip
  • Accelerometer
  • Digital inputs and outputs
  • UART serial
  • Optional CAN bus
  • Operating temperature: -20 +60 °C
  • Java programmable

That last bit is what held me off a little because of my ignorance of all things Java; I was hoping to be able to easily modify the code (which will soon be open sourced by Choral). Instead, and for the time being, I’m just re-publishing the data in a format suitable for OwnTracks. Choral provides an SDK for programming the device, but I haven’t looked at that yet.

I was given the advanced Greenwich which has all the trimmings on it, including a D-SUB9 through which I configured the device. After booting, I can use #commands to configure it; authenticate, set up GPRS connectivity, tracking interval, and start tracking:

#PWD 1234567890

#CPRSCFG internet.apn,TCP,192.168.1.22,1883

#TRKTIM 120s

#TRK ON

Other commands such as #PUBTOPIC allow me to configure the MQTT topic to which Greenwich publishes, and #SETID (that’s my 41 below) configures a device identifier which can be made to be meaningful for your application (e.g. vehicle number).

After that, it’s basically just a matter of carrying the light little box to the vehicle and installing it somewhere (e.g. in the glove box or boot). Mine is provisionally installed, and I hooked it up to an always-on cigarette-lighter in the back of the car.

The Greenwich publishes a CSV-like string which contains a header ($CHX) and a configurable ID (here: 41). The device also reports date (YY) and time obtained via GPS, position as well as a battery level, travelled distance in metres, and a few other interesting values such as altitude and speed over ground.

$CHX,41,A,09,140613,133708,5057.66047,N,00842.97512,E,16.10,13.440,240.4,102780,4.4V,E,08,00,00000000*2D

CSV

The temporary republisher I have extracts the elements from the CSV and produces OwnTracks-compatible JSON payloads.

{
    "alt": "240.4", 
    "batt": "4.4V E", 
    "distance": "102780", 
    "lat": "50.961008", 
    "lon": "8.716252", 
    "sat": "09", 
    "setid": "41", 
    "tst": "1402666628", 
    "vel": "24.89"
}

In addition to periodic publishing over MQTT, I can send an SMS to the device with the string gps in it, and it responds via SMS, which is rather neat. The software can also be rebooted via SMS, and we can send it a park message which will alert (via SMS) if the vehicle is moved after it receives the park.

The Greenwich I have has been behaving very well; a watchdog on it automatically restarts it if something goes wrong. For example, I drove through an area with zero GPRS coverage yesterday afternoon for about 10 kilometers, and I noticed the LEDs flashing to indicate a reboot; after a few minutes (my logs tell me later), the device continued reporting. (A reboot resets the travelled distance, of course.)

This is a track I recorded yesterday (via the OwnTracks m2s back-end), with the device reporting every 30 seconds.

Driving with Greenwich

and if I zoom in a bit we still see the quite fine granularity of the reports:

Zoom in

Before we can take this to production, there are definitely features missing in the software, and I’m talking to Choral about this as we speak (the people at Choral have been extremely helpful, and they’re very responsive):

  • TLS is a must-have; currently the connection to the MQTT broker is in plain text.
  • Authentication is also a must-have, though this should be no great issue as Greenwich uses the Paho MQTT client for Java
  • I’d very much like to see a #TRKDIST command with which I can define a distance (in meters) after which a location is published; this would allow lowering the required GPRS data volume.

The Choral Greenwich is a really neat little box, and it’s performing very well.

MQTT, OwnTracks, and Location :: 14 Jun 2014 :: e-mail