Wireless (433MHz) GPS retransmission to IceTube
Moderators: adafruit_support_bill, adafruit

Wireless (433MHz) GPS retransmission to IceTube

by grumpygasbag on Thu Aug 30, 2012 5:52 am

Back in June, in another thread...

http://forums.adafruit.com/viewtopic.php?f=41&t=25108&start=30#p149757

...I posted a question for WBP...


grumpygasbag wrote:
Can I ask if your firmware (which has been running beautifully since I loaded it!) includes checksum verification of the GPRMC sentence?

Why do I ask?

Well, I have been experimenting with 433MHz wireless re-transmission of the GPS data, so my clocks don't need to be placed close to a window.The BR355 is plugged into small circuit that just re-transmits the RS232 data for 15 seconds every few minutes (if transmitted continuously it blocks my garage door remote!) and it's then received by one of those small 433MHz receivers and turned back into RS232.

I've managed to get this working quite reliably with my nixie clocks (the clocks from Jurgen Grau and Pete Virica both include checksum verification of the GPRMC sentence and any incorrect strings are rejected) but the Ice Tube frequently has this peculiar problem - the hours get set to zero (usually) and the location data is corrupt but the minutes and seconds are ok. I've noticed it can go from correct time to corrupted time and back several times within the 15 second data transmission burst!

If the Ice Tube is wired directly to the BR355 there is no problem, of course. It only occurs with the wireless re-transmission system which is, not surprisingly, much less reliable.

If anyone else is interested in experimenting with this idea, Jurgen Grau now has some wireless GPS modules available that should work, more or less reliably, with any clocks that can take RS232 satellite data.

<http://www.nixiekits.eu/> (see the bottom of his "Sven" clock page)




There was quite a bit of discussion between William and myself in that thread about this issue, and indeed William did implement the checksum, discussed in a separate thread...

http://forums.adafruit.com/viewtopic.php?f=41&t=31146

That didn't solve my problem. It took a while to figure it out, and William can expand on this if he wants, but the problem was a bug in the buffer-length handling for the GPS data. This bug did not affect hardwired GPS receivers, since the buffer never filled, but with all the gibberish coming in from the 433MHz receiver between data bursts (see explanation above) the buffer filled, a null character was added, and that null character overwrote the first bit of data in the subsequently defined variable in the hex file (which just happened to be the time). This caused the hours to keep reverting to zero (the time on my clock kept coming up "00.mm.ss"). William cleverly spotted the problem after I wondered allowed (well, by email) about what I thought was a problem with the buffer-length definition. I wasn't quite correct, but it made William look in the right place. Nothing like a bit of teamwork :) . William deserves the credit, however, and I am most grateful for his patience with me.

William's latest IceTube firmware version, which I think he will make available shortly for both 168 and 328 processors, includes new GPS handling routines, checksum verification of the data, and a buffer-length fix to solve the rather unique problem I was having.

