@fdlou147 According to my personal experience, I'd recommend to split up Gateway and Node funktionality and use two seperate mcu's.
Wrt. to the code itself: you only set up a debouncer on one of the pins (finally: Pin 5), as you always redefine the same "flags" over and over again. Perhaps have a look at this imo excellent multi relay/button sketch by korttoma here. This one should be not to hard to adopt to your needs (still, I'd recommend two mcu's).
Forgot about this guy... Updated the project a little, the PCB now have footprints for both normal and PA+LNA modules.
The old boards are still available on the github repository if needed.
Even with the extra length added to the PCB with the dual footprint, it is overall still smaller than a regular non SMD NRF24L01 module.
@jvdk I agree with the point made by @evb , why would you want to wire connect the ultrasonic node rather than the usual radio connection ? You are adding levels of complexity and power demands for what reason ?
My ultrasonic water tank node (pro-mini+rfm69) is now 2 years on the same 2xAA batteries sending in levels every hour (RTC), the only problem encountered - condensation forming a drip on the face of the ultrasonic head during very low temperatures.
Hi @blackchart,
Unfortunately, all devices are sold out. Further production is possible only when ordering more than 10 devices (in this case, I also can modify the device to suit your needs).
@nrf24_is_hard When I sent data between an Aduino and the RPi I discovered that I have to make the the receiving and the sending structs the same size AND the variables be on 4 byte boundaries. Change your char name[15] to char name[16]
Another challenge is that the number of bytes of type int are different. If I remember correctly, Arduino Uno is 2 bytes and RPi is 4 bytes.
To make matters worse, some compilers make the least significant byte the first byte of a word and others make it the last byte of a word. eg, sending the value 1 would be received as 16777216 (0x00000001 vs 0x01000000)
There are a lot more gotcha's
OSD