@scalz Sorry, your changes fixed my OP problem with the compile errors. I forgot to follow up noting the TSP INIT fails and switching back to the old driver
Posts made by firstof9
-
RE: New RFM69 driver error
-
RE: New RFM69 driver error
@scalz Negitive my issue persists using the new driver. I've had to revert back to the old driver to get around this SANCHK FAIL. Same wiring same radios using older driver work perfectly fine.
I read some where that the issue is resolved in beta version of 2.2.1.
-
RE: New RFM69 driver error
@scalz Trying to update all my nodes to the new driver, getting this on the gateway now:
0 MCO:BGN:INIT GW,CP=RPNGA---,VER=2.2.0 3 TSM:INIT 4 TSF:WUR:MS=0 5 RFM69:INIT 11 RFM69:INIT:PIN,CS=4,IQP=2,IQN=0,RST=9 116 RFM69:PTX:LEVEL=5 dBm 118 !RFM69:INIT:SANCHK FAIL 120 !TSM:INIT:TSP FAIL 122 TSM:FAIL:CNT=1 124 TSM:FAIL:DIS 126 TSF:TDI:TSL 128 RFM69:RSL
Same sketch as previously posted (with RFM69 verbose defined for more info). Any ideas?
-
RE: New RFM69 driver error
@scalz
I've updated my sketch to include that for the new driver. Thank you.
I had to use that mod for the older driver. -
RE: New RFM69 driver error
@scalz
Your modifications seemed to have resolved the issue.Also I've made this modification to MyTransport.cpp so it resets the radio on init:
void stInitTransition(void) { #if defined(ADAFRUIT_RFM69) pinMode(9, OUTPUT); digitalWrite(9, HIGH); delay(100); digitalWrite(9, LOW); delay(100); #endif TRANSPORT_DEBUG(PSTR("TSM:INIT\n"));
Sketch for reference:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable Adafruit RFM69 breakout fix #define ADAFRUIT_RFM69 // Enable and select radio type attached #define MY_RADIO_RFM69 #define MY_RFM69_NEW_DRIVER // ATC on RFM69 works only with the new driver #define MY_RFM69_ATC_TARGET_RSSI_DBM (-70) // target RSSI -70dBm #define MY_RFM69_MAX_POWER_LEVEL_DBM (10) // amx. TX power 10dBm = 10mW #define MY_IS_RFM69HW // Mandatory if you radio module is the high power version (RFM69HW and RFM69HCW), Comment it if it's not the case #define MY_RF69_FREQUENCY RFM69_915MHZ // Define for frequency setting. Needed if you're radio module isn't 868Mhz (868Mhz is default in lib) #define MY_RF69_SPI_CS 4 #define MY_RF69_IRQ_PIN 2 //#define MY_RF69_IRQ_NUM 0 //#define W5100SPIPATCH #define SKETCH_NAME "MySensors Ethernet Gateway" #define SKETCH_MAJOR "0" #define SKETCH_MINOR "5" // How many clients should be able to connect to this gateway (default 1) #define MY_GATEWAY_MAX_CLIENTS 2 // Enable gateway ethernet module type #define MY_GATEWAY_W5100 // Enable Soft SPI for NRF radio (note different radio wiring is required) // The W5100 ethernet module seems to have a hard time co-operate with // radio on the same spi bus. #if !defined(MY_W5100_SPI_EN) && !defined(ARDUINO_ARCH_SAMD) #define MY_SOFTSPI #define MY_SOFT_SPI_SCK_PIN 14 #define MY_SOFT_SPI_MISO_PIN 15 #define MY_SOFT_SPI_MOSI_PIN 16 #endif // Enable to UDP //#define MY_USE_UDP #define MY_IP_ADDRESS 192,168,1,204 // If this is disabled, DHCP is used to retrieve address // Renewal period if using DHCP //#define MY_IP_RENEWAL_INTERVAL 60000 // The port to keep open on node server mode / or port to contact in client mode #define MY_PORT 5003 // Controller ip address. Enables client mode (default is "server" mode). // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254 // The MAC address can be anything you want but should be unique on your network. // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use. // Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address. #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED // Enable inclusion mode #define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway //#define MY_INCLUSION_BUTTON_FEATURE // Set inclusion mode duration (in seconds) #define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button //#define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Flash leds on rx/tx/err // Uncomment to override default HW configurations //#define MY_DEFAULT_ERR_LED_PIN 5 // Error led pin #define MY_DEFAULT_RX_LED_PIN 6 // Receive led pin //#define MY_DEFAULT_TX_LED_PIN 7 // Transmit led pin #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #include <Ethernet.h> #include <MySensors.h> void presentation() { // Send the sketch version information to the gateway sendSketchInfo(SKETCH_NAME, SKETCH_MAJOR"."SKETCH_MINOR); } void setup() { } void loop() { }
-
RE: New RFM69 driver error
@gohan said in New RFM69 driver error:
What arduino ide version do you have?
Arduino: 1.8.5
@gohan said in New RFM69 driver error:
What Arduino Boards Definitions are you using?
Arduino AVR Boards 1.6.20 (for my Uno with W5100 Ethernet shield)
Adafruit AVR Boards 1.4.12 (for the Feather boards 32u4)@gohan said in New RFM69 driver error:
Did you try compiling for pro mini?
No as i don't have or use Pro MinisIt does compile for my Nano sensor just fine.
So far the error's only occurred when trying to compile for the Uno. -
RE: New RFM69 driver error
@gohan said in New RFM69 driver error:
Did you try to compile for a different arduino?
It seems to work fine for the Adafruit Feather Wings when selected.
The error only comes up when I switch the board to the Uno for the ethernet gateway.@gohan said in New RFM69 driver error:
Are you using mysensors 2.2?
Yes
-
New RFM69 driver error
While attempting to compile for an Uno using a W5100 Ethernet gateway setup I get the following error(s):
Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno" In file included from D:\Documents\Arduino\libraries\MySensors/MySensors.h:343:0, from D:\OneDrive\Home Automation Project\GatewayW5100.ino\GatewayW5100.ino.ino:120: D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp: In function 'void RFM69_prepareSPITransaction()': D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:73:2: error: '_SREG' was not declared in this scope _SREG = SREG; ^ D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:78:2: error: '_SPCR' was not declared in this scope _SPCR = SPCR; ^ D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:79:2: error: '_SPSR' was not declared in this scope _SPSR = SPSR; ^ D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp: In function 'void RFM69_concludeSPITransaction()': D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:99:9: error: '_SPCR' was not declared in this scope SPCR = _SPCR; ^ D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:100:9: error: '_SPSR' was not declared in this scope SPSR = _SPSR; ^ D:\Documents\Arduino\libraries\MySensors/drivers/RFM69/new/RFM69_new.cpp:104:9: error: '_SREG' was not declared in this scope SREG = _SREG; ^ exit status 1 Error compiling for board Arduino/Genuino Uno. This report would have more information with "Show verbose output during compilation" option enabled in File -> Preferences.
Anyone have any ideas what's going on?
Thanks in advance.
-
RE: [RESOLVED] Problems connecting node to gateway
Got it working it was this bit causing issues:
// W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal) #define MY_W5100_SPI_EN 4
removing that fixed it
Also as my gateway was having issues freaking out when receving radio packets I also modified my ethernet.h per this post:
https://forum.mysensors.org/topic/5109/solved-rfm69-based-nodes-unable-to-report-lib-version/26and changed the following:
#define MY_DEFAULT_ERR_LED_PIN A0 // Error led pin #define MY_DEFAULT_RX_LED_PIN A1 // Receive led pin #define MY_DEFAULT_TX_LED_PIN A2 // Transmit led pin
Thank you all for your suggestions.
-
RE: [RESOLVED] Problems connecting node to gateway
// Enable debug prints to serial monitor #define MY_DEBUG_VERBOSE_RFM69 #define MY_DEBUG
Nothing new is being reported on the serial monitor.
0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1 0;255;3;0;9;TSM:INIT 0;255;3;0;9;TSF:WUR:MS=0 0;255;3;0;9;TSM:INIT:TSP OK 0;255;3;0;9;TSM:INIT:GW MODE 0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0 0;255;3;0;9;MCO:REG:NOT NEEDED IP: 192.168.1.204 0;255;3;0;9;MCO:BGN:STP 0;255;3;0;9;MCO:BGN:INIT OK,TSP=1 0;255;3;0;9;Eth: connect 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 255;255;3;0;20; 0;255;3;0;9;TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 0;255;3;0;2;
-
RE: [RESOLVED] Problems connecting node to gateway
The radios are connected correctly, the issue appears to be related to this:
2149 !TSM:FPAR:NO REPLY
-
RE: [RESOLVED] Problems connecting node to gateway
The radios seem to initialize fine according to the logs. Any other ideas?
-
[RESOLVED] Problems connecting node to gateway
Greetings,
After much searching in the forums and google I've been unable to resolve the issue on my own. Any assistance is welcomed.
My gateway is a Ardunio Uno with an Ethernet Shield and a RFM69HCW radio set to 915Mhz
My node is an Arudino Nano and a RFM69HCW radio set to 915Mhz (currently no sensors connected for troubleshooting)I am using an Adafruit breakout board that has a level shifter build in.
Below are the outputs of the node and gw:
GW Debug:
0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGA--,VER=2.1.1 0;255;3;0;9;TSM:INIT 0;255;3;0;9;TSF:WUR:MS=0 0;255;3;0;9;TSM:INIT:TSP OK 0;255;3;0;9;TSM:INIT:GW MODE 0;255;3;0;9;TSM:READY:ID=0,PAR=0,DIS=0 0;255;3;0;9;MCO:REG:NOT NEEDED IP: 192.168.1.204 0;255;3;0;9;MCO:BGN:STP 0;255;3;0;9;MCO:BGN:INIT OK,TSP=1 0;255;3;0;9;Eth: connect 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 255;255;3;0;20; 0;255;3;0;9;TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=20,pt=0,l=0,sg=0,ft=0,st=OK: 0;255;3;0;9;Eth: 0;255;3;0;2; 0;255;3;0;9;Eth: 0;255;3;0;2;
Node Debug:
0 MCO:BGN:INIT NODE,CP=RRNNA--,VER=2.1.1 3 TSM:INIT 4 TSF:WUR:MS=0 6 TSM:INIT:TSP OK 8 TSM:INIT:STATID=1 10 TSF:SID:OK,ID=1 11 TSM:FPAR 142 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2149 !TSM:FPAR:NO REPLY 2151 TSM:FPAR 2281 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4288 !TSM:FPAR:NO REPLY 4290 TSM:FPAR 4420 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6427 !TSM:FPAR:NO REPLY 6429 TSM:FPAR 6559 TSF:MSG:SEND,1-1-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8566 !TSM:FPAR:FAIL 8567 TSM:FAIL:CNT=1 8569 TSM:FAIL:PDT
GW Sketch:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_RFM69 #define MY_IS_RFM69HW // Mandatory if you radio module is the high power version (RFM69HW and RFM69HCW), Comment it if it's not the case #define MY_RFM69_FREQUENCY RF69_915MHZ // Define for frequency setting. Needed if you're radio module isn't 868Mhz (868Mhz is default in lib) #define MY_RF69_SPI_CS 4 #define MY_RF69_IRQ_PIN 2 // How many clients should be able to connect to this gateway (default 1) #define MY_GATEWAY_MAX_CLIENTS 2 // Enable gateway ethernet module type #define MY_GATEWAY_W5100 // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal) #define MY_W5100_SPI_EN 4 // Enable to UDP //#define MY_USE_UDP #define MY_IP_ADDRESS 192,168,1,204 // If this is disabled, DHCP is used to retrieve address // Renewal period if using DHCP //#define MY_IP_RENEWAL_INTERVAL 60000 // The port to keep open on node server mode / or port to contact in client mode #define MY_PORT 5003 // Controller ip address. Enables client mode (default is "server" mode). // Also enable this if MY_USE_UDP is used and you want sensor data sent somewhere. //#define MY_CONTROLLER_IP_ADDRESS 192, 168, 178, 254 // The MAC address can be anything you want but should be unique on your network. // Newer boards have a MAC address printed on the underside of the PCB, which you can (optionally) use. // Note that most of the Ardunio examples use "DEAD BEEF FEED" for the MAC address. #define MY_MAC_ADDRESS 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED // Enable inclusion mode #define MY_INCLUSION_MODE_FEATURE // Enable Inclusion mode button on gateway //#define MY_INCLUSION_BUTTON_FEATURE // Set inclusion mode duration (in seconds) #define MY_INCLUSION_MODE_DURATION 60 // Digital pin used for inclusion mode button //#define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Flash leds on rx/tx/err // Uncomment to override default HW configurations #define MY_DEFAULT_ERR_LED_PIN 5 // Error led pin #define MY_DEFAULT_RX_LED_PIN 6 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 7 // Transmit led pin #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #include <Ethernet.h> #include <MySensors.h> void setup() { } void loop() { }
Node sketch:
// Enable debug prints #define MY_DEBUG #define MY_SPECIAL_DEBUG #define MY_NODE_ID 1 // Enable and select radio type attached #define MY_RADIO_RFM69 #define MY_IS_RFM69HW #define MY_RFM69_FREQUENCY RF69_915MHZ #define MY_RF69_SPI_CS 10 #define MY_RF69_IRQ_PIN 3 #define MY_RF69_IRQ_NUM 1 #define MY_DEFAULT_TX_LED_PIN 13 #include <SPI.h> #include <MySensors.h> #include <DHT.h> // Set this to the pin you connected the DHT's data pin to #define DHTPIN 4 #define DHTTYPE DHT22 // Set this offset if the sensor has a permanent small offset to the real temperatures #define SENSOR_TEMP_OFFSET 0 // Sleep time between sensor updates (in milliseconds) // Must be >1000ms for DHT22 and >2000ms for DHT11 // static const uint64_t UPDATE_INTERVAL = 60000; // Force sending an update of the temperature after n sensor reads, so a controller showing the // timestamp of the last update doesn't show something like 3 hours in the unlikely case, that // the value didn't change since; // i.e. the sensor would force sending an update every UPDATE_INTERVAL*FORCE_UPDATE_N_READS [ms] static const uint8_t FORCE_UPDATE_N_READS = 10; #define CHILD_ID_HUM 0 #define CHILD_ID_TEMP 1 // Motion Detection unsigned long SLEEP_TIME = 120000; // Sleep time between reports (in milliseconds) #define DIGITAL_INPUT_SENSOR 3 // The digital input you attached your motion sensor. (Only 2 and 3 generates interrupt!) #define CHILD_ID_PIR 2 // Id of the sensor child // Initialize motion message MyMessage msg(CHILD_ID_PIR, V_TRIPPED); // DHT22 Stuff float lastTemp; float lastHum; uint8_t nNoUpdatesTemp; uint8_t nNoUpdatesHum; bool metric = false; MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); DHT dht(DHTPIN, DHTTYPE); // LUX Sensor #define LIGHT_SENSOR_ANALOG_PIN 3 #define CHILD_ID_LIGHT 3 int lastLightLevel; void presentation() { // Send the sketch version information to the gateway sendSketchInfo("MultiSensor", "0.1"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_HUM, S_HUM); present(CHILD_ID_TEMP, S_TEMP); present(CHILD_ID_PIR, S_MOTION); present(CHILD_ID_LIGHT, S_LIGHT_LEVEL); //metric = getControllerConfig().isMetric; } void setup() { Serial.println("Setting up..."); // dht.setup(DHT_DATA_PIN); // set data pin of DHT sensor if (SLEEP_TIME <= 2000) { Serial.println("Warning: UPDATE_INTERVAL is smaller than supported by the sensor!"); } // Sleep for the time of the minimum sampling period to give the sensor time to power up // (otherwise, timeout errors might occure for the first reading) sleep(2000); } void loop() { // LUX Stuff int16_t lightLevel = (1023-analogRead(LIGHT_SENSOR_ANALOG_PIN))/10.23; Serial.println(lightLevel); if (lightLevel != lastLightLevel) { send(msg.set(lightLevel)); lastLightLevel = lightLevel; } // Force reading sensor, so it works also after sleep() //dht.readSensor(true); // Get temperature from DHT library float temperature = dht.readTemperature(); if (isnan(temperature)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperature != lastTemp || nNoUpdatesTemp == FORCE_UPDATE_N_READS) { // Only send temperature if it changed since the last measurement or if we didn't send an update for n times lastTemp = temperature; if (!metric) { temperature = dht.readTemperature(true); } // Reset no updates counter nNoUpdatesTemp = 0; temperature += SENSOR_TEMP_OFFSET; send(msgTemp.set(temperature, 1)); #ifdef MY_DEBUG Serial.print("T: "); Serial.println(temperature); #endif } else { // Increase no update counter if the temperature stayed the same nNoUpdatesTemp++; } // Get humidity from DHT library float humidity = dht.readHumidity(); if (isnan(humidity)) { Serial.println("Failed reading humidity from DHT"); } else if (humidity != lastHum || nNoUpdatesHum == FORCE_UPDATE_N_READS) { // Only send humidity if it changed since the last measurement or if we didn't send an update for n times lastHum = humidity; // Reset no updates counter nNoUpdatesHum = 0; send(msgHum.set(humidity, 1)); #ifdef MY_DEBUG Serial.print("H: "); Serial.println(humidity); #endif } else { // Increase no update counter if the humidity stayed the same nNoUpdatesHum++; } // Read digital motion value bool tripped = digitalRead(DIGITAL_INPUT_SENSOR) == HIGH; Serial.println(tripped); send(msg.set(tripped?"1":"0")); // Send tripped value to gw // Sleep until interrupt comes in on motion sensor. Send update every two minute. sleep(digitalPinToInterrupt(DIGITAL_INPUT_SENSOR), CHANGE, SLEEP_TIME); }
I have them both currently powered via my computer's USB. I tested with a simple sketch and I was able to get them to communicate "Hello world!" packets.
Anyone have any thoughts?
Thank you.