Go Down

Topic: ESP8266 version 12E with NRF24L01 - SOLVED! (Read 4755 times) previous topic - next topic

silly_cone

Dec 29, 2016, 06:14 pm Last Edit: Dec 29, 2016, 07:38 pm by silly_cone
This is something that's been giving me difficulty for months now.  I almost abandoned the project, but last night decided to give it another go, and thanks to the dutiful efforts and brilliance of others, I have found the solution!

The problem was that I wanted to connect an ESP 12-E to an NRF24L01 module to integrate it into an RF24 network.  This would allow the 12-E to act as a bridge between my house RF24 network and the internet.  But it seemed that no matter how I connected the NRF to the 12-E, they just wouldn't communicate.

But then I came across these two pages (below), where people had figured it out!  It requires the use of the hardware SPI pins on the 12-E, which also require a pull-down resistor from pin D8 on the 12-E to activate HSPI mode.

Pin connections are as follows:

NRF               ESP-12E
CSN ---------------- D8
MOSI --------------- D7
MISO --------------- D6
SCK ---------------- D5
CE ------------------ D4

Also remember, D8 must be tied to ground via a 3-5 KOhm.  The page I referenced recommends a 4.75 kOhm resisitor, but I used a 3.3 kOhm successfully.  Do not connect directly to ground, use a resistor!

Then in your code, initialize the radio normally, using "RF24 wirelessSPI(2, 15);".

While I was testing it last night, I had difficulty getting it to transmit properly at first.  I had it set up to send an incrementing integer every 500 mS, but it wasn't being properly received by the other node.  I increased the interval to once every second, then it began to work perfectly and ran for about 10 hours before I unhooked it.  I don't know if it was coincidental that it started working once I changed the interval or not. 

Also, I have not tested it full RF24 network functionality yet.

websites referenced:
https://github.com/TMRh20/RF24/issues/125
http://d.av.id.au/blog/esp8266-hardware-spi-hspi-general-info-and-pinout/

silly_cone

Update:

RF24 Network implements successfully on the ESP8266.  I now have a functioning system that retrieves Date and Time information from NIST through wi-fi and broadcasts that out to the RF24 network.  Just remember to add a few delay()'s throughout the code to keep the ESP running stably. 

issac_itd

Thank u very much!

Just what i was looking for.

My ESP-12 is now working with NRF24L01 module!

derver

erorr
ets Jan  8 2013,rst cause:2, boot mode:(3,7)

load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v0c897c37
~ld

help me

derver

turns out this error is encountered?


Soft WDT reset

ctx: cont
sp: 3ffef820 end: 3ffefb60 offset: 01b0

>>>stack>>>
3ffef9d0:  401063bc 3ffee8f0 3ffee910 401064b5 
3ffef9e0:  00000010 3ffee8f0 3ffee910 402029f8 
3ffef9f0:  00000017 3ffee8f0 3ffee8f0 40202a40 
3ffefa00:  00000017 00000000 3ffee8f0 40202a71 
3ffefa10:  00000010 00000000 3ffee8f0 40202eeb 
3ffefa20:  00002cee 000000cc 3ffee8f0 40202fe9 
3ffefa30:  cccc3ce3 000000cc 00000000 00000000 
3ffefa40:  3ffee768 00000001 00000000 40202489 
3ffefa50:  00000003 00000000 3ffee8f0 00000000 
3ffefa60:  00000001 00000000 3ffee768 40202503 
3ffefa70:  00050001 feefeffe feefeffe feefeffe 
3ffefa80:  00000000 3ffee910 3ffee8f0 401064b5 
3ffefa90:  401063bc 3ffee910 3ffee8f0 00000004 
3ffefaa0:  00000038 3ffefb30 3ffee768 402027f7 
3ffefab0:  3ffefb38 3ffee8f0 3ffee910 40202a00 
3ffefac0:  401063bc 3ffee768 3ffefb30 00000018 
3ffefad0:  00000004 3ffefb30 3ffee768 4020286a 
3ffefae0:  00000000 3ffefb38 00000038 3ffeeb2c 
3ffefaf0:  00000001 3ffee768 3ffeeb08 402039b1 
3ffefb00:  3ffe88e0 3ffeeb2c 40203ba4 3ffeeb2c 
3ffefb10:  00000001 3ffee768 3ffeeb08 402029b3 
3ffefb20:  3fffdad0 3ffee768 3ffeeb25 40201fa0 
3ffefb30:  00010000 00000072 00000000 40203bc5 
3ffefb40:  3fffdad0 00000000 3ffeeb25 40203bf0 
3ffefb50:  feefeffe feefeffe 3ffeeb40 40100108 
<<<stack<<<
!⸮
J⸮J!!⸮H⸮

jandrioli

turns out this error is encountered?


Soft WDT reset

ctx: cont
sp: 3ffef820 end: 3ffefb60 offset: 01b0

>>>stack>>>
3ffef9d0:  401063bc 3ffee8f0 3ffee910 401064b5 
<<<stack<<<
!⸮
J⸮J!!⸮H⸮
Your issues have possibly 2 causes:

1 - bad code, like heap/stack collision, or some other bad referencing type of code bug

2 - bad sketch upload configuration; make sure the settings selected are correct for your device. For example the Flash (SPIFFS) size, speed, mode (DIO/QIO), all of these play crucial role.

Good luck.

srinivasa_rao_pedada

hello silly_cone can you please post your sample code which was successfully working with nrf24l01, which would help me a lot in modifying mine.

Robin2

This Simple nRF24L01+ Tutorial may help. I have not tried it with an ESP8266 but as the TMRh20 RF24 library seems to work the examples should.

Wireless problems can be very difficult to debug so get the wireless part working on its own before you start adding any other features.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

srinivasa_rao_pedada

Hello Robin thanks for the reply. I don't have much knowledge in programming and sorry if there are any technical or grammatical errors.

I have successfully  programmed and compiled NRF24L01 modules with arduino uno, but i need both LORA and RF communication because my project involves around 12 number of master slave communication. So i want to compile the same program with NODEMCU and NRF24L01. So i made the pin configuration like this

NRF                         ESP-12E
CSN ---------------- D8
MOSI --------------- D7
MISO --------------- D6
SCK ----------------  D5
CE ------------------ D4

and D8 pin grounded through 4.7K ohm resistor.

my code which was successfully working arduino is:





srinivasa_rao_pedada

code attached below. When I upload the code it gives me the following error in serial monitor.

Soft WDT reset

ctx: cont
sp: 3ffef820 end: 3ffefb60 offset: 01b0

>>>stack>>>
3ffef9d0:  401063bc 3ffee8f0 3ffee910 401064b5  
3ffef9e0:  00000010 3ffee8f0 3ffee910 402029f8  
3ffef9f0:  00000017 3ffee8f0 3ffee8f0 40202a40  
3ffefa00:  00000017 00000000 3ffee8f0 40202a71  
3ffefa10:  00000010 00000000 3ffee8f0 40202eeb  
3ffefa20:  00002cee 000000cc 3ffee8f0 40202fe9  
3ffefa30:  cccc3ce3 000000cc 00000000 00000000  
3ffefa40:  3ffee768 00000001 00000000 40202489  
3ffefa50:  00000003 00000000 3ffee8f0 00000000  
3ffefa60:  00000001 00000000 3ffee768 40202503  
3ffefa70:  00050001 feefeffe feefeffe feefeffe  
3ffefa80:  00000000 3ffee910 3ffee8f0 401064b5  
3ffefa90:  401063bc 3ffee910 3ffee8f0 00000004  
3ffefaa0:  00000038 3ffefb30 3ffee768 402027f7  
3ffefab0:  3ffefb38 3ffee8f0 3ffee910 40202a00  
3ffefac0:  401063bc 3ffee768 3ffefb30 00000018  
3ffefad0:  00000004 3ffefb30 3ffee768 4020286a  
3ffefae0:  00000000 3ffefb38 00000038 3ffeeb2c  
3ffefaf0:  00000001 3ffee768 3ffeeb08 402039b1  
3ffefb00:  3ffe88e0 3ffeeb2c 40203ba4 3ffeeb2c  
3ffefb10:  00000001 3ffee768 3ffeeb08 402029b3  
3ffefb20:  3fffdad0 3ffee768 3ffeeb25 40201fa0  
3ffefb30:  00010000 00000072 00000000 40203bc5  
3ffefb40:  3fffdad0 00000000 3ffeeb25 40203bf0  
3ffefb50:  feefeffe feefeffe 3ffeeb40 40100108  
<<<stack<<<

I tested the NODEMCU module with wifisacn and ap examples and found working fine. Please suggest me hardware or software modifications if any to get it done.

srinivasa_rao_pedada

Hello everyone, sorry if there is anything wrong in my question. Basically I need an SPI communication example which involves NODEMCU and NRF24L01, wherein it searches radio in all the six pipes (tmrh20 library) and displays received information on the serial monitor. Thanks in advance

Robin2

I have no experience of using an nRF24 with an ESP8266 so I can't help with the error messages.

Quote
Basically I need an SPI communication example which involves NODEMCU and NRF24L01, wherein it searches radio in all the six pipes (tmrh20 library) and displays received information on the serial monitor.
It will be much easier to help if you describe the project you want to implement so we understand the context for the solution you have in mind.

For example I have never found any need to use more than 1 pipe (even with lots of nRF24 slaves) so I can't imagine why you need 6.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

srinivasa_rao_pedada

I have 12 slaves placed at a stretch of 1 km distance. I have allotted 1 pipe for two slaves to avoid packet loss and ease of identification.   12 slaves are used to control some 50 induction motors like switching on and getting on feedback and local alarm in case of fail to start etc.. All these I/O s are handled by arduino uno and NRF24L01 module combination. Whereas feedback part for remote viewing of alarm and running status will be uploaded to thingspeak channel using NODEMCU and NRF24L01 modules.

Robin2

Interesting. A bit more detail will be useful.

What Arduino is at each slave location?

How do the distant slaves communicate with the master unit? Is each of the 12 slave communicating directly with the master? Or is (say) slave A communicating with slave B and is slave B passing on the data to slave C so that it gets to the master as a series of "hops"?

If the slaves communicate directly with the master I don't see any advantage in using multiple pipes on the master. As it only has one radio receiver if two or more slaves transmit at the same time all the messages will be garbled.

How often do messages need to be exchanged between the master and the slaves?

Is there two-way communication between the master and the slaves.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

srinivasa_rao_pedada

1: Arduino uno is used throughout.
2: For certain commands like On command and alarm feedback , power failure will be passed to distant slaves by nearby slaves.

3. All of them may communicate at the same time not often but it depends alarm trigger.

4. All modules have two way communication.


Go Up