I am starting a project to modify the Sump Pump alert sketch for use with an aquarium sump in order to alert extreme water levels. It appears that the RF12B was used in the original project and is not directly interchangeable with the RF69W radio. Since I currently have several R4 Moteinos with RFM69W and plan to share my existing garagemote gateway, I need to stay with the RF69W.
Felix, have you modified the code to this or any other projects for such an upgrade? If so, is the sketch available?
Rick
Rick,
I have not upgraded that code yet, but it's pretty trivial to do so. The code is much simplified for RFM69, instead of sending and waiting for ACKs you just use sendWithRetry(...), and then instead of the receiveComplete() + CRCpass() you just do receiveDone(). Much everything else is the same but watch for order of parameters in the initialize() function. Just take a look at the Node and Gateway examples, you can pretty much copy paste most of that to replace the functionality in the SumpPump node.
Thanks, Felix. I modified it per your notes, it worked the first time! Would you mind taking a look at my code to see if there is anything that I missed? I posted it at http://pastebin.com/embed.php?i=Xh5dCymH (http://pastebin.com/embed.php?i=Xh5dCymH).
The next step is to add the code to my GarageMote gateway. Any tips on getting started? I have not seen any examples of using multiple nodes to one gateway, but it doesn't seem too tough. I also plan to add a MailboxNotifier and a Doorbell text messenger when I get the hang of it.
The SumpPumpAlert is polling the HC-SR04 quite rapidly, like about 10 times per second. Is that as designed? Seems a little often, just wondered if that was how you had it running.
BTW, when I was testing the alert mote, I noticed that my dog seemed to be paying a lot of attention to the HC-SR04. When I started to point it around at the floor, he started going nuts like he does when I play with him using a laser pointer pen. He would chase the sound reflection around the room just like it was a laser beam. I checked the data sheet and found that it runs at 40,000 Hz. Mr. Google confirmed that dogs can hear up to 40-45,000 Hz. Crazy!
It looks good to me. All the stuff related to garageMote is at lowpowerlab.com/garagemote
Adding more nodes to a gateway is trivial, just add them to the same "NETWORKID" and a different NODEID. The gateway should then receive the packets and pass them on to the host via UART. Then in your python or host code you can do whatever you want with those tokens.
You can change to once a minute, that should be sufficient, especially if you want to use a battery and put the node to sleep to save power.
I'm not surprised the dog can hear it. I can barely hear a tick when it's turned on for the split second too :)