Author Topic: Using DigiX with RadioHead nRF library - problems with server/client  (Read 8953 times)

torchris

  • Newbie
  • *
  • Posts: 17
I have been trying to use the RadioHead library for nRF and running into some problems. I decided to use this since I was running into issues with the ManiacBug library and I noticed it was not being very actively maintained. The RadioHead library and documentation is found here:

http://www.airspayce.com/mikem/arduino/RadioHead/index.html

I have been using the "Reliable datagram" server and client examples. This is the Client:

http://www.airspayce.com/mikem/arduino/RadioHead/nrf24_reliable_datagram_client_8pde-example.html

This is the Server:

http://www.airspayce.com/mikem/arduino/RadioHead/nrf24_reliable_datagram_server_8pde-example.html

(The code I am running is exactly the examples, but when using the DigiX, I update the pinouts to "RH_NRF24 driver(53, 52);".)

My intention is to build a sensor network with the sensor nodes as clients and the DigiX as the Server which will in turn serve up the sensor readings to a webpage. The nodes are running on either an old Duelimenova Arduino or Arduino Pro Mini knockoffs.

Problem:

When I use this configuration, everything works perfectly:

CLIENT = DigiX <--> SERVER = Plain Jane Arduino

When I use this configuration:

CLIENT = Plain Jane Arduino <---> SERVER = DigiX

What I see is that the Client can send data to the Server (the DigiX), but the DigiX is not sending back a response to the Client. So, the Client (in this case, a plain old Arduino), can get a message to the DigiX, but the DigiX cannot seem to send a response.

Has anyone else on here tried the RadioHead library with nRF? Is there some difference in the pinouts or something on the DigiX? The strange thing is it works perfectly when the DigiX is the client, but this isn't optimal for what I am designing.

Thanks!!

torchris

  • Newbie
  • *
  • Posts: 17
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #1 on: August 18, 2014, 10:54:44 am »
Could this be the same power supply issues as users have experienced on the Arduino Mega? Check below:

http://forum.arduino.cc/index.php/topic,71574.0.html

I have tried various combinations of capacitors and power supplies without it making any difference.


torchris

  • Newbie
  • *
  • Posts: 17
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #2 on: August 19, 2014, 10:01:49 am »
Is there any possible way to get a DigiX to the author of the RadioHead nRF library? He has agreed to test the DigiX to see if he can spot the problem. Here is the thread on the RadioHead Google Group:

https://groups.google.com/forum/#!topic/radiohead-arduino/inNYKL4pK9A


digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #3 on: August 20, 2014, 06:02:23 pm »
What was the source of the nRF module you are using? Did you get it from Digistump or elsewhere?

Have you tried another module on the DigiX?

torchris

  • Newbie
  • *
  • Posts: 17
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #4 on: August 20, 2014, 07:31:28 pm »
I have at least three batches of nRF modules - the one I received with the DigiX and a couple more sets I ordered from China. I have tried a variety of different module and a variety of configurations of capacitors across the VCC & GND pins as recommended in other Arduino forums and all show the same result.  The only radio units I have tried yet are some of the longer range nRF units with the antennae. I'll give that a shot tomorrow.

digistump

  • Administrator
  • Hero Member
  • *****
  • Posts: 1465
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #5 on: August 20, 2014, 09:00:59 pm »
Some of our users found that some other modules didn't play well with the DigiX and/or didn't play well with the modules that came with the DigiX - there are many varying degrees of quality in those modules even though they all look the same. I'll send you an email about getting you a few more of ours to test with.

torchris

  • Newbie
  • *
  • Posts: 17
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #6 on: August 21, 2014, 06:42:43 pm »
I have now tried several combinations all with the same result. I have tested:

- Plain nRF24 modules with no capacitors across the VCC & GND pins (no idea which radio module is the one from Digistump)
- nRF24 modules with capacitors
- Extended range nRF units such as these -> http://bit.ly/1twqsON

So, to summarize, using the Radiohead nRF library on the DigiX, it appears that the DigiX cannot be set up in the "server" role in the "Reliable Datagram" library even when using several different nRF modules.

I have set up my sensor network so the DigiX is the "client" and periodically pings the senor nodes which are configured as "servers" which does work, but has some limitations when it comes to putting a sensor node temporarily into low power mode then waking it up. Also, it is a bit problematic for serving up the sensor data via a web page, but that's another issue.
« Last Edit: August 22, 2014, 11:53:19 am by torchris »

torchris

  • Newbie
  • *
  • Posts: 17
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #7 on: September 11, 2014, 12:11:39 pm »
Mr. Kettenburg was nice enough to send me some of his stock of nRF radios to test if what I was experiencing was a result of bad radios. I am sorry to say the results were the same - or even a bit worse. If anything, they barely performed with the DigiX in Client mode and the other Arduino in Server mode. I haven't tested them with a capacitor across the +/- pins, but that is how my working nRFs are set up.

So, if you opt to use the RadioHead Reliable Datagram library for your nRF radios, the DigiX needs to be the Client and the remote module needs to be the Server.  As well, you need to have a capacitor across the VCC & GND pins. I am using a 10uF cap which seems to work OK.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #8 on: September 12, 2014, 05:29:16 am »
Do you have an oscilloscope that you could check the timing with? Just wondering if there's some sort of timing difference happening in the transmission for the DigiX vs the others.

torchris

  • Newbie
  • *
  • Posts: 17
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #9 on: September 12, 2014, 06:16:32 am »
I have an old one, but I wouldn't know how to do that kind of testing. I expect it is some subtle timing issue somewhere.

For my sensor network I have the sensor nodes configured as "servers" (just doing temp, humidity readings) and the DigiX set up as a "client" so the DigiX polls the sensor nodes periodically, which works well enough for this application.

To process the data, I then have the DigiX set up as a web server that serves up a small webpage of the data and a Node.js app on my PC that screen scrapes the data off of the DigiX, pops it into a database and then generates a chart of the results using the JavaScript Flot library. While a bit of a kludge, it does generally work well except occasionally when the Node.js server pings the DigiX at the same time as it is busy polling the sensor nodes, but this doesn't seem to happen very often.

Really, the fact that there isn't a websockets library for the DigiX is a bit more of a pain. While my current arrangement works to pull data from the sensor nodes, I haven't figured out a way to send commands from my JavaScript app to the DigiX so it can transmit commands back out to the nodes (digital On/Off for equipment, for instance). Any suggestions for a more robust two way TCP/IP connection between my Node.js app and my DigiX would be welcome, but off topic for this thread.

dougal

  • Sr. Member
  • ****
  • Posts: 289
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #10 on: September 12, 2014, 03:50:36 pm »
That sounds doable, but I haven't touched my DigiX or any of the Arduino HTTP libs for a while now. Unfortunately, my free-time is pretty rare lately, so I'm way behind in my "stuff I want to do" list. :)

Fadi

  • Newbie
  • *
  • Posts: 4
Re: Using DigiX with RadioHead nRF library - problems with server/client
« Reply #11 on: October 16, 2014, 06:33:41 pm »
My bad, I was using the RF24 and not NRF24!

I tried the samples you mentioned above and changed the pin configuration as noted.
I get:
init failed
Sending to rf24_reliable_datagram_server

« Last Edit: October 16, 2014, 06:59:10 pm by Fadi »