Hi guys,
I'm hoping somebody can explain what is the best method for communication between multiple nodes and the gateway. For the sake of an example, lets say I have 3 nodes that are powered from 9V batteries (which I'd like to make last as long as possible) and one gateway that is powered via USB. I'd like to grab the temperature from each of the 3 nodes approximately every 5 minutes for logging.
I can think of a few ways to do this:
- Nodes just constantly transmit temp data (with short sleep periods) and the gateway ignores the data till 5 mins has passed and then takes one sample - Seems like a waste of energy doing all that transmitting
- Nodes wait for a request from the gateway, send over their temp data, and then sleep - But what if they sleep too long and miss the next request for data, or sleep too short and waste power sitting there waiting
- Some kind of hybrid where the nodes power down for short amounts of time and let the gateway know when they wake to ask for instructions (which may frequently be to go back to sleep) - Seems like it could be rather complex if there is an easier way
And there are probably many other alternatives.
Is there a standard method that is best practice for use with Moteinos?
You can do it in many different ways. The easiest is to sleep the nodes for X amount of time, then wake - read sensors - send data - go back to sleep. That's it. The standard is dictated by your requirements.
Quote from: Naarlack on June 18, 2015, 04:02:21 AM
<snip> I have 3 nodes that are powered from 9V batteries (which I'd like to make last as long as possible)
If you want batteries to 'last as long as possible', don't use 9V batteries (unless your node needs >3.3volts for a peripheral). For a primary battery use two Lithium AA or AAA cells. The 9V battery is rated at approximately 565mAH and almost 2/3s of that power is thrown away converting down to 3.3V. Use two Lithium AAA will give you 1200mAH @ ~3.5V without any conversion loss in about the same volume. (This is just a Thumbnail summary, the details are covered fairly comprehensively elsewhere in the forum)
Quote from: Naarlack on June 18, 2015, 04:02:21 AM
And there are probably many other alternatives.
Yes, for example: Let the nodes sleep except when they collect and report data every five minutes. The gateway collates all the data and reports it when the 3 node has reported in... as discusses in several places throughout the forum.