Oct 152016
 

Just the thing for the morning after the night before, and you’ve woken up wondering where on Earth you are!1

Chris Hall has released a new application, provisionally called ‘SatNav’, that can read the signal from a GPS receiver and feed it to other applications capable of understanding and acting on that data. One such application is Sine Nomine’s mapping software RiscOSM, which will then open a map showing your current location.

Due to the availability of GPS modules in the form of  ‘HAT’ boards2, the software is currently targetted at the Raspberry Pi – for the hardware side of his own project (without which, writing the software would have been a fruitless exercise) Chris used the ‘Adafruit Ultimate GPS HAT’, which is available from The Pi Hut. However, he is looking at the possibility of supporting serial access on all RISC OS platforms which, if successful, would allow the use of serial GPS receivers and thus remove the Raspberry Pi requirement, opening it up to anything with either a serial port or (through the use of a GPS USB adapter) a USB port – although the small size, and ability to run it from a battery, makes the Pi a little more suitable for the purpose than the other platforms on which RISC OS runs.

For those who have somehow managed to avoid all knowledge of the subject, GPS stands for ‘Global Positioning System’ and consists of a network of satellites that orbit the Earth, each of which transmits a signal that consists of the time and the satellite’s position. GPS devices on the ground (so to speak) contain a small satellite receiver and the necessary hardware and software to analyse those signals. When multiple signals are received – typically at least four are needed, but up to ten satellites in the GPS network could be in ‘view’ in the sky at any one time – this information can be used to work out the location of the receiver.

That position (or the lack of a position if the receiver hasn’t been able to get a fix on any – or enough – satellites) is sent down the line to the connected device, in this case the Raspberry Pi running Chris’ application, in the form of an ‘NMEA3 sentence’ which consists of a comma-separated line of information, including fields with the time (GMT), latitude (and either ‘N’ or ‘S’ for North or South), longitude (and either ‘E’ or ‘W’ for East or West) and more besides.

The application acts on that information as necessary: It currently only supports Great Britain and Northern Ireland, and calculates the National Grid Reference from the latitude and longitude, presenting that and the direction of travel on the icon bar, as well as in its window along with more detailed information.

SatNav window showing GPS info, over a RiscOSM window plotting that location

SatNav window showing GPS info, over a RiscOSM window plotting that location (image from Chris Hall)

It also attempts to broadcast suitable data to be picked up by other applications, such as Sine Nomine’s RiscOSM – and it does this at regular intervals, allowing the map to be updated in the event the receiver is on the move.

Originally, the broadcast was done using a URI (via the URI_Dispatch SWI call) – a method that RiscOSM has supported for some time – but a message protocol is in the works as a better method, and a primitive version of this has been incorporated into the latest version of the application, falling back on the URI method if the message is not acknowledged by another application.

The SatNav application is available to download [zip] or from !Store. It features a ‘demo’ mode, whereby the data for a circular path around Midford is broadcast, so you can see what it does in principle, even if you don’t have a GPS module – and if you are attending the London Show on 29th October, you can also expect to see it in action on the Soft Rock Software/RISCOSitory stand. More information about both the application and getting it up and running with the GPS module can be found on Chris Hall’s website.

!ReadMe

  1. This has never happened to me. Honest.
  2. HAT stands for ‘Hardware Attached on Top’ and is a standard form factor for add on boards for the Raspberry Pi introduced shortly after the release of the Model B+.
  3. NMEA stands for National Maritime Electronics Association. The NMEA is marine electronics trade organisation, based in the United States of America, and which has set – and therefore given its name to – a number of communications standards for electronic devices used in marine fields. GPS receivers typically use one such standard – NMEA 0183.
 October 15, 2016  Posted by  Software Tagged with: , , ,

Sorry, the comment form is closed at this time.