KuzniaCo / Haris

Experimental IoT Platform
GNU Lesser General Public License v3.0
2 stars 0 forks source link

Find way to change settings in temperature cube #14

Open sebcza opened 7 years ago

sebcza commented 7 years ago

Temperature cube working in simple algorithm:

  1. Get temperature from sensor
  2. Send temperature value via RF24
  3. Sleep device for 5 minuts using pwrDownMode
  4. GOTO step 1

When device is sleep also sleep RF24, so in this time Arduino can not received any messages. Possibility to received message is only between steps 1 and 3 or 3-4.

Temperature Cube has settings: IntervalReading

kkulewski commented 7 years ago

RF24 itself won't feed any data to sleeping MCU (Arduino). Possible solutions:

  1. Interrupts: use RF24s IRQ pin to wake MCU on demand. Keep in mind that a short delay is required between wake-up signal and radio data read, so master has to send (at least) two separate messages to mentioned cube.

  2. Running MCU at 1 MHz - lower power consumption at the cost of preparing custom bootloader and adjusting external libraries, as it will mess up the clocks.

  3. Send multiple requests with the same ID to MCU every x minutes + keep ID of the last request in a variable. This way, MCU will be able to determine whether recently received request should be:

    • ignored (receivedID == previousID)
    • processed (receivedID !=previousID)

So let's say RPi always sends request 10 identical requests, every 30 seconds, so transmission lasts 300 seconds. MCU wakes up, listens for 45 seconds and falls asleep for next 255 seconds (15% awake, 85% asleep).

I'm not sure it is worth the hassle, but if so - the last solution seems to be a way to go.