natevw / node-nrf

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

add startListening and stopListening methods #31

Closed atomicus closed 9 years ago

atomicus commented 9 years ago

As nrf is half-duplex, it would be nice to have 2 methods on rx pipe. startListening stopListening

just to 'pause' when we want to tx something, without a need closing of re-initializing of rx pipe. This would also make your problem of pipe adresse shortage less important.

Take a look here: https://github.com/TMRh20/RF24/blob/master/RF24.cpp for those methods.

natevw commented 9 years ago

The idea is that node-nrf already manages this for you. You may open as many TX pipes as you'd like, and when you transmit it automatically pauses RX as necessary. Please let me know if this is not working for you.

atomicus commented 9 years ago

Ok, I thought that is not happening as I got a lot of packet loss during transmission, but that could be only random issue.

natevw commented 9 years ago

You may get a certain amount of packet loss, anything that a remote transmitter sends while you are not in RX mode will be lost. So if your channel is very busy that could be a lot of packets.

But if it is more than you would expect, there is a chance be that something is not switching it back as quickly as it should. If you see any clues to that with nrf._debug = true on, I'm happy to reopen this issue and investigate further.