New Gateway - Can't get it to work
-
Good suggestion but yes, I have. Pings stop after pulling out the cable.
I have grabbed one of my sensor nodes (temp/humidity) and put it on the mySensors sketch from the example. Question on that though, how does it know what radio to use? No where is it defined in those sample sketches.I will post my sketch and the changes I've made to other files so you guys can get a complete picture.
-
My gateway sketch:
0_1466189155349_MyEthernetGateway.inoI also make changes to the following files:
MyConfig.h:
#define DEBUG/**********************************
- RFM69 Driver Defaults
***********************************/
// Default network id. Use the same for all nodes that will talk to each other
#define RFM69_NETWORKID 100
// Default frequency to use. This must match the hardware version of the RFM69 radio (uncomment one):
// #define RFM69_FREQUENCY RF69_433MHZ
//#define RFM69_FREQUENCY RF69_868MHZ
#define RFM69_FREQUENCY RF69_915MHZ// Enable this for encryption of packets
//#define RFM69_ENABLE_ENCRYPTION
#define RFM69_ENCRYPTKEY "sampleEncryptKey" //exactly the same 16 characters/bytes on all nodes!The line for the 915Mhz only called it FREQUENCY so changed it to match the entries above it, assuming it is correct.
MyTransportRFM69.h:
class MyTransportRFM69 : public MyTransport
{
public:
MyTransportRFM69(uint8_t freqBand=RFM69_FREQUENCY, uint8_t networkId=RFM69_NETWORKID, uint8_t slaveSelectPin=RF69_SPI_CS, uint8_t interruptPin=RF69_IRQ_PIN, bool isRFM69HW=true, uint8_t interruptNum=RF69_IRQ_NUM);This change was to identify my radio as an RFM69HW.
- RFM69 Driver Defaults
-
I have partial success getting my RFM69 radios working. I had to make the following changes:
MySensor.hChange: #include "MyTransportNRF24.h" to #include "MyTransportRFM69.h"
Change line 158 from
MySensor(MyTransport &radio =*new MyTransportNRF24(), MyHw &hw=*new MyHwDriver()
to
MySensor(MyTransport &radio =*new MyTransportRFM69(), MyHw &hw=*new MyHwDriver()Sensor side I get:
sensor started, id=255, parent=0, distance=1
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
T: 28.00
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
H: 33.00
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
T: 29.00
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
T: 28.00
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=fail:
H: 32.00While Gateway side I get:
0;0;3;0;9;gateway started, id=0, parent=0, distance=0
0;0;3;0;9;read and forward: 255-255-255 s=255,c=3,t=7,pt=0,l=0,sg=0:0;0;3;0;9;send: 0-0-255-255 s=255,c=3,t=8,pt=1,l=1,sg=0,st=bc:0
0;0;3;0;5;1
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;I'm not sure what the st=fail means in the sensor debug?
Also I still do not have the gateway listening on port 5003. Still trying to decipher that. I wanted to try and isolate the fault and make sure the radio part was working.
-
Ok, figured it out and got the gateway working. The issue is with the RFM69 and the Wiznet Ethernet shield you cannot use pin 10 for the cs on the RFM69. I used pin 7 since I don't use the LED's.
Add the following to your MyConfig.h
#define RF69_SPI_CS 7and everything should work. Onwards to building the sensors now!
-
Well... almost. Things are talking but not quite. The gateway never seems to send a ID to the sensor node?
On the sensor node:
ensor started, id=255, parent=0, distance=1
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req idOn the Gateway Node:
0;0;3;0;5;1
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;So it looks to be sending a request, but the gateway isn't returning an id. The sensor node is a humidity node, exactly as provided in the example, other then adding: MyTransportRFM69 transport;
-
Well... almost. Things are talking but not quite. The gateway never seems to send a ID to the sensor node?
On the sensor node:
ensor started, id=255, parent=0, distance=1
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req id
send: 255-255-0-0 s=255,c=3,t=3,pt=0,l=0,sg=0,st=ok:
req idOn the Gateway Node:
0;0;3;0;5;1
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;
0;0;3;0;9;read: 255-255-0 s=255,c=3,t=3,pt=0,l=0,sg=0:
255;255;3;0;3;So it looks to be sending a request, but the gateway isn't returning an id. The sensor node is a humidity node, exactly as provided in the example, other then adding: MyTransportRFM69 transport;
You need a controller that can provide ids connected to the gateway.
-
Ok, my newbie is showing. I have home assistant configured just didn't know I had to have it connected before it would work. Will try that.
-
The Ethernet gateway was just too unstable for me and I couldn't get any inclusions. I switched it for a serial gateway and its all working great now. I have a single sensor that is sending data to my House Assistant install.
-
You need a controller that can provide ids connected to the gateway.
Thank you!!!! I was getting crazy working only with the Serial monitor on both sides. I didn't know that the Controller is playing a key role on assigning the nodeID.
It is working now after connecting the gateway to HomeAssistant.
Thanks.
Regards.
Alfredo.