GPS and RISC OS
Pages: 1 2
Jim Gibb (1867) 15 posts |
I’d like to use a RPi as the ‘brains’ behind an integrated autopilot and navigation kit for my boat. At present, I’m unclear (confused!) on how best to connect my GPS receiver to the Pi. Several questions are unresolved: |
Raik (463) 2061 posts |
I mean Thomas Milius works on seriell GPS via his FTDI Driver. |
Jim Gibb (1867) 15 posts |
DavidS: Is it really going to be that simple? I’ll give it a go. Any specific recommendation for the GPS receiver? Thanks for the advice. Raik: Sorry, your response is a little too cryptic for me. Would you be kind enough to explain? (What’s an ‘FTDI Driver’? And how do I find out about them?) |
Raik (463) 2061 posts |
FTDI is one ofe the possible chips in a USBtoSerial-adapter. Thomas Milius has a Driver for it. Sorry for my bad english. |
neil.r (1738) 66 posts |
Have you looked at http://fishpi.org/ ? OK, it’s not RISC OS, but it may give you some ideas. |
Jim Gibb (1867) 15 posts |
Thanks for your comments. Raik: Not your English – its my knowledge of electronics which is wanting. I was hoping to complete my project without having to descend to low-level coding (RPi is supposedly designed to encourage beginners to tinker!) So, for the moment, I’m trying to maintain a ‘higher level’ approach (see below). neil.r: Yes, I had seen the FishPi programme. Quite impressive: they clearly have sufficient expertise to follow a thorough top-down approach. It does seem, however, to be thoroughly committed to the Linux-Python software option. I acknowledge that this offers considerable practical advantages from my perspective (not least, the ready incorporation of Gertboard technology & software). I may have to give in and head that way in the end – but, at the moment, I’m resisting the ‘overhead’ of having to learn yet another OS and programming language (especially when my project is itself in personally unfamiliar technical territory). |
nemo (145) 2556 posts |
I wrote something that used a compact flash GPS receiver on a Psion Netbook. It was plugged via a mechanical adapter into the PCMCIA port and simply presented itself as a serial port with ASCII data. Very simple. I doubt the Bluetooth version is much different. |
Rick Murray (539) 13851 posts |
The problem is that, as far as I know, there is no “bluetooth stack” for RISC OS. Because RISC OS is very small, things like this tend to come when somebody with the required skills/knowledge has a need for it. I, too, have a little Bluetooth USB dongle and an old Bluetooth GPS receiver 1. Not tried it with RISC OS, but I’d be very surprised if it worked. 1 Don’t use it anymore as all of my Android phones have GPS/compass/etc built-in… |
Jim Gibb (1867) 15 posts |
Thanks, all – I think this is encouraging; at least there’s enough there to make a start. RISC OS will let me get through to the GPIO pins and a documented GPS module should allow me to download the NMEA sentences. |
neil.r (1738) 66 posts |
Funny you should mention that – I’ve been playing with my Gertboard this morning, trying to WIMPify my LED chasing program. Whilst I’m sure any Real Programmer could do this in 12 seconds flat, it’s taken me all morning so far just to create a template of a window. And I now know the difference between ‘icons’ and ‘furniture’. So that’s a step forward I guess. Anyhow – to answer the question (sort of) – yes, you can play with the Gertboard from RISC OS, and it works for both input and output – I’ve kludged the LEDs and Buttons programs to work from BASIC 1 using the !GPIO module, which you can get from !PackMan. The reason for the warning about access straight to the GPIO pins is that if you get it wrong, you can blow up the pi, whereas the Gertboard provides some protection. Now, seeing as the pi is cheaper than the Gertboard, I’m less than convinced on this point to be honest. 1 I was going to try recompiling the examples written in C, but I don’t know enough about the language to remove the unix specific parts, like the reliance on /dev/mem |
Jim Gibb (1867) 15 posts |
neil.r: I’ve just had a play with the !PiLed demo that comes with the GPIO module software. WIMPifying that presented no particular problem (another learning curve, but at least it’s well documented) so I moved on to your(?) BASIC code for the Gertboard ‘marching LEDs’ demo. The Gertboard is on order (it offers a number of advantages for my application, particularly the potential to control motors rated at a few tens of watts – and I really do need to protect my delicate ‘brain’ from the marine environment) so I’m looking forward to that ‘learning curve’ – but I’m encouraged to believe that interacting with the ‘real’ world might be less daunting than I thought at first. |
neil.r (1738) 66 posts |
I’ve done a bit of playing with motors through the Gertboard, and that’s pretty straightforward too – I hooked up a couple of ducted fan units and a 3S1P li-po pack that I had going spare, which worked perfectly. I don’t think I ever kept the code for that, as it was so similar to the example code that ships with the Gertboard. The LED chasing program, however, has transformed into a WIMP enabled application (snappily titled !LEDs until I can think of something better) with the help of DrWimp. I just need to find a suitable set of sprites now. The plan now is to work through the rest of the Gertboard sample programs, converting them to BASIC where I can. Hopefully this will encourage a few more people to pick up RISC OS when they see how easy it is to do. One thing I’ve found about children and computers is that they are far more interested when the computer does something like switching a motor on, rather then just displaying a character on a screen. Well, not just children come to think of it… |
Jim Gibb (1867) 15 posts |
neil.r: Still waiting for Gertboard – and its too cold to go down to the boatyard to see if I can ‘read’ the NMEA sentences produced by my existing GPS receiver. So further developments on hold for the present. |
patric aristide (434) 418 posts |
Here’s some very old code for reading NMEA GPS data, completely untested, no documentation whatsoever: |
Rick Murray (539) 13851 posts |
NMEA isn’t that hard to parse. Spec here: http://aprs.gids.nl/nmea/ The hard part, of course, is being able to read it in the first place. |
patric aristide (434) 418 posts |
Yeah, the above came from “TimB” over at boatdesign.net, who was quite surprised when I inquired about it:
He sent me the code, saying that
|
Tank (53) 375 posts |
“GPIO_WriteMode” is used to set the GPIO mode, so if you use 0 then the pin becomes an input. |
neil.r (1738) 66 posts |
I’ve got a bit of BASIC that reads the three pushbuttons on the Gertboard – I’ll dig it out later and post it up. Need to get out to my shed first, and that will require several large mugs of tea. |
Jim Gibb (1867) 15 posts |
Thank you: all very helpful. |
Rick Murray (539) 13851 posts |
|
neil.r (1738) 66 posts |
Here goes:
|
Jim Gibb (1867) 15 posts |
Yes – ‘The A-Team’ – wonderful support! |
Jim Gibb (1867) 15 posts |
Hi! |
Ronald May (387) 407 posts |
Jim, DEFPROCSet_BaudRate(baud%) should be changed to DEFPROCSet_BaudRate(baud%) The error was noticeable at 38400 in my tests, but note that Terry’s 115200 bodge actually conforms to the latter formula. |
Jim Gibb (1867) 15 posts |
Thanks, Ronald. |
Pages: 1 2