The fact that my GPS retransmission system (single BR-355 GPS receiver connected to a prototype of Jurgen Grau's 433MHz data transmitter) is now working flawlessly with the IceTube (using a very cheap 433MHz superhet data receiver), as well as all my other nixie clocks, meant that I could incorporate the receiver onto the IceTube circuit board itself, rather than having external connectors. Happy to post further details if anyone is interested, but here are some pics. The first one shows the tiny (12x10mm) 433MHz receiver module and how I mounted it the the left side of the board, through 5 small holes I drilled, with the ground pins soldered to the board's ground plane underneath. The insulated Vcc, data and antenna wires can be just made out in the blurry photo (sorry). You can also see the unemployed ATmega168V processor I've replaced with a 328p.

IMG_0743.jpg
IMG_0743.jpg (113.05 KiB) Viewed 1968 times
grumpygasbag
 
Posts: 33
Joined: Fri Mar 30, 2012 5:28 pm
Location: Sydney, Australia

Re: Wireless (433MHz) GPS retransmission to IceTube

by grumpygasbag on Thu Aug 30, 2012 6:04 am

The 433MHz receiver module I used I got from eBay for a couple of dollars. It's from Canton-Electronics and the model number is HYRM83C1-433. It goes by various other model numbers too. I tried to post a link but the forum thingo blocked it as likely spam. You should be able to Google it.

Here's another pic showing the module mounted next to and over the 5V regulator. It occurred to me later that it might be better mounted vertically, to allow easier access to the regulator mounting screw, but that's not a big problem. The white wire heading out the right (back of board) is the 17.4cm long antenna. It passes out through a tiny hole in the case (see later photos).

IMG_0752.jpg
IMG_0752.jpg (92.17 KiB) Viewed 1966 times
grumpygasbag
 
Posts: 33
Joined: Fri Mar 30, 2012 5:28 pm
Location: Sydney, Australia

Re: Wireless (433MHz) GPS retransmission to IceTube

by grumpygasbag on Thu Aug 30, 2012 6:06 am

Here you can see the clock cased up again, antenna for the 433MHz receiver module coming out the back.

IMG_0756.jpg
IMG_0756.jpg (99.67 KiB) Viewed 1966 times
grumpygasbag
 
Posts: 33
Joined: Fri Mar 30, 2012 5:28 pm
Location: Sydney, Australia

Re: Wireless (433MHz) GPS retransmission to IceTube

by grumpygasbag on Thu Aug 30, 2012 6:15 am

And here's my clock (in front of one my Dad made with his wood lathe), showing my latitude, just to prove you no longer need your IceTube directly attached to a GPS receiver to get the data into it :D

A rather neat mod, I reckon!

So, my clock now has a 328p processor, auto-dimming, daylight saving time correction, *wireless* GPS reception, last digit brightness correction, and some fancy seconds display options.

Thank you, William, for all your help with the code. THANK YOU!

IMG_0757.jpg
IMG_0757.jpg (98.73 KiB) Viewed 1965 times
grumpygasbag
 
Posts: 33
Joined: Fri Mar 30, 2012 5:28 pm
Location: Sydney, Australia

Re: Wireless (433MHz) GPS retransmission to IceTube

by adafruit_support_bill on Thu Aug 30, 2012 6:23 am

Very nice work there! :D
I tried to post a link but the forum thingo blocked it as likely spam.

Sorry about that. The spammers have been getting more aggressive lately so we have had to beef-up our defenses. I guess that's the price of popularity.
User avatar
adafruit_support_bill
 
Posts: 31070
Joined: Sat Feb 07, 2009 10:11 am

Re: Wireless (433MHz) GPS retransmission to IceTube

by grumpygasbag on Thu Aug 30, 2012 5:28 pm

The hardware mod was only possible because the work William has done on the firmware. He deserves all the kudos.

And no need to apologise about the spam-defence. Perfectly reasonable. We can work around it quite easily.
grumpygasbag
 
Posts: 33
Joined: Fri Mar 30, 2012 5:28 pm
Location: Sydney, Australia

Re: Wireless (433MHz) GPS retransmission to IceTube

by wbp on Thu Aug 30, 2012 8:29 pm

It was a great deal of fun working with (not so) "Grumpy"! This turned out to be a bit of a challenge, and I love challenges. The bug was in the original GPS support - the check for space available in the string buffer did not take the null string terminator into account, so when the code thought there was room for one more character in the buffer, there really wasn't. It just happens that the time value was the next thing the compiler put in memory after the GPS buffer, so the first digit of the hour gets replaced by a zero. My experience working on compilers came in handy figuring this one out!

This bug can actually show up with a direct wired GPS receiver, not just Grumpy's noisy radio link. All it takes is one character missing from the NMEA string and the buffer will overflow. I had actually seen the hours go to zero now and then but didn't know why. Now we do.

This mod also has the benefit (thanks to Grumpy's asking for it) of adding checksum parsing and checking to the GPS support, which makes it more reliable. And, we now have it running on the 328P, so there's plenty of memory left for more mods... :-)

I'll post a new version of the firmware in a new thread any day now... I want to put the 328p mods under #define control so there is only one source for both versions.

William
User avatar
wbp
 
Posts: 226
Joined: Mon Mar 07, 2011 1:18 pm