-
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
[Question] Not conexion between ESP32 and RPi #705
Comments
They cannot be the same node. It doesn't matter which one is node 1 or 0 as long as they aren't the same node. |
Okay, when I run the example, I assign each one a different node, and yet they don’t communicate with each other. In the RPi I get the message "Nothing received in 6 seconds. Leaving RX role". ESP32 (TX): RPi 4B (RX): Does this help to know what my problem is and why I am not able to run the base example? PS: my sensor nRF24L01 is this: |
That module is a nRF24L01+PA+LNA. The PA/LNA part is important because it requires more power to TX (also during RX mode because the ACK packets are automatically sent in response to the ESP32). Those PA/LNA modules' store pages rarely say that they require a separate power source and electromagnetic shielding to work correctly -- in a way they're a bit of a scam unless you're an expert. The higher power requirement is also probably affecting your ESP32 board (RPi definetly doesn't supply enough power on the 3v pin). What ESP32 board are you using (store link please)? |
The ESP32 is purchased here https://es.aliexpress.com/item/4000343057472.html model ESP32-WROOM-32D. So, instead of connecting him to the 3.3V pin should I connect him to the 5V pin? On the ESP32 I would have no problem, but on the RPi I get a little off. I picked it up with antenna because they’re going to be away (less than 1 kilometer). About the electromagnetic shielding, you could give me more information or reference me to some manual/guide, I don’t know what that is |
Thank you for asking first because that would fry the module. By "power" I mean the current coming from the 3v pin. The module has to be powered by 3v (maximum), but to TX it needs at least 112 mA (possibly more). The RPi taps out at ~40mA, and the ESP32 boards often consume most the current from their onboard 3V regulator. This is why a separate 3v power supply is needed to make the PA/LNA modules work.
Read my comment on another issue (from my Circuitpython repo) starting with the second paragraph. |
Thank you @2bndy5 for the answers
Understood, as I put before, for the ESP32 I have no problem because I had planned to feed it with a battery of 3.7V, I could connect the nRF24L01 to the same battery, adding a voltage reducer to 3.3V (800mA) not to burn it, or would I use a direct connection? About the RPi, I didn’t think I would need an external source (beyond a power bank). Would I do with the same gearbox from the power bank? (I am thinking of a solution that better suits me not to have to put a new source)
Perfectly explained ;)
The distance I need will cover between 100 and 200 meters with walls in between, with the simple module does not suit me, that’s why I went for PA/LNA |
Don't directly connect it to the batteries! Use a voltage regulator (800 mA should be plenty if there is nothing else consuming that current).
If you could tap a voltage regulator into the power bank's 5v lines (from the power bank's extra USB port), you might be ok to connect that to the nRF24. I say might because those power banks usually have a current limiter built in; the total output current is shared between multiple USB ports. BTW, the RPi4 needs more current than older versions of RPi. And typical power banks usually aren't strong enough for even an older RPi (the CPU will lag when the power dips too low). |
Remember the GND is always shared between multiple power supplies. Assuming google translate didn't hit a language barrier with the word "gearbox": Powering motors introduces electric noise in the power lines. Electrical noise is why we have to put capacitors on the nRF24 module's VCC and GND lines. Typically, you don't want to use the same power source for your motors and the MCU/RPi because of the electric noise from the motors. |
I didn’t know this, so an alternative source is better. Yesterday I came up with something about this point but seeing your last comment about noise I don’t know how correct it would be: connect the nRF24 module to the RPi by the 5V pin by applying a voltage regulator to 3.3V/800mA.
Translator’s failure, I wanted to refer to the voltage regulator.
In my case I will not use motors (failure of the translator when introducing that concept), unless the voltage regulator is considered as an engine, or that the voltage regulator also generates electrical noise (in which case my error for understanding that not) What system would you use to power the nRF24 module that is connected to the RPi? |
If you feel that wiring a 3V regulator is beyond your skill level, you can use a specially designed breakout board for the nRF24L01+PA+LNA modules. Those breakout boards use a AMS1117 3V regulator (you may recognize this one because its the same one your ESP32 board is using). Be careful to not purchase a breakout board designed for the ESP8266-01 modules as it doesn't look like they have a 3V regulator soldiered in (and the pinout concerning VCC & GND pins is incompatible with the nRF24L01 anyway).
Sorry, but I'm going to leave this to your research. There are many acceptable solutions out there, and your project's needs (concerning voltage and current) should be the deciding factor. Remember the GND is always shared between multiple power supplies. |
I did not know this module and it makes the work much easier, thank you for introducing me
I understand, thanks to the "breakout board" I feel more comfortable and I can think of several ways to address the problem. Thanks @2bndy5 for all the help offered, I leave the thread open if you want to add something and in a couple of days I close it. If I have any further questions (when I receive the "breakout board") I will put it in a new thread as I guess it will be a different doubt than the initial one. Again, thank you very much |
I’m trying to launch the sample files by putting an ESP32 as TX and a RPi 4B as RX and I can’t get them to communicate with each other.
The sample files I am following are:
For the arduino example I have changed the pins 12 as CE and 5 as CSN, for the rest it is the same source.
My question is, does ESP32 have to be node 0 and RPi node 1, or does it have to be the same node?
The text was updated successfully, but these errors were encountered: