Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RF24 sends data backwards! #3

Open
natevw opened this issue Mar 4, 2014 · 6 comments
Open

RF24 sends data backwards! #3

natevw opened this issue Mar 4, 2014 · 6 comments

Comments

@natevw
Copy link
Owner

natevw commented Mar 4, 2014

Well, I guess it's debatable but in short the datasheet for the nRF24L01+ says that data should be clocked over the SPI bus LSByte first. However this is not what RF24 does!

For RF24.cpp↔︎RF24.cpp communication, this isn't a problem since it's read back in the same order too. But because of that right now users of our code will get everything "in reverse" when talking to an e.g. Arduino :-/

Probably best to just add a special option to openPipe to handle this automatically for the user, otherwise this will be a major compatibility annoyance!

@darrylhodgins
Copy link

This wouldn't be the root cause of my inability to make RF24 on an Arduino talk to node-nrf on a Pi, would it? Hmm...

@natevw
Copy link
Owner Author

natevw commented Mar 11, 2014

Could certainly be part of it. Naturally, you'll also need to make sure the channel/CRC/ack/etc. settings all match too.

I've been able to RX on the Tessel from an Arduino broadcasting (I turned auto-ack off to passively listen, since another device was sending those packets already) with mostly just a simple data reverse:

Array.prototype.reverse.call(d); // WORKAROUND: https://github.com/natevw/node-nrf/issues/3

@Manawyrm
Copy link

Manawyrm commented Jun 9, 2014

ugh. Yeah. Such an option would really be nice.
Also: not only RF24 but also the other lib (MiRF) does this. I'm not quite sure who's at fault here, but I think this should be supported.

Also: all the addresses are reversed to (which caused my issues...).
Would you accept a pull request which adds options to the streams for reversing them?

@natevw
Copy link
Owner Author

natevw commented Jun 9, 2014

Sure, would appreciate it! It should probably be an additional option on nrf.openPipe() (rather than the module or instance) in case people are talking to both Arduinos and Pi/Tessel remotes.

Odd the addresses are reversed, I thought I'd tackled that one already but maybe not tested enough. Thanks for the followup (and patience)!

@natevw
Copy link
Owner Author

natevw commented Mar 1, 2015

This is implemented in 3b24f10 as part of the (currently broken) overhaul at #32. It might be possible to cherry-pick that work into master sooner, but personally I want to focus on getting the full set of improvements ready for release rather than backporting.

@nkolban
Copy link

nkolban commented Sep 12, 2016

What is the status of this fix? It looks like there was some activity 18 months ago but never made it into the master. Is this project still being maintained? Is there something we (the fans of this project) can do to assist? I see there are also some old pull requests outstanding ... are these going to be addressed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants