Help getting my first sensor working please

6 years 6 months ago - 6 years 6 months ago #924 by PaulRB

EasyIoT wrote: It means that Arduino fails to send message to SPI.

Did you mean SPI or RPi? Are you saying that the Arduino is not communicating over the SPI bus with the radio module, or over the wireless link with the Pi?

EasyIoT wrote: If you run EasyIoT in console window you can also see debug output.

Here it is:
pi@raspberrypi ~/easyiot $ sudo mono EasyIoT.exe
2015-03-22T22:58:57.2033700+00:00	INFO	System				System started
22-03-2015-22-59-01  Web service started
22-03-2015-22-59-02  Listening on port(s):80, 1301
2015-03-22T22:59:02.5358870+00:00	DEBUG	MySensors				MySensors Connect
================ SPI Configuration ================
CSN Pin  	 = CE0 (PI Hardware Driven)
CE Pin  	 = Custom GPIO25
Clock Speed	 = 8 Mhz
================ NRF Configuration ================
STATUS		 = 0x0e RX_DR=0 TX_DS=0 MAX_RT=0 RX_P_NO=7 TX_FULL=0
RX_ADDR_P0-1	 = 0xa8a8e1fc00 0xa8a8e1fc00
RX_ADDR_P2-5	 = 0xff 0xc4 0xc5 0xc6
TX_ADDR		 = 0xe7e7e7e7e7
RX_PW_P0-6	 = 0x20 0x20 0x20 0x00 0x00 0x00
EN_AA		 = 0x3b
EN_RXADDR	 = 0x06
RF_CH		 = 0x5a
RF_SETUP	 = 0x27
CONFIG		 = 0x0e
DYNPD/FEATURE	 = 0x3f 0x06
Data Rate	 = 250KBPS
Model		 = nRF24L01+
CRC Length	 = 16 bits
PA Power	 = PA_MAX
2015-03-22T22:59:02.6997950+00:00	DEBUG	MySensors				Mysensors Start driver.
2015-03-22T22:59:03.2459160+00:00	INFO	RPiGPIO	Pin_P1_07	Sensor.DigitalValue	0	-
2015-03-22T22:59:03.3688070+00:00	DEBUG	Esp8266				ESP8266 Connect
2015-03-22T22:59:03.4217430+00:00	DEBUG	Esp8266				Server Started
22-03-2015-22-59-17 [192.168.0.97]  user:[admin]  authentication success: authentication success
When I press reset on the Arduino, nothing else appears

EasyIoT wrote: Just to be sure: When you add sensor node to EasyIoT server press Add node in Web interface.

Yes, I did that. I then selected "Humidity (N4S0)" and also added "Temperature (N4S1)". Was that correct?

...wait...

I found "Add Node" in "My Sensors Driver". After 30 secs I just get "Timed Out"/"Operation Failed". This happens if I reset the Arduino during the 30s or not.

Please Log in or Create an account to join the conversation.

6 years 6 months ago #925 by EasyIoT

PaulRB wrote: ...wait...

I found "Add Node" in "My Sensors Driver". After 30 secs I just get "Timed Out"/"Operation Failed". This happens if I reset the Arduino during the 30s or not.


You should use Add Node in MySensors driver. After that you power on Arduino node.

Please Log in or Create an account to join the conversation.

6 years 6 months ago #930 by HarryDutch
Just to make sure this isn't a channel issue, change channel (both server and sensor side) to 76.

Please Log in or Create an account to join the conversation.

6 years 6 months ago - 6 years 6 months ago #936 by PaulRB

EasyIoT wrote: You should use Add Node in MySensors driver. After that you power on Arduino node.

OK, thanks for helping. I tried that (although I don't understand how powering on and resetting the Arduino are different, since both cause the sketch to begin running). I got "Timeout" from the web interface and the same "st=fail" messages on Serial Monitor.

HarryDutch wrote: Just to make sure this isn't a channel issue, change channel (both server and sensor side) to 76.

Thanks to you too for helping. Changed channel to 76 in both web interface and MyConfig.h, re-uploaded the sketch to the Arduino and then followed the Add Node/power-on Arduino. Still no joy.

I just tried my spare nrf module... made no difference. I was pretty sure all 3 work fine.

I know it must be hard for you guys to help me because you can't see what I might have done wrong. I feel the same trying to help others on the Arduino forrm when they say things don't work but I know they should. Any more ideas please?

Please Log in or Create an account to join the conversation.

6 years 6 months ago #939 by HarryDutch
Could you please try to load this sketch on your sensor and then add it to the the EasyIoT server:
#include <SPI.h>
#include <MySensor.h>  

#define CHILD_ID_HUM 0
#define CHILD_ID_TEMP 1

unsigned long SLEEP_TIME = 30000; // Sleep time between reads (in milliseconds)

MySensor gw;

MyMessage msgHum(CHILD_ID_HUM, V_HUM);
MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP);


void setup()  
{ 
  gw.begin();
  
  gw.sendSketchInfo("Humidity", "1.0");

  // Register all sensors to gw (they will be created as child devices)
  gw.present(CHILD_ID_HUM, S_HUM);
  gw.present(CHILD_ID_TEMP, S_TEMP);
  
}

void loop()      
{  
  gw.sleep(SLEEP_TIME); //sleep a bit
}

Please Log in or Create an account to join the conversation.

6 years 6 months ago - 6 years 6 months ago #940 by PaulRB
Thanks Harry. That is just the Humidity example sketch with some code removed, isn't it?

Here's the serial monitor output, same old messages:
send: 255-255-255-255 s=255,c=3,t=7,pt=0,l=0,st=fail:
req node id
send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
sensor started, id 255
req node id
send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
req node id
send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
req node id
send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:
req node id
send: 255-255-255-0 s=255,c=3,t=3,pt=0,l=0,st=fail:

Plus the usual timeout message from the web interface.

Would it help if I post links to some higher-resolution pics of my circuits? Or does the fact that I am not getting "check wiring" messages mean the wiring must be OK? On one occasion last night, I incorrectly plugged the of the nrf boards into the Pi and saw the "check wiring" message. Re-plugging the nrf correctly, that message went away and the normal output I posted earlier returned.

Just tested unplugging the nrf from the Arduino and got the "check wires" message on serial monitor. Re-plugged and the output returned to that above.

Can anyone confirm that the MySensors driver is definitely working with v0.7 of EasyIoT? Would it be worth me trying an earlier version?

Please Log in or Create an account to join the conversation.

Time to create page: 0.274 seconds

Forum latest

  • No posts to display.