[SOLVED] MY_RFM69_NEW_DRIVER, SensebenderGW, SensebenderMicro
-
I can't seem to get the NEW RFM69 driver to work. I have a SensebenderGW and a SensebenderMicro. It seems to work just fine with the old driver, so if I comment out the following line it works nicely:
#define MY_RFM69_NEW_DRIVER
GW sketch:
* The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Henrik EKblad * Contribution by a-lurker and Anticimex, * Contribution by Norbert Truchsess <norbert.truchsess@t-online.de> * Contribution by Tomas Hozza <thozza@gmail.com> * * * DESCRIPTION * The EthernetGateway sends data received from sensors to the ethernet link. * The gateway also accepts input on ethernet interface, which is then sent out to the radio network. * * The GW code is designed for Arduino 328p / 16MHz. ATmega168 does not have enough memory to run this program. * * LED purposes: * - To use the feature, uncomment MY_DEFAULT_xxx_LED_PIN in the sketch below * - RX (green) - blink fast on radio message recieved. In inclusion mode will blink fast only on presentation recieved * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or recieve crc error * * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions. * */ // Enable debug prints to serial monitor #define MY_DEBUG #define SN "EthGW/RFM69 Rele Button" #define SV "1.5" // Enable and select radio type attached //#define MY_RADIO_NRF24 //#define MY_RADIO_NRF5_ESB #define MY_RADIO_RFM69 #define MY_RFM69_FREQUENCY RFM69_433MHZ #define MY_RFM69_NEW_DRIVER #define MY_RFM69_ATC_MODE_DISABLED #define MY_IS_RFM69HW //#define MY_RFM69_NETWORKID 105 //#define MY_RF69_SPI_CS 29 #define MY_DEBUG_VERBOSE_RFM69 #define MY_BAUD_RATE 38400 // Enable gateway ethernet module type #define MY_GATEWAY_W5100 #define MY_GATEWAY_MAX_CLIENTS 2 // W5100 Ethernet module SPI enable (optional if using a shield/module that manages SPI_EN signal) //#define MY_W5100_SPI_EN 4 // 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 16 #define MY_SOFT_SPI_MOSI_PIN 15 #endif // When W5100 is connected we have to move CE/CSN pins for NRF radio #ifndef MY_RF24_CE_PIN #define MY_RF24_CE_PIN 5 #endif #ifndef MY_RF24_CS_PIN #define MY_RF24_CS_PIN 6 #endif // Enable UDP communication //#define MY_USE_UDP // If using UDP you need to set MY_CONTROLLER_IP_ADDRESS below // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP) #define MY_IP_ADDRESS 192,168,1,100 // If using static ip you can define Gateway and Subnet address as well //#define MY_IP_GATEWAY_ADDRESS 192,168,178,1 //#define MY_IP_SUBNET_ADDRESS 255,255,255,0 // 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, 0xFE, 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 7 // Error led pin //#define MY_DEFAULT_RX_LED_PIN 8 // Receive led pin //#define MY_DEFAULT_TX_LED_PIN 9 // Transmit led pin #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #include <Ethernet.h> #include <MySensors.h> #include <Bounce2.h> #define RELAY_ON 0 // switch around for ACTIVE LOW / ACTIVE HIGH relay #define RELAY_OFF 1 // #define noRelays 4 //2-4 const int relayPin[] = {MYSX_D5_PWM, MYSX_D6_PWM, MYSX_D9_A3, MYSX_D10_A4}; // switch around pins to your desire const int buttonPin[] = {MYSX_D1_DFM, MYSX_D2_DTM, MYSX_D3_INT, MYSX_D4_INT}; // switch around pins to your desire class Relay // relay class, store all relevant data (equivalent to struct) { public: int buttonPin; // physical pin number of button int relayPin; // physical pin number of relay boolean relayState; // relay status (also stored in EEPROM) }; Relay Relays[noRelays]; Bounce debouncer[noRelays]; MyMessage msg[noRelays]; void setup() { // Setup locally attached sensors wait(100); // Initialize Relays with corresponding buttons for (int i = 0; i < noRelays; i++) { Relays[i].buttonPin = buttonPin[i]; // assign physical pins Relays[i].relayPin = relayPin[i]; msg[i].sensor = i; // initialize messages msg[i].type = V_LIGHT; pinMode(Relays[i].buttonPin, INPUT_PULLUP); wait(100); pinMode(Relays[i].relayPin, OUTPUT); Relays[i].relayState = loadState(i); // retrieve last values from EEPROM digitalWrite(Relays[i].relayPin, Relays[i].relayState ? RELAY_ON : RELAY_OFF); // and set relays accordingly send(msg[i].set(Relays[i].relayState ? true : false)); // make controller aware of last status wait(50); debouncer[i] = Bounce(); // initialize debouncer debouncer[i].attach(buttonPin[i]); debouncer[i].interval(30); wait(50); } } void presentation() { // Present locally attached sensors here // Send the sketch version information to the gateway and Controller sendSketchInfo(SN, SV); wait(100); for (int i = 0; i < noRelays; i++) present(i, S_LIGHT); // present sensor to gateway wait(100); } void loop() { // Send locally attached sensors data here for (byte i = 0; i < noRelays; i++) { if (debouncer[i].update()) { int value = debouncer[i].read(); if ( value == LOW) { Relays[i].relayState = !Relays[i].relayState; digitalWrite(Relays[i].relayPin, Relays[i].relayState ? RELAY_ON : RELAY_OFF); send(msg[i].set(Relays[i].relayState ? true : false)); // save sensor state in EEPROM (location == sensor number) saveState( i, Relays[i].relayState ); } } } //wait(20); } void receive(const MyMessage &message) { if (message.sender == 0) { if (message.type == V_LIGHT) { if (message.sensor < noRelays) { // check if message is valid for relays..... previous line [[[ if (message.sensor <=noRelays){ ]]] Relays[message.sensor].relayState = message.getBool(); digitalWrite(Relays[message.sensor].relayPin, Relays[message.sensor].relayState ? RELAY_ON : RELAY_OFF); // and set relays accordingly saveState( message.sensor, Relays[message.sensor].relayState ); // save sensor state in EEPROM (location == sensor number) } } } wait(20); }
SensebenderMicro sketch:
/** * The MySensors Arduino library handles the wireless radio link and protocol * between your home built sensors/actuators and HA controller of choice. * The sensors forms a self healing radio network with optional repeaters. Each * repeater and gateway builds a routing tables in EEPROM which keeps track of the * network topology allowing messages to be routed to nodes. * * Created by Henrik Ekblad <henrik.ekblad@mysensors.org> * Copyright (C) 2013-2015 Sensnology AB * Full contributor list: https://github.com/mysensors/Arduino/graphs/contributors * * Documentation: http://www.mysensors.org * Support Forum: http://forum.mysensors.org * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * version 2 as published by the Free Software Foundation. * ******************************* * * REVISION HISTORY * Version 1.0 - Thomas Bowman Mørch * * DESCRIPTION * Default sensor sketch for Sensebender Micro module * Act as a temperature / humidity sensor by default. * * If A0 is held low while powering on, it will enter testmode, which verifies all on-board peripherals * * Battery voltage is as battery percentage (Internal message), and optionally as a sensor value (See defines below) * * * Version 1.3 - Thomas Bowman Mørch * Improved transmission logic, eliminating spurious transmissions (when temperatuere / humidity fluctuates 1 up and down between measurements) * Added OTA boot mode, need to hold A1 low while applying power. (uses slightly more power as it's waiting for bootloader messages) * * Version 1.4 - Thomas Bowman Mørch * * Corrected division in the code deciding whether to transmit or not, that resulted in generating an integer. Now it's generating floats as expected. * Simplified detection for OTA bootloader, now detecting if MY_OTA_FIRMWARE_FEATURE is defined. If this is defined sensebender automaticly waits 300mS after each transmission * Moved Battery status messages, so they are transmitted together with normal sensor updates (but only every 60th minute) * */ // Enable debug prints to serial monitor #define MY_DEBUG // Define a static node address, remove if you want auto address assignment #define MY_NODE_ID 17 // Enable and select radio type attached //#define MY_RADIO_NRF24 #define MY_RADIO_RFM69 #define MY_RFM69_FREQUENCY RFM69_433MHZ //#define MY_IS_RFM69HW #define MY_RFM69_NEW_DRIVER #define MY_RFM69_ATC_MODE_DISABLED //#define MY_RFM69_IRQ_PIN 2 // Default in lib is using D2 for common Atmel 328p (mini pro, nano, uno etc.). Uncomment it and set the pin you're using. Note for Atmel 328p, Mysensors, and regarding Arduino core implementation D2 or D3 are only available. But for advanced mcus like Atmel SAMD (Arduino Zero etc.), Esp8266 you will need to set this define for the corresponding pin used for IRQ //#define MY_RFM69_IRQ_NUM MY_RFM69_IRQ_PIN // Temporary define (will be removed in next radio driver revision). Needed if you want to change the IRQ pin your radio is connected. So, if your radio is connected to D3/INT1, value is 1 (INT1). For others mcu like Atmel SAMD, Esp8266, value is simply the same as your RF69_IRQ_PIN //#define MY_RFM69_SPI_CS 10 // If using a different CS pin for the SPI bus. Use MY_RFM69_CS_PIN for the development branch. #define MY_DEBUG_VERBOSE_RFM69 // Enable to support OTA for this node (needs DualOptiBoot boot-loader to fully work) //#define MY_OTA_FIRMWARE_FEATURE #include <SPI.h> #include <MySensors.h> #include <Wire.h> #include <SI7021.h> #ifndef MY_OTA_FIRMWARE_FEATURE #include "drivers/SPIFlash/SPIFlash.cpp" #endif #include <EEPROM.h> #include <sha204_lib_return_codes.h> #include <sha204_library.h> #include <RunningAverage.h> //#include <avr/power.h> // Uncomment the line below, to transmit battery voltage as a normal sensor value //#define BATT_SENSOR 199 #define RELEASE "1.4" #define AVERAGES 2 // Child sensor ID's #define CHILD_ID_TEMP 1 #define CHILD_ID_HUM 2 // How many milli seconds between each measurement #define MEASURE_INTERVAL 60000 // How many milli seconds should we wait for OTA? #define OTA_WAIT_PERIOD 300 // FORCE_TRANSMIT_INTERVAL, this number of times of wakeup, the sensor is forced to report all values to the controller #define FORCE_TRANSMIT_INTERVAL 30 // When MEASURE_INTERVAL is 60000 and FORCE_TRANSMIT_INTERVAL is 30, we force a transmission every 30 minutes. // Between the forced transmissions a tranmission will only occur if the measured value differs from the previous measurement // HUMI_TRANSMIT_THRESHOLD tells how much the humidity should have changed since last time it was transmitted. Likewise with // TEMP_TRANSMIT_THRESHOLD for temperature threshold. #define HUMI_TRANSMIT_THRESHOLD 0.4 #define TEMP_TRANSMIT_THRESHOLD 0.2 // Pin definitions #define TEST_PIN A0 #define LED_PIN A2 #define ATSHA204_PIN 17 // A3 const int sha204Pin = ATSHA204_PIN; atsha204Class sha204(sha204Pin); SI7021 humiditySensor; SPIFlash flash(8, 0x1F65); // Sensor messages MyMessage msgHum(CHILD_ID_HUM, V_HUM); MyMessage msgTemp(CHILD_ID_TEMP, V_TEMP); #ifdef BATT_SENSOR MyMessage msgBatt(BATT_SENSOR, V_VOLTAGE); #endif // Global settings int measureCount = 0; int sendBattery = 0; boolean isMetric = true; boolean highfreq = true; boolean transmission_occured = false; // Storage of old measurements float lastTemperature = -100; int lastHumidity = -100; long lastBattery = -100; RunningAverage raHum(AVERAGES); /**************************************************** * * Setup code * ****************************************************/ void setup() { pinMode(LED_PIN, OUTPUT); digitalWrite(LED_PIN, LOW); Serial.begin(115200); Serial.print(F("Sensebender Micro FW ")); Serial.print(RELEASE); Serial.flush(); // First check if we should boot into test mode pinMode(TEST_PIN,INPUT); digitalWrite(TEST_PIN, HIGH); // Enable pullup if (!digitalRead(TEST_PIN)) testMode(); // Make sure that ATSHA204 is not floating pinMode(ATSHA204_PIN, INPUT); digitalWrite(ATSHA204_PIN, HIGH); digitalWrite(TEST_PIN,LOW); digitalWrite(LED_PIN, HIGH); humiditySensor.begin(); digitalWrite(LED_PIN, LOW); Serial.flush(); Serial.println(F(" - Online!")); isMetric = getControllerConfig().isMetric; Serial.print(F("isMetric: ")); Serial.println(isMetric); raHum.clear(); sendTempHumidityMeasurements(false); sendBattLevel(false); #ifdef MY_OTA_FIRMWARE_FEATURE Serial.println("OTA FW update enabled"); #endif } void presentation() { sendSketchInfo("Sensebender Micro", RELEASE); present(CHILD_ID_TEMP,S_TEMP); present(CHILD_ID_HUM,S_HUM); #ifdef BATT_SENSOR present(BATT_SENSOR, S_POWER); #endif } /*********************************************** * * Main loop function * ***********************************************/ void loop() { measureCount ++; sendBattery ++; bool forceTransmit = false; transmission_occured = false; #ifndef MY_OTA_FIRMWARE_FEATURE if ((measureCount == 5) && highfreq) { clock_prescale_set(clock_div_8); // Switch to 1Mhz for the reminder of the sketch, save power. highfreq = false; } #endif if (measureCount > FORCE_TRANSMIT_INTERVAL) { // force a transmission forceTransmit = true; measureCount = 0; } sendTempHumidityMeasurements(forceTransmit); /* if (sendBattery > 60) { sendBattLevel(forceTransmit); // Not needed to send battery info that often sendBattery = 0; }*/ #ifdef MY_OTA_FIRMWARE_FEATURE if (transmission_occured) { wait(OTA_WAIT_PERIOD); } #endif sleep(MEASURE_INTERVAL); } /********************************************* * * Sends temperature and humidity from Si7021 sensor * * Parameters * - force : Forces transmission of a value (even if it's the same as previous measurement) * *********************************************/ void sendTempHumidityMeasurements(bool force) { bool tx = force; si7021_env data = humiditySensor.getHumidityAndTemperature(); raHum.addValue(data.humidityPercent); float diffTemp = abs(lastTemperature - (isMetric ? data.celsiusHundredths : data.fahrenheitHundredths)/100.0); float diffHum = abs(lastHumidity - raHum.getAverage()); Serial.print(F("TempDiff :"));Serial.println(diffTemp); Serial.print(F("HumDiff :"));Serial.println(diffHum); if (isnan(diffHum)) tx = true; if (diffTemp > TEMP_TRANSMIT_THRESHOLD) tx = true; if (diffHum > HUMI_TRANSMIT_THRESHOLD) tx = true; if (tx) { measureCount = 0; float temperature = (isMetric ? data.celsiusHundredths : data.fahrenheitHundredths) / 100.0; int humidity = data.humidityPercent; Serial.print("T: ");Serial.println(temperature); Serial.print("H: ");Serial.println(humidity); send(msgTemp.set(temperature,1)); send(msgHum.set(humidity)); lastTemperature = temperature; lastHumidity = humidity; transmission_occured = true; if (sendBattery > 60) { sendBattLevel(true); // Not needed to send battery info that often sendBattery = 0; } } } /******************************************** * * Sends battery information (battery percentage) * * Parameters * - force : Forces transmission of a value * *******************************************/ void sendBattLevel(bool force) { if (force) lastBattery = -1; long vcc = readVcc(); if (vcc != lastBattery) { lastBattery = vcc; #ifdef BATT_SENSOR float send_voltage = float(vcc)/1000.0f; send(msgBatt.set(send_voltage,3)); #endif // Calculate percentage vcc = vcc - 1900; // subtract 1.9V from vcc, as this is the lowest voltage we will operate at long percent = vcc / 14.0; sendBatteryLevel(percent); transmission_occured = true; } } /******************************************* * * Internal battery ADC measuring * *******************************************/ long readVcc() { // Read 1.1V reference against AVcc // set the reference to Vcc and the measurement to the internal 1.1V reference #if defined(__AVR_ATmega32U4__) || defined(__AVR_ATmega1280__) || defined(__AVR_ATmega2560__) ADMUX = _BV(REFS0) | _BV(MUX4) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); #elif defined (__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) ADMUX = _BV(MUX5) | _BV(MUX0); #elif defined (__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) ADcdMUX = _BV(MUX3) | _BV(MUX2); #else ADMUX = _BV(REFS0) | _BV(MUX3) | _BV(MUX2) | _BV(MUX1); #endif delay(2); // Wait for Vref to settle ADCSRA |= _BV(ADSC); // Start conversion while (bit_is_set(ADCSRA,ADSC)); // measuring uint8_t low = ADCL; // must read ADCL first - it then locks ADCH uint8_t high = ADCH; // unlocks both long result = (high<<8) | low; result = 1125300L / result; // Calculate Vcc (in mV); 1125300 = 1.1*1023*1000 return result; // Vcc in millivolts } /**************************************************** * * Verify all peripherals, and signal via the LED if any problems. * ****************************************************/ void testMode() { uint8_t rx_buffer[SHA204_RSP_SIZE_MAX]; uint8_t ret_code; byte tests = 0; digitalWrite(LED_PIN, HIGH); // Turn on LED. Serial.println(F(" - TestMode")); Serial.println(F("Testing peripherals!")); Serial.flush(); Serial.print(F("-> SI7021 : ")); Serial.flush(); if (humiditySensor.begin()) { Serial.println(F("ok!")); tests ++; } else { Serial.println(F("failed!")); } Serial.flush(); Serial.print(F("-> Flash : ")); Serial.flush(); if (flash.initialize()) { Serial.println(F("ok!")); tests ++; } else { Serial.println(F("failed!")); } Serial.flush(); Serial.print(F("-> SHA204 : ")); ret_code = sha204.sha204c_wakeup(rx_buffer); Serial.flush(); if (ret_code != SHA204_SUCCESS) { Serial.print(F("Failed to wake device. Response: ")); Serial.println(ret_code, HEX); } Serial.flush(); if (ret_code == SHA204_SUCCESS) { ret_code = sha204.getSerialNumber(rx_buffer); if (ret_code != SHA204_SUCCESS) { Serial.print(F("Failed to obtain device serial number. Response: ")); Serial.println(ret_code, HEX); } else { Serial.print(F("Ok (serial : ")); for (int i=0; i<9; i++) { if (rx_buffer[i] < 0x10) { Serial.print('0'); // Because Serial.print does not 0-pad HEX } Serial.print(rx_buffer[i], HEX); } Serial.println(")"); tests ++; } } Serial.flush(); Serial.println(F("Test finished")); if (tests == 3) { Serial.println(F("Selftest ok!")); while (1) // Blink OK pattern! { digitalWrite(LED_PIN, HIGH); delay(200); digitalWrite(LED_PIN, LOW); delay(200); } } else { Serial.println(F("----> Selftest failed!")); while (1) // Blink FAILED pattern! Rappidly blinking.. { } } }
Debug log from GW:
1346 MCO:BGN:STP 2256 MCO:BGN:INIT OK,TSP=1 900040 TSF:SAN:OK
Debug log from Node:
__ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.2.0 16 MCO:BGN:INIT NODE,CP=RPNNA---,VER=2.2.0 26 TSM:INIT 28 TSF:WUR:MS=0 30 RFM69:INIT 30 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0 36 RFM69:PTX:LEVEL=5 dBm 38 TSM:INIT:TSP OK 40 TSM:INIT:STATID=17 43 TSF:SID:OK,ID=17 45 TSM:FPAR 47 RFM69:SWR:SEND,TO=255,RETRY=0 53 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 2062 !TSM:FPAR:NO REPLY 2064 TSM:FPAR 2066 RFM69:SWR:SEND,TO=255,RETRY=0 2072 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4081 !TSM:FPAR:NO REPLY 4083 TSM:FPAR 4085 RFM69:SWR:SEND,TO=255,RETRY=0 4091 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 6103 !TSM:FPAR:NO REPLY 6105 TSM:FPAR 6107 RFM69:SWR:SEND,TO=255,RETRY=0 6113 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 8122 !TSM:FPAR:FAIL 8124 TSM:FAIL:CNT=1 8126 TSM:FAIL:DIS 8128 TSF:TDI:TSL 8128 RFM69:RSL 18132 TSM:FAIL:RE-INIT 18135 TSM:INIT 18137 RFM69:INIT 18139 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0 18143 RFM69:PTX:LEVEL=5 dBm 18147 TSM:INIT:TSP OK 18149 TSM:INIT:STATID=17 18151 TSF:SID:OK,ID=17 18153 TSM:FPAR 18155 RFM69:SWR:SEND,TO=255,RETRY=0 18163 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 20172 !TSM:FPAR:NO REPLY 20174 TSM:FPAR 20176 RFM69:SWR:SEND,TO=255,RETRY=0 20183 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 22192 !TSM:FPAR:NO REPLY 22194 TSM:FPAR 22196 RFM69:SWR:SEND,TO=255,RETRY=0 22202 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 24211 !TSM:FPAR:NO REPLY 24213 TSM:FPAR 24215 RFM69:SWR:SEND,TO=255,RETRY=0 24221 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 26230 !TSM:FPAR:FAIL 26232 TSM:FAIL:CNT=2 26234 TSM:FAIL:DIS 26236 TSF:TDI:TSL 26238 RFM69:RSL 36243 TSM:FAIL:RE-INIT 36245 TSM:INIT 36247 RFM69:INIT 36249 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0 36253 RFM69:PTX:LEVEL=5 dBm 36257 TSM:INIT:TSP OK 36259 TSM:INIT:STATID=17 36261 TSF:SID:OK,ID=17 36263 TSM:FPAR 36265 RFM69:SWR:SEND,TO=255,RETRY=0 36274 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 40302 !TSM:FPAR:NO REPLY 40304 TSM:FPAR 40306 RFM69:SWR:SEND,TO=255,RETRY=0 40312 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 42323 !TSM:FPAR:NO REPLY 42326 TSM:FPAR 42328 RFM69:SWR:SEND,TO=255,RETRY=0 42334 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 44343 !TSM:FPAR:FAIL 44345 TSM:FAIL:CNT=3 44347 TSM:FAIL:DIS 44349 TSF:TDI:TSL 44351 RFM69:RSL 54355 TSM:FAIL:RE-INIT 54358 TSM:INIT 54360 RFM69:INIT 54362 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0 54366 RFM69:PTX:LEVEL=5 dBm 54370 TSM:INIT:TSP OK 54372 TSM:INIT:STATID=17 54374 TSF:SID:OK,ID=17 54376 TSM:FPAR 54378 RFM69:SWR:SEND,TO=255,RETRY=0 54386 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 56395 !TSM:FPAR:NO REPLY 56397 TSM:FPAR 56399 RFM69:SWR:SEND,TO=255,RETRY=0 56406 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 58415 !TSM:FPAR:NO REPLY 58417 TSM:FPAR 58419 RFM69:SWR:SEND,TO=255,RETRY=0 58425 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 60434 !TSM:FPAR:NO REPLY 60436 TSM:FPAR 60438 RFM69:SWR:SEND,TO=255,RETRY=0 60444 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 62453 !TSM:FPAR:FAIL 62455 TSM:FAIL:CNT=4 62457 TSM:FAIL:DIS 62459 TSF:TDI:TSL 62461 RFM69:RSL 72466 TSM:FAIL:RE-INIT 72468 TSM:INIT 72470 RFM69:INIT 72472 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0 72476 RFM69:PTX:LEVEL=5 dBm 72480 TSM:INIT:TSP OK 72482 TSM:INIT:STATID=17 72484 TSF:SID:OK,ID=17 72486 TSM:FPAR 72488 RFM69:SWR:SEND,TO=255,RETRY=0 72497 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 74506 !TSM:FPAR:NO REPLY 74508 TSM:FPAR 74510 RFM69:SWR:SEND,TO=255,RETRY=0 74516 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 76525 !TSM:FPAR:NO REPLY 76527 TSM:FPAR 76529 RFM69:SWR:SEND,TO=255,RETRY=0 76535 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 78546 !TSM:FPAR:NO REPLY 78548 TSM:FPAR 78551 RFM69:SWR:SEND,TO=255,RETRY=0 78557 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 80566 !TSM:FPAR:FAIL 80568 TSM:FAIL:CNT=5 80570 TSM:FAIL:DIS 80572 TSF:TDI:TSL 80574 RFM69:RSL 90578 TSM:FAIL:RE-INIT 90580 TSM:INIT 90583 RFM69:INIT 90585 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0 90589 RFM69:PTX:LEVEL=5 dBm 90593 TSM:INIT:TSP OK 90595 TSM:INIT:STATID=17 90597 TSF:SID:OK,ID=17 90599 TSM:FPAR 90601 RFM69:SWR:SEND,TO=255,RETRY=0 90609 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 92618 !TSM:FPAR:NO REPLY 92620 TSM:FPAR 92622 RFM69:SWR:SEND,TO=255,RETRY=0 92653 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 94662 !TSM:FPAR:NO REPLY 94664 TSM:FPAR 94666 RFM69:SWR:SEND,TO=255,RETRY=0 94672 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 96684 !TSM:FPAR:NO REPLY 96686 TSM:FPAR 96688 RFM69:SWR:SEND,TO=255,RETRY=0 96694 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 98703 !TSM:FPAR:FAIL 98705 TSM:FAIL:CNT=6
@scalz Is there some trick to use the NEW Driver since it works fine using the old?
Using Arduino IDE 1.8.5
Arduino AVR Boards 1.6.11
MySensors AVR Boards 1.0.1
Arduino SAMD Boards 1.6.17
MySensors SAMD Boards 1.0.5
MySensors Lib 2.2.0
-
Tested with serial GW sketch on the SensebenderGW instead:
GW log:
0;255;3;0;9;670 RFM69:INIT 0;255;3;0;9;685 RFM69:INIT:PIN,CS=30,IQP=32,IQN=32,RST=43 0;255;3;0;9;695 RFM69:PTX:LEVEL=5 dBm 0;255;3;0;14;Gateway startup complete. 0;255;0;0;18;2.2.0 0;255;3;0;9;19524 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;19737 !RFM69:SWR:NACK 0;255;3;0;9;19747 RFM69:SWR:SEND,TO=17,RETRY=1 0;255;3;0;9;19767 RFM69:SWR:ACK,FROM=17,SEQ=1,RSSI=-61 0;255;3;0;9;26296 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;26316 RFM69:SWR:ACK,FROM=17,SEQ=2,RSSI=-54 0;255;3;0;9;27455 RFM69:SAC:SEND ACK,TO=17,RSSI=-60 0;255;3;0;9;27472 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;27492 RFM69:SWR:ACK,FROM=17,SEQ=4,RSSI=-54 0;255;3;0;9;27514 RFM69:SAC:SEND ACK,TO=17,RSSI=-60 0;255;3;0;9;27526 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;27546 RFM69:SWR:ACK,FROM=17,SEQ=6,RSSI=-54 0;255;3;0;9;27560 RFM69:SAC:SEND ACK,TO=17,RSSI=-60 17;255;0;0;17;2.2.0 0;255;3;0;9;27592 RFM69:SAC:SEND ACK,TO=17,RSSI=-60 17;255;3;0;6;0 0;255;3;0;9;29620 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;3;0;11;Sensebender Micro 0;255;3;0;9;29654 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;3;0;12;1.4 0;255;3;0;9;29686 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;1;0;0;6; 0;255;3;0;9;29717 RFM69:SAC:SEND ACK,TO=17,RSSI=-60 17;2;0;0;7; 0;255;3;0;9;29750 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 0;255;3;0;9;29767 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;29787 RFM69:SWR:ACK,FROM=17,SEQ=14,RSSI=-54 0;255;3;0;9;29831 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;1;1;0;0;28.1 0;255;3;0;9;29863 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;2;1;0;1;25 0;255;3;0;9;29897 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;3;0;0;101 0;255;3;0;9;48872 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;48892 RFM69:SWR:ACK,FROM=17,SEQ=18,RSSI=-54 0;255;3;0;9;50007 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 0;255;3;0;9;50024 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;50044 RFM69:SWR:ACK,FROM=17,SEQ=20,RSSI=-54 0;255;3;0;9;50066 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 0;255;3;0;9;50078 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;50098 RFM69:SWR:ACK,FROM=17,SEQ=22,RSSI=-54 0;255;3;0;9;50112 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;0;0;17;2.2.0 0;255;3;0;9;50144 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;3;0;6;0 0;255;3;0;9;52172 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;3;0;11;Sensebender Micro 0;255;3;0;9;52206 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;3;0;12;1.4 0;255;3;0;9;52238 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;1;0;0;6; 0;255;3;0;9;52269 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;2;0;0;7; 0;255;3;0;9;52302 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 0;255;3;0;9;52319 RFM69:SWR:SEND,TO=17,RETRY=0 0;255;3;0;9;52532 !RFM69:SWR:NACK 0;255;3;0;9;52574 RFM69:SWR:SEND,TO=17,RETRY=1 0;255;3;0;9;52787 !RFM69:SWR:NACK 0;255;3;0;9;52829 RFM69:SWR:SEND,TO=17,RETRY=2 0;255;3;0;9;52849 RFM69:SWR:ACK,FROM=17,SEQ=30,RSSI=-54 0;255;3;0;9;52893 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;1;1;0;0;28.1 0;255;3;0;9;52925 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;2;1;0;1;23 0;255;3;0;9;52959 RFM69:SAC:SEND ACK,TO=17,RSSI=-61 17;255;3;0;0;101 0;255;3;0;9;116786 RFM69:SAC:SEND ACK,TO=17,RSSI=-54 17;1;1;0;0;27.6 0;255;3;0;9;116818 RFM69:SAC:SEND ACK,TO=17,RSSI=-54 17;2;1;0;1;16 0;255;3;0;9;180582 RFM69:SAC:SEND ACK,TO=17,RSSI=-56 17;1;1;0;0;27.5 0;255;3;0;9;180614 RFM69:SAC:SEND ACK,TO=17,RSSI=-56 17;2;1;0;1;10
Node log:
__ __ ____ | \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.2.0 16 MCO:BGN:INIT NODE,CP=RPNNA---,VER=2.2.0 26 TSM:INIT 28 TSF:WUR:MS=0 30 RFM69:INIT 30 RFM69:INIT:PIN,CS=10,IQP=2,IQN=0 36 RFM69:PTX:LEVEL=5 dBm 38 TSM:INIT:TSP OK 40 TSM:INIT:STATID=17 43 TSF:SID:OK,ID=17 45 TSM:FPAR 47 RFM69:SWR:SEND,TO=255,RETRY=0 53 TSF:MSG:SEND,17-17-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 950 RFM69:SAC:SEND ACK,TO=0,RSSI=-54 956 TSF:MSG:READ,0-0-17,s=255,c=3,t=8,pt=1,l=1,sg=0:0 962 TSF:MSG:FPAR OK,ID=0,D=1 2062 TSM:FPAR:OK 2062 TSM:ID 2064 TSM:ID:OK 2066 TSM:UPL 2068 RFM69:SWR:SEND,TO=0,RETRY=0 2086 RFM69:SWR:ACK,FROM=0,SEQ=3,RSSI=-61 2091 TSF:MSG:SEND,17-17-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 2105 RFM69:SAC:SEND ACK,TO=0,RSSI=-54 2111 TSF:MSG:READ,0-0-17,s=255,c=3,t=25,pt=1,l=1,sg=0:1 2117 TSF:MSG:PONG RECV,HP=1 2121 TSM:UPL:OK 2121 TSM:READY:ID=17,PAR=0,DIS=1 2125 RFM69:SWR:SEND,TO=0,RETRY=0 2146 RFM69:SWR:ACK,FROM=0,SEQ=5,RSSI=-61 2150 TSF:MSG:SEND,17-17-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 2158 RFM69:SAC:SEND ACK,TO=0,RSSI=-54 2166 TSF:MSG:READ,0-0-17,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 2172 RFM69:SWR:SEND,TO=0,RETRY=0 2193 RFM69:SWR:ACK,FROM=0,SEQ=7,RSSI=-61 2197 TSF:MSG:SEND,17-17-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.2.0 2205 RFM69:SWR:SEND,TO=0,RETRY=0 2224 RFM69:SWR:ACK,FROM=0,SEQ=8,RSSI=-61 2228 TSF:MSG:SEND,17-17-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 4237 RFM69:SWR:SEND,TO=0,RETRY=0 4259 RFM69:SWR:ACK,FROM=0,SEQ=9,RSSI=-61 4263 TSF:MSG:SEND,17-17-0-0,s=255,c=3,t=11,pt=0,l=17,sg=0,ft=0,st=OK:Sensebender Micro 4272 RFM69:SWR:SEND,TO=0,RETRY=0 4292 RFM69:SWR:ACK,FROM=0,SEQ=10,RSSI=-61 4296 TSF:MSG:SEND,17-17-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:1.4 4304 RFM69:SWR:SEND,TO=0,RETRY=0 4325 RFM69:SWR:ACK,FROM=0,SEQ=11,RSSI=-61 4329 TSF:MSG:SEND,17-17-0-0,s=1,c=0,t=6,pt=0,l=0,sg=0,ft=0,st=OK: 4337 RFM69:SWR:SEND,TO=0,RETRY=0 4356 RFM69:SWR:ACK,FROM=0,SEQ=12,RSSI=-61 4360 TSF:MSG:SEND,17-17-0-0,s=2,c=0,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 4368 MCO:REG:REQ 4370 RFM69:SWR:SEND,TO=0,RETRY=0 4388 RFM69:SWR:ACK,FROM=0,SEQ=13,RSSI=-61 4395 TSF:MSG:SEND,17-17-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 4919 RFM69:SAC:SEND ACK,TO=0,RSSI=-54 4925 TSF:MSG:READ,0-0-17,s=255,c=3,t=27,pt=1,l=1,sg=0:1 4931 MCO:PIM:NODE REG=1 4933 MCO:BGN:STP Sensebender Micro FW 1.4 - Online! isMetric: 1 TempDiff :128.10 HumDiff :123.00 T: 28.10 H: 23 4962 RFM69:SWR:SEND,TO=0,RETRY=0 4982 RFM69:SWR:ACK,FROM=0,SEQ=15,RSSI=-61 4986 TSF:MSG:SEND,17-17-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:28.1 4995 RFM69:SWR:SEND,TO=0,RETRY=0 5015 RFM69:SWR:ACK,FROM=0,SEQ=16,RSSI=-61 5019 TSF:MSG:SEND,17-17-0-0,s=2,c=1,t=1,pt=2,l=2,sg=0,ft=0,st=OK:23 5029 RFM69:SWR:SEND,TO=0,RETRY=0 5048 RFM69:SWR:ACK,FROM=0,SEQ=17,RSSI=-61 5052 TSF:MSG:SEND,17-17-0-0,s=255,c=3,t=0,pt=1,l=1,sg=0,ft=0,st=OK:101 5060 MCO:BGN:INIT OK,TSP=1 TempDiff :0.05 HumDiff :0.00 5083 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255 5091 TSF:TDI:TSL 5091 RFM69:RSL 5095 MCO:SLP:WUP=-1 5097 TSF:TRI:TSB 5099 RFM69:RSB TempDiff :0.51 HumDiff :3.50 T: 27.59 H: 16 5122 RFM69:SWR:SEND,TO=0,RETRY=0 5142 RFM69:SWR:ACK,FROM=0,SEQ=18,RSSI=-54 5146 TSF:MSG:SEND,17-17-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:27.6 5154 RFM69:SWR:SEND,TO=0,RETRY=0 5175 RFM69:SWR:ACK,FROM=0,SEQ=19,RSSI=-54 5179 TSF:MSG:SEND,17-17-0-0,s=2,c=1,t=1,pt=2,l=2,sg=0,ft=0,st=OK:16 5187 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255 5193 TSF:TDI:TSL 5193 RFM69:RSL 5197 MCO:SLP:WUP=-1 5199 TSF:TRI:TSB 5201 RFM69:RSB TempDiff :0.08 HumDiff :3.00 T: 27.51 H: 10 5224 RFM69:SWR:SEND,TO=0,RETRY=0 5244 RFM69:SWR:ACK,FROM=0,SEQ=20,RSSI=-56 5249 TSF:MSG:SEND,17-17-0-0,s=1,c=1,t=0,pt=7,l=5,sg=0,ft=0,st=OK:27.5 5257 RFM69:SWR:SEND,TO=0,RETRY=0 5277 RFM69:SWR:ACK,FROM=0,SEQ=21,RSSI=-56 5281 TSF:MSG:SEND,17-17-0-0,s=2,c=1,t=1,pt=2,l=2,sg=0,ft=0,st=OK:10 5289 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255 5296 TSF:TDI:TSL 5296 RFM69:RSL 5300 MCO:SLP:WUP=-1 5302 TSF:TRI:TSB 5304 RFM69:RSB TempDiff :0.11 HumDiff :0.00 5324 MCO:SLP:MS=60000,SMS=0,I1=255,M1=255,I2=255,M2=255 5330 TSF:TDI:TSL 5332 RFM69:RSL
Seems to work just fine so I guess there is something wrong with using the W5100/NEW_RFM69 GW code on the sensebender?
Or did I make a mistake in the GW sketch that only affects the NEW RFM69 driver?
-
I believe there are already other open topic about problems with W5100 and RFM69.
Did you try commenting #define MY_RFM69_ATC_MODE_DISABLED ? While the node doesn't find parent, what do you seen on the GW log?
-
@gohan said in MY_RFM69_NEW_DRIVER, SensebenderGW, SensebenderMicro:
W5100 and RFM69
I do not believe that this is a W5100 and RFM69 issue since the old RFM69 driver works just fine.
And yes I have also tried commenting the line you suggested. I believe that the issue is with running the new RFM69 driver on SAMD Board somehow.
-
@tekka , could it be a timing issue like I had on the raspberry?
-
Maybe @Anticimex has some thought about this? Did you try the RFM69/W5100 combination on the SensebenderGW with or without the "#define MY_RFM69_NEW_DRIVER"?
-
@korttoma I have no RFM69 hardware and have not been involved in any driver development so I have absolutely no clue about this.
-
@korttoma @gohan Please try the lastest dev branch - I've rewritten the RFM69 driver with some major changes (in preparation of a new feature).
-
@tekka updated the GW with the Dev branch Lib (2.2.1-alpha) and now it seems to be working!
update: Also updated the SensebenderMicro Node with the Dev branch Lib (2.2.1-alpha) and it is stil working thanks @tekka