natevw / node-nrf

Pure-JavaScript nRF24L01 driver library
117 stars 31 forks source link

how to enable multiple readers on the same pipe #19

Open catharsis79 opened 10 years ago

catharsis79 commented 10 years ago

Hello, I was wondering if the following configuration is safe (eg, not messing up the comms among the actors). I have a raspi and 2 arduinos. Mainly the raspi receives messages from the 2 arduinos (sensor readings) BUT, sometimes, I'd like the raspi sends messages to one arduino (but don't care if this message is received by both of them). So, my configuration: a) The raspi has 2 reading pipes and the 2 arduinos have exclusive write access to them (one each). In this way I should be able to send sensing info from the arduinos to the raspi. Is it correct? b) Then, when the raspi wants to send info to the arduinos, it uses its own writing pipe on which BOTH the arduinos are listening to (so not exclusively accessing this pipe). Is this config the only feasible one to deploy my idea? Am I missing anything important? Should I at least disable the autoack feature? Thank you (especially for sharing this great lib!)

VaclavSynacek commented 10 years ago

Hi, I have not done this with node-nrf, but the nRF24l01 hardware is sure capable of running in your setup. The a) is definitely ok, that is how it is meant to be. The b) is not so standard but should work too. It you keep the autoack on both arduinos it might be a bit unstable, as both arduinos might transmit the ack payload at almost the same time and interfere with each other (but if you get lucky, than it might as well work). Disabling autoack on one of the arduinos should be fine, the other one will still ack the delivery and stop RPi from retransmiting. Disabling autoack on both will also do, in that case disable the retransmitting also on the RPi side.

catharsis79 commented 9 years ago

thx, will try it out asap