Using GPS with RISC OS
Chris Hall (132) 3554 posts |
A utility that receives GPS data from a module connected to the Raspberry Pi’s 40-pin header, interprets and decodes the data, displays location (as an OS grid reference) and bearing via its icon bar icon and transmits a ‘geo:’ URI has been released. Applications that understand such data (RiscOSM is one example) can do something relevant – RiscOSM opens a map showing your current location. Where the PiSerial block drivers are not present, the utility simulates a virtual walk in a circle around Midford (see here) allowing demonstration indoors or on a computer not equipped with a GPS module. It is available from !Store or from here note: ‘SatNav’ is a provisional name. |
Chris Hall (132) 3554 posts |
Updated to version 0.50 and described here the device is now housed in a neat case with battery, Pi, GPS module and screen. I’ll be demonstrating it at the London show. |
Raik (463) 2061 posts |
Great work. |
Chris Hall (132) 3554 posts |
The GPS module will produce a simple text string from its serial port. My app decodes this and outputs a URI_Dispatch geo: string. Don’t know what !MapView is. |
Raik (463) 2061 posts |
MapView is a part of Thomas MapTools you find in !Store. I use it with my Surfstick. It allowed also to find a location via CellID. MapView can handle GPS data e.g. from raw/jpeg metadata exported via !rRaw. There is a video in the announcements demonstrate the jpeg gps-export to MapView. |
Raik (463) 2061 posts |
Looks like I need a external antenna. Position not fixed. I have try !MapView with one of your “rotating” latitude/longitude… |
Chris Hall (132) 3554 posts |
Looks like I need a external antenna. Position not fixed. I found it took over three hours for the first fix (with no external antenna). The GPS module has a watch battery and so retains the ‘almanac’ data that it has laboriously downloaded from the satellites so the next fix (once it had, at some time, seen all the satellites) was about 30s. Without the external antenna I had to be outside with a clear sky view. With the external antenna I just needed to be a few feet away from a window. The map seems to be Midford (what !SatNav produces with no serial drivers – a circular tour around Midford) presumably on !MapView. SatNav is now version 0.52 which includes a ‘clock error’ display (comparing RISC OS time to satellite time) and a minor improvement to the formatting of the text area object used when saving the status window as a Draw file. |
Raik (463) 2061 posts |
Today it was a cold and rainy day. I was in our garden with the PiTop round about a half hour. Is the RTC supported by RISC OS? I use a other one at this time. No Problem to change. Is it possibe to create a textfile with latitude: 51.123456 for a MapView Import? As a first quick solution? |
Chris Hall (132) 3554 posts |
is it possibe to create a textfile with Line 4680 in version 0.52 of !SatNav currently says:
It is this line that ‘tells’ any app the GPS coordinates (or Midford) so should be easy to convert into a plain text. It is called every 8s. If RiscOSM is not running it will run it and either way it opens a map of the relevant location. |
Matthew Phillips (473) 721 posts |
Chris: RiscOSM can export locations in a suitable format for MapView. It is one of the formats on the menu for exporting. The Nominatim application (comes with RiscOSM) can open maps in MapView as well as RiscOSM, but most users will be using Nominatim from within RiscOSM rather than via the iconbar. Hilary and I have been drawing up ideas for the Wimp messaging protocol for exchange of geodata this evening. Hope to have something to share tomorrow evening, depending on how long it takes to type up! We will e-mail Chris and Thomas. If anyone else wants to be included in the initial discussions, let us know your e-mail address via the Sine Nomine Software contact form We will post details more widely once the protocol is less embryonic! |
Raik (463) 2061 posts |
The latest Version from SatNav gives a “Number to big (error at line 5460).” if it try to go to the “Midford-tour”. Is it possible to see if the GPS-shield is correctly recognized/detected even without the “first fix”? |
Chris Hall (132) 3554 posts |
The latest Version from SatNav gives a “Number to big (error at line 5460).” if it try to go to the “Midford-tour”. Version 0.54 now corrects this. It was a silly error. Is it possible to see if the GPS-shield is correctly recognized/detected even without the “first fix”? I am hoping to read satellite time as soon as any satellite is seen, rather than only after a fix but that will be the next version. |
Raik (463) 2061 posts |
Have made any hardware changes… …to use the shield in my Pi-Top. And plug a external antenna.In Linux it works but in RISC OS it looks like no serial connection possible. I use a Pi2. Edit: Was a bit late last night. I not have read the Bug thread :-( |
Chris Hall (132) 3554 posts |
Is it possible to see if the GPS-shield is correctly recognized/detected even without the “first fix”? Yes. Version 0.60 now shows (in its status window) the number (and position in the sky) of satellites being tracked, the time of day (but not date, as none is available at that point) while no fix is available. Once four have been found a fix gets established quickly. Setting it up with an oblique view of a window a couple of feet away you can see that the satellites are all in the north part of the sky (the aspect of the window is north) and the dilution of precision is a bit higher than normal (around 2 rather than around 1) once it gets a fix (which under those conditions obviously takes longer). Version 0.60 also implements a primitive Wimp message protocol (to advise other applications about local GPS position data) but if not acknowledged (as is currently expected) falls back to using URI_Dispatch messages. It also uses filetype &A6F (newly allocated) for ‘AnqExp’ files, Anquet ‘.aef’ files. |
Raik (463) 2061 posts |
I will try but at this time the serial connection not work on my Pi2 with RISC OS. In Linux it looks good. With the external antenna placed outside my window the position is fixed very quickly (Adafruit: Blinking once per 10 seconds or so – HAS FIX) but without the serial connection… :-( |
Raik (463) 2061 posts |
I have downgrade my Pi-Top to a B+ one. I borrowed from my Risc PiC Podule I have also downloaded the latest SatNav. Works with the downgraded Pi-Top… Edit: BatMgr not works with my B+. Not sure what the reason is. |
Chris Hall (132) 3554 posts |
The GPS shield “say” FIX, !SatNav “No Fix” but the it tells me the right latitude/longitude. There are two minor bugs at present: when you click on the icon bar icon to see the status window (i.e. while you have a fix), the icon momentarily reverts to ‘No fix’ and does not refresh until it encounters a valid grid reference. As you are not in Great Britain & Northern Ireland this won’t happen. The status window realises the grid reference is out of bounds and sets eastings and northings to zero to indicate this – however it displays ‘SV 000 000’ which is rather unintelligent. I’ll correct these bugs in the next version. You will note that it is displaying GPS time in GMT and local time in your current timezone so although it looks 2 hours apart, it is correctly saying that your clock is pretty accurate (208 cs fast). (The accuracy calculation is not precise as it can’t allow for the time the GPS module takes to process the fix.) Trying to support serial access on all platforms is my next step. |
Raik (463) 2061 posts |
Two hours are correct. 1h for the timezone and 1h for DST. If I have a connection e.g. via. surf stick to load the map in MapView, the time will loaded via net. I’m not at home next week. A other town to try but no “hardware options”. |
Chris Hall (132) 3554 posts |
I am testing version 0.62 which will use OS_SerialOp (if SerialDeviceSupport is present, which it is in Pi roms after 10 Oct 2016 and on most other platforms since Iyonix) or PiSerial_xxx if the PiSerial module is loaded or know no serial support exists. Also if no data are received, it will playback a series of locations (rather than if it knows no serial support exists). It also sorts out places with no valid OSGB grid reference. Test version here |
Chris Evans (457) 1614 posts |
The Battery Manager should work with the B+, and has been tested with it here. Are you using the same version of RISC OS on both? Andrew |
Raik (463) 2061 posts |
It looks like there is a other reason. It works no longer on my Pi2 and my B+ in the same Pi-Top. I play around with the GPS shield and I try also the latest version of the Pi-Top OS. Since it no longer works. The other parts of your software are working. Is it possible that any things are changed in the powermanagement? |
Norman Lawrence (3005) 172 posts |
Chris thanks for all the hard work with SatNav which is working well in demo mode with RISCOSM on my Pi-Top and Pi 3. I need to get a GPS Shield but notice that the Adafruit ultimate GPS does not work on a Pi 3. I am using 5.23 10 Oct 2016 version and wondered do you or Raik know of any suitable GPS shields? |
Chris Hall (132) 3554 posts |
but notice that the Adafruit ultimate GPS does not work on a Pi 3 The translation of that statement is that it does not work with Linux on a Pi 3. The Pi 3 RISC OS roms since 10 Oct 2016 have the serial included in rom and what I don’t know is whether the serial software in rom uses UART0 or UART1 as appropriate so that on all models of the Pi it is pin 8 and 10 of the 40 pin headrer that is the port that serial controls. Does ayone know please? I’ll get round to testing it soon for myself. |
Norman Lawrence (3005) 172 posts |
Thanks for the quick reply. It is encouraging to hear that the Adafruit Ultimate GPS Shield could work with RISCOS and Pi3. I look forward to hearing how you get on setting up the serial software. |
Norman Lawrence (3005) 172 posts |
How easy is it to set the baud rate to 9600 in RISC OS? |