-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Help making sense of the library NodeMCU #403
Comments
Is your issue #399 solved? Please also describe the symptoms of it "struggling getting these 2 rf modules to talk to each other", what part is causing you troubles? If it's a general programming question, just for future reference, Arduino stackexchange might be better-suited. Issue trackers are usually meant for library-related issues. |
The 2 modules will not communicate. The NodeMCU won't receive anything from the Arduino, not matter what example code (the ones included in the library or otherwise). My conclusion is that the NodeMCU won't talk to the rf24l01 module. The code does compile, which was the issue in #399. The wiring on the Arduino is up to spec, I think the issue with the NodeMCU is in the both the wiring and/or code. |
Maybe it's the code that specifies the wiring are you 100% sure you're using ESP8266's SPI pins and the right CE and CS (defined in the code)?
Might worth checking again. At the bottom of this page there's a table that contains the common values http://tmrh20.github.io/RF24/ .
Just saying, NodeMCU is the firmware running on the ESP8266, not the device itself. |
I just verified the pins the the NodeMCU again and they match the pins in the code. In that link you gave me the AT tiny pins match the pins that I have on the NodeMCU, so can I use those pins instead? And would I have to alter the code in order to do that? |
What part about the default unmodified examples is unclear? Maybe I can improve them. For the getting started example I found the setup easy to follow. I just got lost in the loop. I didn't know what it was sending and where that sending code was ( so I could modify it) . I think It would be easier to understand if the transceiver and receiver code were placed in separate examples. |
That is not right at all. ESP8266 SPI SCK is D5, MOSI is D7 and MISO is D6, CE and CS you can pick yourself. Also just use the built-in examples, the ones floating around on the internet aren't usually updated at all and most of the built-in examples have been confirmed working on all these platforms unlike random pieces of code on the internet. See this line https://github.com/nRF24/RF24/blob/master/examples/GettingStarted/GettingStarted.ino#L16 for CE and CS pin definition.
I recommend you learn how pointers work then.
They sending and receiving parts are well described by the comments and are fully modular, meaning there's only the effort of understanding that code needed, which you would still need to do if they were in different files. |
Ok thanks for the advice! So is the code that I have right now work with your library? |
Sorry for the typo. So does the code that I have right now work with your library?* |
Possibly, but I can't be fully certain. Using built-ins is better for that exact reason. |
Ok I'll give it a test run and see if it works. |
My code doesn't seem to be doing anything after I rewired the NodeMCU. |
I'm going to try it with the LED remote example |
In your setup() method call radio.isChipConnected() and inspect what it is returning. If you have false then you probably have some hardware issues. Do like this:
You can do this for Arduino and for NodeMCU. Then you will see what board has no connectivity to nRF24 chip. If you have true on both boards then then it means that hardware is good. Then you can start inspecting uour source code. |
The LED Example didn't work. I got a reading of true from the Arduino and no reading from the NodeMCU, as in nothing is getting printed |
@Watson221 So you rewired the module, right? Picked two pins for CE and CS and set them in the code, right? Then make sure you fully read the example and make sure the radionumber is right, both can't have the same radio number https://github.com/nRF24/RF24/blob/master/examples/GettingStarted/GettingStarted.ino#L13 . |
Yes I triple checked the ce and cs in hardware and in the code for both the NodeMCU and the Arduino. |
I also made sure the radio number was different |
So after that you uploaded the example code accordingly to both modules and only the Arduino gives any output? |
Yes, now after unplugging the NodeMCU and replugging it in I'm getting a lot of symbols. |
Make sure you have set your serial terminal to 115200 baudrate. |
I do have it set to 115200 |
Then there's something else totally broken in your setup. |
It now reads this ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 1384, room 16 |
I had the wrong terminal opened! That's what I got from the NodeMCU |
It may be some hardware issues with nRF24 chip interface to NodeMCU and radio.begin() stucks. Please print something to serial before radio.begin():
And @Watson221, one more question: what kind on NodeMCU board you have? v0.9 or E12? Please type in google nodemcu pinout and in the results switch to Images tab and find your board. Then you will see what pins are used for SPI. |
Don't connect CE or CS to reserved pins (GPIO 0, 2 or 15) on your ESP8266, also make sure you sufficiently and properly power your ESP8266. |
https://circuits4you.com/wp-content/uploads/2017/12/nodemcu-pinout.png That's my NodeMCU I think it's v.09 but I'm not sure. GIO translates to pin 3, which I'm using for CE. I've switched it over to 1. |
ets Jan 8 2013,rst cause:2, boot mode:(3,6) load 0x4010f000, len 1384, room 16 |
I get that now |
Do I hook up the mosi, miso, ect. pins on that diagram to the rf module? |
@Watson221 Check out esp8266/Arduino#2414 and https://forum.arduino.cc/index.php?topic=408876.0 for more information about that boot mode and possible causes. Please keep in mind that board is actually called ESP(8266)-12E the firmware on it is called NodeMCU, it's just easier to understand you when you use the correct terms. |
Yes I have the ESP(8266)-12E connected to the hmosi, hsclk, etc. |
Thanks for the information on proper terminology |
You know I don't think all this hassle is worth it! I think I'm just going to order another Arduino uno and use that instead! This is crazy! |
@Avamander , I know that the main chip on those boards is ESP8266, but I always thought that those boards are called NodeMCU. That's probably because in Arduino IDE you can choose the following boards from the Tools -> Board menu:
|
Hey guys,
I'm having some problems again. I couldn't figure out how to use the pins_arduino.h library. I'm really struggling getting these 2 rf modules to talk to each other. I've tried tons of different examples from all over the internet and this version is the one I could actually understand. Thanks for helping!
This is the code I have for the NodeMCU
And for the Arduino
The text was updated successfully, but these errors were encountered: