Notifications
Clear all

problems receiving with nrf24L01

9 Posts
3 Users
0 Likes
2,041 Views
jBo
 jBo
(@jbo)
Member
Joined: 3 years ago
Posts: 100
Topic starter  

Previously, I posted a description of my transmit/receive setup, with 2 serial monitors via USB0 and USB1, on this thread:

https://forum.dronebotworkshop.com/postid/20193/

That may have been the wrong place to post, since I need help.

I keep getting the message, "sendtoWait failed".

Anyway, I let it run overnight, not a single successful datagram. Then today switched the two Nanos (wired identically, as per the video) and restarted them. For a while I did receive the joystick X, Y positions, but then it stopped receiving. It seems to be very sensitive.

1. Could this be due to WiFi interference? It seems like the frequency is pretty close, and I am doing this in my "electronics lab" in the same room with our router, my phone, etc., not to mention a crowded neighborhood full of WiFi SSIDs. I am using nrf24L01 modules with antennas, and with the little helper modules to take care of power supply and other issues.

2. Could this be a voltage/power issue? Using the Arduino Nanos plugged into a powered USB hub has never caused any issues before, that I can tell. I am using the 5V and Gnd on the Nano to give power to the nrf24L01 module.

Any ideas?

This topic was modified 3 years ago by jBo

In theory, theory and practice are the same.
In practice, they're different.


   
Quote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 
Posted by: @jbo

I am using the 5V and Gnd on the Nano to give power to the nrf24L01 module.

Don't the nrf24L01 modules run on 3.3V?  Do you have adapter board for the modules?  I might be grasping at straws here as the last time I was playing with my nrf24L01s was a good month or more ago.

SteveG


   
ReplyQuote
jBo
 jBo
(@jbo)
Member
Joined: 3 years ago
Posts: 100
Topic starter  
Posted by: @codecage
Posted by: @jbo

I am using the 5V and Gnd on the Nano to give power to the nrf24L01 module.

Don't the nrf24L01 modules run on 3.3V?  Do you have adapter board for the modules?  I might be grasping at straws here as the last time I was playing with my nrf24L01s was a good month or more ago.

@codecage   Thanks, Steve. Yes, from the video on DBWS and other places, I believe it is 3.3V -- to the chip. But due to power supply noise problems, necessitating a voltage regulator and a capacitor (of which I have none,anyway), Bill recommended just using the little module. So I am giving it the 5V output. I will go check the article and video.

 

In theory, theory and practice are the same.
In practice, they're different.


   
ReplyQuote
(@dronebot-workshop)
Workshop Guru Admin
Joined: 5 years ago
Posts: 1081
 
Posted by: @jbo

But due to power supply noise problems, necessitating a voltage regulator and a capacitor (of which I have none,anyway), Bill recommended just using the little module. So I am giving it the 5V output. I will go check the article and video.

Yes they are very sensitive to noise, in fact the only way I could get them to work was to use the adapter modules, or "helper modules" as you referred to them as (which could well be the correct name, I'm not actually sure what they are called). In addition to reducing the voltage and smoothing out the noise, they also decouple the circuit from the power supply lines, which I think is necessary.

Posted by: @jbo

1. Could this be due to WiFi interference? It seems like the frequency is pretty close, and I am doing this in my "electronics lab" in the same room with our router, my phone, etc., not to mention a crowded neighborhood full of WiFi SSIDs. I am using nrf24L01 modules with antennas, and with the little helper modules to take care of power supply and other issues.

They are indeed 2.4GHz, as a lot of other stuff is these days, so I suppose interference is a possibility. When I filmed the video I had a "conventional" wifi system, with a wireless router. Now I have a mesh system, and one of the mesh units is in the workshop. It would be interesting to see if the nRF24L01's will still work in there.

Is it possible for you to move the experiment out of the "electronics lab" (a room that every home should have IMHO) to see if the results improve, or turning off the router and phone temporarily?

I wouldn't think that your neighbors devices would be strong enough to interfere, unless you're in an apartment building with a strong signal directly above or below you.

Personally I don't think interference is the issue though, as even when I had my "conventional" wifi I still had a second wireless access point in the closet of the master bedroom on the 2nd floor, and I tested the range of the nRF24L01 in that room.

Posted by: @jbo

2. Could this be a voltage/power issue? Using the Arduino Nanos plugged into a powered USB hub has never caused any issues before, that I can tell. I am using the 5V and Gnd on the Nano to give power to the nrf24L01 module

If I were betting, I would say that my bet would be on it being a power issue. I don't suppose you have a scope to see if there is any interference on the 5-volt line?

A poor ground connection could also be to blame, especially if you are using a solderless breadboard.

If you didn't require the serial monitors you could try powering the Nano's using a 9-volt battery connected to the VIN pin.  That way, you wouldn't have a switching supply (like your USB hub probably uses) causing potential interference. All that you'd be using would be the 5-volt linear regulator on the Nano and the 3.3-volt linear regulator on the "helper module". 

And, as I understand it, you're using two USB ports on the same computer to drive two instances of the serial monitor, is that correct? Any chance of using two independent computers instead, just to see if that arrangement might be causing interference or a ground loop.

😎

Bill

 

P.S. I'm driving a little "robot car" around the room right now, just finished coding it today. It works great, but it doesn't use the nRF24L01. I haven't tested its range, but I suspect it might be close to a kilometer! You'll be seeing it this weekend on YouTube.

"Never trust a computer you can’t throw out a window." — Steve Wozniak


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 

@jbo

The modules you refer to as the ones Bill recommended are the ones I am referring to as well.  Good to hear you are already using them.

I'd suspect power issues as well.  But for whatever reason I didn't seem to experience those issues.

SteveG


   
ReplyQuote
jBo
 jBo
(@jbo)
Member
Joined: 3 years ago
Posts: 100
Topic starter  

@codecage Thanks for that. I will keep noisy noisy power supply issues in mind.

In theory, theory and practice are the same.
In practice, they're different.


   
ReplyQuote
jBo
 jBo
(@jbo)
Member
Joined: 3 years ago
Posts: 100
Topic starter  
Posted by: @dronebot-workshop

When I filmed the video I had a "conventional" wifi system, with a wireless router. Now I have a mesh system, and one of the mesh units is in the workshop.

Thanks for that insight, and thanks for your considered reply. I have conventional WiFi as well, plus a couple of old routers devoted as "bridge" devices (I do NOT let them hand out IP addresses on their own; DHCP turned off). I may have to address my WiFi setup as a whole, though that's a different topic.

I might as well confess now: I'm the guy who mentioned Sonoff, "smart extension cords" a while back. I have 3 of these WiFi enabled devices in my lab, plus maybe 18 more in the rest of the house. And unlike my little robot car (ESP32 with WiFi), my wife likes her remote controlled lights, and told her sister about them, bragged really, and well, you know, I can't do without them. They are now "infrastructure." Enough of that. 

More concisely, I will turn off the main router for a bit, and try to chase WiFi issues in general.

Regarding moving the devices, I would love that. That is the end goal; I even got lantern batteries. For now, I have no way to see if a receiver is working. I do have some LCD and other small displays on order; perhaps I can adapt a sketch to display contents of last message received.

For power noise issues, I will attach one at a time to a 6V lantern battery or 9V battery, maybe using those nice little breadboard power supplies you featured, and see if that helps. I'll check the ground connections too, always a good idea. Yes, I am using solderless breadboards. No, I do not have a scope.

Regarding two independent computers each running the Arduino IDE, I will try again. I'm having trouble flashing the Nanos on my Linux laptop, don't know why, though on top this, there are good Nanos and bad Nanos, so I'm working through this too. Good thing I'm a programmer! All my careers have been going from one bug, eh, challenge, to the next. 🙂

It just occurred to me, that even if I can't flash new sketches onto a Nano with this Linux laptop (Ubuntu 16.04 LTS, yes, I know it's out of date), I should still be able to open the serial port. Why didn't I think of this before. I will try it.

Thanks very much for your help. I'll get busy. -John

In theory, theory and practice are the same.
In practice, they're different.


   
ReplyQuote
codecage
(@codecage)
Member Admin
Joined: 5 years ago
Posts: 1037
 
Posted by: @jbo

I'm having trouble flashing the Nanos

I just had a thought!  And that can be very dangerous!!

I've experienced issues sometimes when trying to upload to Nanos and it seems that some Nanos I own have an "Old Bootloader" and others have, I guess a newer bootloader.  The option that handles the choice between the newer and older bootloader can be found in the "Tools" menu.  First select the "Board" as an "Arduino Nano" and then select the "Processor" as either the "ATmega328P" or the "ATmega328P (Old Bootloader)" and see which one works.  If neither works, then I guess I just sent you on a wild goose chase!  If one choice does work, find a way to flag that Nano as to which "Processor" choice to use.

Good luck and let us know if this helped or not.

😎

SteveG


   
ReplyQuote
jBo
 jBo
(@jbo)
Member
Joined: 3 years ago
Posts: 100
Topic starter  

@codecage  Yes, that is a valuable thing to point out. I have definitely been down that road, that is, wondering how to choose the right processor setting, and gradually understanding what they were all talking about. 

In the past, I just picked the Old Bootloader setting and went on. I had not run into any issues myself, so I just used whichever one would work. That got me by on my "lab" machine, a Raspberry Pi 4. For this round of experiments, it is indeed nice to run one whole setup on another completely separate computer. So I've got an old Linux laptop on Ubuntu 16.04 LTS, but with the newest Arduino IDE available. For some reason, it is finicky, and I now seem to be unable to load sketches at all, regardless of which processor setting I use.

So this brings me to try to update the bootloader itself. For that, the clearest, most reasonable tutorial I found is:

Arduino Bootloader Update or Install - Upgrade a Clone From Old Bootloader to New Optiboot!

It seems to do the trick on my Pi, but I'm still struggling with the Ubuntu laptop. 

Still, I'm learning a whole lot about this topic, and learning to look carefully at the (literal) fine print on the Nano boards themselves. Some have a CH340G chip on the back, some have a similar size chip, but with no label that I can see.

Anyway, I appreciate the tips, and will keep at it. I have some little 2x16 LCD displays coming in. Maybe I could write a message to that screen. The goal would be to decouple my xmit and receive setup from desktop computers altogether, so I could take the modules out of town, presumably free of WiFi interference.  😎 

In theory, theory and practice are the same.
In practice, they're different.


   
ReplyQuote