Hearth Beat between TX and RX
Capt Magellan
Posts: 6
Hi Guys,
Need some help....
I need to create a device that is constantly sending an heart beat to a receiver. If the receiver for wathever reason looses contact with the transmitter (say is to far away) then the receiver will trigger an alarm.
The hardware I am using are 2 Basic Stamp 2 and TX and RX Parallax modules.
Do we have any kind of watch dog commands ? so that if the "SERIN 1, 16780, [noparse][[/noparse]WAIT("XYZ"), PONG]" doens't receive anything withing 10 secs whould then continue·and trigger an alarm
Any suggestion will be greatly appreciate.
Need some help....
I need to create a device that is constantly sending an heart beat to a receiver. If the receiver for wathever reason looses contact with the transmitter (say is to far away) then the receiver will trigger an alarm.
The hardware I am using are 2 Basic Stamp 2 and TX and RX Parallax modules.
Do we have any kind of watch dog commands ? so that if the "SERIN 1, 16780, [noparse][[/noparse]WAIT("XYZ"), PONG]" doens't receive anything withing 10 secs whould then continue·and trigger an alarm
Any suggestion will be greatly appreciate.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Thank you for your reply.
I checked the commands listed for the BASIC STAMP SX and I couldn't find this... any hint ?
Take a look at the help file under serin.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Thank you appreciate your help !
/Dino
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
In my solution I may have multiple transmitters... is there a way to don't make interfeer with each other now that I cannot use the WAIT in combination with the pause...?
I recommend XBee transcievers. They use clear channel assesment prior to sending data (like WiFi) to prevent data collision, and they also can buffer data so the BASIC Stamp doesn't need to worry about missing the data when not 'looking'.
There's BS2 code and examples are in the docs I wrote for adapter boards for these units I make. - see the bottom of the page for docs. The devices also have a sleep mode that BS2 can control to limit current draw helping that battery life. Just don't put your receiving unit to sleep or it will miss the data.
http://www.selmaware.com/appbee
Safe journey when you go!
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
It worked as I would have expected it to, despite your caveat. Is there something I've misunderstood?
-Phil
Did you try sending data other than "xyz" or send "xyz" without any additional data? That may be the bogus case.
Bruce
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
Yes, to both. It just works.
Of course, you have to remember that, if you send it "xy", let it time out, then send "z" and a number, it doesn't remember the "xy", since it's starting over. But in a typical application, the pattern you're looking for occurs in a burst anyway, so this is not an issue.
-Phil
That behavior can be a flaw when used with a noisy communication channel, such as a radio link. Some radios increase their gain, agc, when nothing is coming in, until the data slicer finds some noise to slice. No squelch. So serin never times out. That is the cheapest AM radios. That does not apply to more sophisticated radios or to devices like the xbee's that Martin likes, because they send only valid data through to the receiver.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Now that you mention it, what Martin probably meant to say is that the timeout doesn't apply to the WAIT pattern, per se, but operates at a lower level on any data received.
-Phil
That makes perfect sense and seems logical as well.
Bruce
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting, and XBee Wireless Adapters
Southern Illinois University Carbondale, Electronic Systems Technologies
Thank you all for your great help !
BR/Dino
And here's the output, with my keyboard input echoed:
aabaac Got it! baabaac Got it! a
aabaacaabaac Got it!aabaabaacaabaac Got it!
The patterns that it "should" have recognized, but didn't, are in red. What this means is that the pattern matcher never backtracks. When a match fails, it just starts over from the beginning of the pattern. This is okay in most situations, as long as you keep in mind that that's the way it works.
-Phil
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com