Software apps and online services

Story

My initial goal was to know where my cat could be when we do not see him all day long. I wanted a module as small and light as possible, and a battery that takes at least 12 hours or more.

The simplest construction is to save a position (lat-long) every [n] -second on an SD card module, and when the beast comes home because he have to eat, get the list of points of the SD card and display its course on a map !.

Well, the module is still a bit too big to put around the neck of Kenzou the cat, but it is a simple project and fun to achieve with my great friend Espruino, this little wonder that allows to code JavaScript on a microcontroller so easily. ; -)

final product ;)

A - Configure the GNSS module

I use the GNSS module GG-1802 from U-Blox which embeds the circuit NEO-M8N, its particularity is that this module can also receive the European satellite constellation Galileo to hope to have a more accurate signal ??!.

GNSS module to the UART-USB converter

Install and run U-Center soft (Unfortunately only available on Windows), connect the GNSS module to the UART-USB converter, open panel (from top menu) :

View > Messages View, and:

A - 1 ) Have the module listen to the Galileo constellation

Set module to use mode NMEA 4.1

Select : UBX > CFG > set NMEA to 4.1 - click "send button"

UBX > CFG > set NMEA to 4.1

Select: UBX > CFG > GNSS set Galileo Enable and don't forget to click on the send button at the bottom of the interface:

A - 3 ) Save our module config

B - Connect parts

What the circuit does: The Espruino Pico listens to the GNSS position satellite data from the UBlox module, transforms it into human usable data, and then writes it to a simple text file of the SD module, line by line.

C - Code

C - 1 ) Setting up de Web IDE for our needs

I decided to configure the Web IDE in "Project" mode. This allows me, much like a Node.js project, to import into the project entry (right pane of the IDE) all my personal Javascript module. Once done, all you need to do is code in your favorite editor, and simply click on the "send to Espruino" button to upload the program.

It may not be the cleanest way, but I find it very practical.

Settings > communications > Modules upload as functions

Settings > communications > Save on Send > Direct to Flash

Settings > Project > and set your root project directory

From now, the Web IDE will generate "modules" folder where I dev the main files of the application, a clean way to structure the code, instead of having a single very long script file.

A bit like the global Window object, when developing JavaScript code for a web browser. Once the modules are imported into the Web IDE entry point, they will be available in all other parts of the program.

C - 3 ) Application modules

modBoardLed is a very simple module, only here to blink red or green led on the Pico board.

modGNSS, where I parse the "raw" NMEA data from the GNSS module

modSD, responsible for writing data on the SD card module.

Those 3 JavaScript module are attached to the project.

D - Take a walk, generate an GPX file and display your route on a map

D - 1 ) Connect our module in Standalone mode

Standalone mode

No USB cable connected from Pico to our computer to take the road! The Pico will be powered by a Lipo battery or a power source that you want (3.3V). The connection differs a bit, see the official page for more details.

Everything is ready, as soon as our circuit is powered, the script creates a text file and will write our position every 5 seconds when it is available.

D - 2 ) Generate an.GPX file

At the end of our walk, we have a text file consisting of a succession of data lines as below :