Using GPS with RISC OS
Matthew Phillips (473) 719 posts |
How many digits of grid reference are you looking at before you decide it’s unchanged? Are you going down to metre accuracy? |
Matthew Phillips (473) 719 posts |
I’ve been reading about the different GPS modules from Adafruit. The Adafruit Ultimate GPS Hat for Raspberry Pi is quite a big board, but you just connect it to the GPIO pins, and that’s that. On our PiTop (supplied by CJE) the GPIO pins are duplicated with a parallel set of pins so that the PiTop hub board can be connected as well as having a set of pins free for general use. Some of those pins (at the end furthest away from the Ethernet socket) have CJE’s real time clock module plugged in. So to use the GPS Hat we would need to unplug that, but we might be able to set the clock from the GPS module if we install the battery? I think SatNav covers setting the clock? The other option is the Adafruit Ultimate GPS Breakout which is a much smaller board. It would need a lead soldering on, and then connecting to the Raspberry Pi. Is there a clear diagram somewhere showing which pins you’d use? I wonder whether it will need the same pins as CJE’s RTC module? I don’t know anything about how the GPIO pins are allocated! The GPS Hat might not fit in the PiTop case with the sliding lid shut. Hard to tell. Can you give us some advice, Chris/Raik? |
Raik (463) 2059 posts |
@Chris @Matthew The first one you find here The second one (latest) ist connected to the Pi-Top hub together with a RTC. I can post a picture later this day. The Pi-Hub pinlayout you find here Edit: Cable: Working: |
Chris Hall (132) 3554 posts |
The other option is the Adafruit Ultimate GPS Breakout which is a much smaller board. It would need a lead soldering on, and then connecting to the Raspberry Pi. Is there a clear diagram somewhere showing which pins you’d use? I wonder whether it will need the same pins as CJE’s RTC module? I don’t know anything about how the GPIO pins are allocated! Just connect ‘VIN’ to 3.3V (pin 1 or 17), ‘GND’ to Ground, ‘TX’ to ‘RXDATA’ (pin 10) and ‘RX’ to ‘TXDATA’ (pin 8). If you connect the enable pin (EN), choose a suitable GPIO output that you can use to enable/disable the GPS module. CJE’s RTC module will use the IIC pins (pins 3 and 5) but with a GPS module is probably redundant. If I close SatNav, a errorbox is open “Not open for update (error at line 2440)!” I’ll do some fault finding.. Version 1.40 opens a file on start up and closes it on shutdown that stores the odometer reading. It keeps an internal note of whether it has closed the file but if something external closes the file (e.g. the *CLOSE command) it would produce that error as it quits. |
Chris Hall (132) 3554 posts |
Version 1.40rc14 (5-May-2017) should now work oK… How many digits of grid reference are you looking at before you decide it’s unchanged? Are you going down to metre accuracy? For reasons that I can no longer recollect, I am testing the real variables xgrid and ygrid, returned from the co-ordinate conversion from WGS84 latitude and longitude to OSGB36 grid reference (the routine PROCconv(long,lat) does this) against their previous values derived the same way. So it will detect millimetre changes. I think the original idea might have been to avoid redundant updates to the icon bar icon. |
Raik (463) 2059 posts |
Sorry :-( |
Chris Hall (132) 3554 posts |
You should not get that error unless an external app has closed the file ‘OdoLog’ in !SatNav [a file added between versions 1.20 and 1.40]. I’ll add some error trapping so that the error (which should not happen and I don’t understand why it is happening) is suppressed. |
Raik (463) 2059 posts |
I do nothing and no other App is started after!SatNav (aftr Restart my PiTop). |
Raik (463) 2059 posts |
Mystic. If I use 1.40RC14 with a external antenna and the position is tracked, it works with RiscOSM. |
Chris Hall (132) 3554 posts |
This error should only occur if your SD card is set as read-only or if the file <SatNav$Dir>.OdoLog has been closed from outside !SatNav, e.g. by the *Close command. This file was added in version 1.40 to load and save the odometer reading. Next week I will add some error trapping so that this error is trapped. |
Raik (463) 2059 posts |
More mystic. My card and also the SSD are not read only. I only start SatNav. Nobody *close anything. The “problem” I have with Pi-Top and PiTab. |
Raik (463) 2059 posts |
I have a idea. I start from archive. SparkFS is a full version but maybe this is the reason. Try later. |
Chris Hall (132) 3554 posts |
Running it from a read-only archive would produce this error. |
Raik (463) 2059 posts |
Outside a archive it it is working. Not sure what the reason is. The archive is read/write and SparkFS is a full version (also read/write). Edit: Have seen SparkFS is 1.43. Have “!Freshen” to 1.44. Looks like now it is working. |
Matthew Phillips (473) 719 posts |
Right, we have an Adafruit GPS Breakout board wired up to the Pi-Top (Raspberry Pi 3) which I am tying this on. The board flashes its red LED every second to say it is trying for a fix. I took it outside the house and after five minutes or so it got a fix, it appears, as the frequency of flashing dropped to every 15 seconds. But SatNav cannot see it. If I run SatNav it goes straight into its circular motion simulation. I looked at the !Run file and commented out the RMEnsure for PiSPI as suggested, and RMKilled PiSPI. Reran SatNav: still no joy. I set SatNav$AllowPlay to zero. Now it just says “Ser Err” on the iconbar. The ROM in this Pi-Top, supplied by CJE Micros, dates from 21 Aug 16. I read somewhere that you took out something from SatNav because of more recent ROMs having serial stuff in them. Where can I get these bit to load seprately? Do you have an older SatNav I could copy them from? If the GPS board hasn’t got a fix yet, but the serial connection is working, what should I expect SatNav to do, and what will it say in the window and on the iconbar? |
Raik (463) 2059 posts |
You need a Oct 16 ROM or later for the build in serial support. Try the RC 15 one. |
Chris Hall (132) 3554 posts |
As Raik says, you need a ROM October 2016 or later to use built-in Serial support. The PiSerial block drivers were removed from SatNav from version 1.20 (Jan 2017) so that it would use the Serial module on all platforms. What should happen with a working serial connection [but no fix] is that the GPS module will transmit NMEA sentences containing the time of day, the number of visible satellites but little else. SatNav will indicate how many satellites are visible, how many of them are being ‘tracked’ (i.e. recognised as being at a known position in the sky) and what the time is in GMT (from the GPS module which has a real time clock). The icon bar icon will display one of the following to indicate the status: ‘Ser Err’ indicates that a serial error has occurred, either when making SWI calls to the Serial module or if it receives top-bit-set or zero characters, reset by receiving a checksum-correct NMEA sentence, otherwise ‘Ser OK’ if serial data are being received, reset if UART disabled [not necessary as PaPiRus now connected without using serial lines], otherwise ‘Ser Fail’ if serial data were received earlier [e.g. UART disabled], otherwise ‘Fix Lost’ [not sure whether this ever appears], otherwise ‘No fix’. Once it has a fix, the GPS module transmits NMEA sentences with bearing, speed, satellite position in sky, latitude, longitude, time, date, etc. and the icon bar icon displays ‘XX 123 456’ or ‘No grid’. The status window then displays full information, including clock error (comparing RISC OS GMT time/date against satellite GMT time/date). If no valid NMEA sentences have been received and the allowplay option is set then it does its circular walk. |
Chris Hall (132) 3554 posts |
SatNav has now been updated to version 1.65 which allows logging in GPX format (so non-GB locations should now work correctly). A few more bugs eradicated and version 1.70 (12-Aug-2017) uploaded. A few more bugs eradicated and version 1.80 (29-Aug-2017) uploaded. |
Chris Hall (132) 3554 posts |
At the London show I will be showing the latest version of SatNav (1.90), see here |
Chris Hall (132) 3554 posts |
Updated to version 2.20 (6-Aug-2019) to make it consistent with the article in Archive 25.5 (October 2019). |