💬 Sensebender Gateway
-
Hello everybody.
I got my Sensebender gateway yesterday. Have the W5100 Ethernet board mounted and loaded a sketch with the WizNET (W5100) Ethernet module and MQTT.
The gateway immediately ran as desired.
Unfortunately only for about 2 hours, then it freezes.
After a restart it runs again 3 hours and freezes again.
And so on.I wanted to replace an RPI Gatway, which has worked flawlessly for many weeks.
If the Sensebender gateway works only a few hours it is quite useless.
It must be a software issue. Are you using it with nrf24? Do you have a github account? If you have, would you mind filling an issue report on the mysensors library? As we need to dig further into this. Please also make a note of how many nodes you have running in your system.
-
I also think that it is a software problem.
I use only the RFM96HW.
My "real" network has 20 nodes.The Sensebender gateway has only one DS18b20 node on a seperate frequency.
(#define MY_RFM69_FREQUENCY (868200000ul))And yes, I have a github account and will make an issue report today.
-
Did you try my suggestion about hacking the core? Or did you give up on the beast? :)
I'm curious to hear if it is solved..
@tbowmo I think I am on the right track here. This is the log:
0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGS--,VER=2.1.1 0;255;3;0;9;TSF:LRT:OK 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: 0.0.0.0 0;255;3;0;9;MCO:BGN:STP 0;255;3;0;9;MCO:BGN:INIT OK,TSP=1The GW Init is correct one, but IP is 0.0.0.0
This is the sketch:
// Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_DEBUG_VERBOSE_RF24 //#define MY_RADIO_RFM69 #define MY_RF24_CHANNEL 76 // 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 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 to UDP //#define MY_USE_UDP #define MY_IP_ADDRESS 10,1,1,150 // 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 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> void setup() { } void loop() { }I cannot connect to W5100. Tried a different shield with the same result.
-
I would really like to get it solved, so it can bring peace to my mind :) so please, if you can..
@tbowmo BTW, I cannot ping it (I suppose there was another network device with the same IP on a network).
If I try to switch to DHCP I get:0;255;3;0;9;MCO:BGN:INIT GW,CP=RNNGS--,VER=2.1.1 0;255;3;0;9;TSF:LRT:OK 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 DHCP FAILURE...0;255;3;0;9;!MCO:BGN:TSP FAIL -
@tbowmo I have received the second GW and I have exactly the same problem. As you suggested, I modified MyHwSAMD.cpp and can see now the start-up message, but there is a problem between the W5100 and GW:
0;255;3;0;9;660 MCO:BGN:INIT GW,CP=RNNGS---,VER=2.2.0-beta 0;255;3;0;9;707 TSF:LRT:OK 0;255;3;0;9;717 TSM:INIT 0;255;3;0;9;727 TSF:WUR:MS=0 0;255;3;0;9;742 TSM:INIT:TSP OK 0;255;3;0;9;752 TSM:INIT:GW MODE 0;255;3;0;9;762 TSM:READY:ID=0,PAR=0,DIS=0 0;255;3;0;9;772 MCO:REG:NOT NEEDED IP: 0.0.0.0 0;255;3;0;9;2082 MCO:BGN:STP 0;255;3;0;9;2092 MCO:BGN:INIT OK,TSP=1 0;255;3;0;9;17920 TSF:MSG:READ,11-11-0,s=2,c=1,t=37,pt=7,l=5,sg=0:1956.28 0;255;3;0;9;17931 TSF:MSG:READ,11-11-0,s=0,c=1,t=37,pt=7,l=5,sg=0:6080.20 0;255;3;0;9;17942 TSF:MSG:READ,11-11-0,s=3,c=1,t=37,pt=7,l=5,sg=0:20.71 0;255;3;0;9;17953 TSF:MSG:READ,11-11-0,s=1,c=1,t=37,pt=7,l=5,sg=0:13282.11I tried different MySensors (stable and dev) and checked solding.
Now sure what to do nowEDIT: This is my 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 MY_DEBUG_VERBOSE_SIGNING //#define MY_SIGNING_ATSHA204 //#define MY_SIGNING_REQUEST_SIGNATURES // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 // 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 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 to UDP //#define MY_USE_UDP #define MY_IP_ADDRESS 10,1,1,150 // 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 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> void setup() { } void loop() { } -
have you tried the ethernet webserver example sketch (default arduino sketch)?
Just to rule out mysensors..
Also, you are using static IP, right? What if you ping that IP address? Do you get a response? If yes, then the W5100 is configured by your sketch, and the connection should be ok between the samd and the ethernet module.
-
have you tried the ethernet webserver example sketch (default arduino sketch)?
Just to rule out mysensors..
Also, you are using static IP, right? What if you ping that IP address? Do you get a response? If yes, then the W5100 is configured by your sketch, and the connection should be ok between the samd and the ethernet module.
-
have you tried the ethernet webserver example sketch (default arduino sketch)?
Just to rule out mysensors..
Also, you are using static IP, right? What if you ping that IP address? Do you get a response? If yes, then the W5100 is configured by your sketch, and the connection should be ok between the samd and the ethernet module.
-
have you tried the ethernet webserver example sketch (default arduino sketch)?
Just to rule out mysensors..
Also, you are using static IP, right? What if you ping that IP address? Do you get a response? If yes, then the W5100 is configured by your sketch, and the connection should be ok between the samd and the ethernet module.
@tbowmo I have just discovered that the second Ethernet module I have is not W5100 but ENC28J60. Not sure if it is supported by sensebender GW (probably using native Arduino ethernet library?).
So this module is now being returned and just to figure out any hardware issue I need to order a new W5100 -
You should not use soft spi, as there is separate hardware spi ports for radio and W5100.
If you load the default GatewayW5100 example sketch, then it should work out if the box. Perhaps you need to enable rfm69 instead of nrf24 at the top of the file, but that should be all that is needed.. To get a gateway up and running with W5100
-
OK, just to recap here, you have a gateway, and a W5100. If you use that combo, and the http server example, you can ping the gateway, and Load the html files in a browser, right?
If you load stock GatewayW5100 mysensors example sketch, then does that work? (no need to redefine pins for hardware etc, that is handled by the target hardware profile, you choose in arduino)
-
You should not use soft spi, as there is separate hardware spi ports for radio and W5100.
If you load the default GatewayW5100 example sketch, then it should work out if the box. Perhaps you need to enable rfm69 instead of nrf24 at the top of the file, but that should be all that is needed.. To get a gateway up and running with W5100
-
So gateway with nrf and W5100 is working as it should as an ethernet gateway? Then the W5100 is working with the gateway.
What is the hardware configuration that you can't get to work? Rfm69 and W5100? Together with the samd GW?
(just trying to figure out what is going on :))
-
So gateway with nrf and W5100 is working as it should as an ethernet gateway? Then the W5100 is working with the gateway.
What is the hardware configuration that you can't get to work? Rfm69 and W5100? Together with the samd GW?
(just trying to figure out what is going on :))
@tbowmo No, sensebender GW is working with nrf24l01+ as a serial GW, but not with W5100 as ethernet GW.
Interesting observation - I cannot ping the IP any more if I load the ethernet sketch. For your understanding the sensebender GW was never working with W5100 with either nrf or rfm69. Something going wrong around W5100.
I'll hook up W5100 shield to Arduino nano to test it - I have a suspicion about it. However, even without W5100 connected, sensebender GW is showing IP as 0.0.0.0 (I set IP 10.1.1.150). Why?
-
If the ethernet library can't initialize the W5100, it will just write IP address as 0.0.0.0.
Can you please turn on verbose compile logging in arduino? (file -> Settings, set a checkmark at show verbose output during compilation, and choose "all" in Compiler warnings)
I just want to make sure that it is using the correct ethernet library.
-
If the ethernet library can't initialize the W5100, it will just write IP address as 0.0.0.0.
Can you please turn on verbose compile logging in arduino? (file -> Settings, set a checkmark at show verbose output during compilation, and choose "all" in Compiler warnings)
I just want to make sure that it is using the correct ethernet library.
@tbowmo I have verbose on already.
I think you hit the nail on the head:Linking everything together... "C:\Users\Alex\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-gcc" "-LC:\Users\Alex\AppData\Local\Temp\arduino_build_753079" -Os -Wl,--gc-sections -save-temps "-TC:\Users\Alex\AppData\Local\Arduino15\packages\MySensors\hardware\samd\1.0.5\variants\mysensors_gw/linker_scripts/gcc/flash_with_bootloader.ld" "-Wl,-Map,C:\Users\Alex\AppData\Local\Temp\arduino_build_753079/GatewayW5100.ino.map" --specs=nano.specs --specs=nosys.specs -mcpu=cortex-m0plus -mthumb -Wl,--cref -Wl,--check-sections -Wl,--gc-sections -Wl,--unresolved-symbols=report-all -Wl,--warn-common -Wl,--warn-section-align -o "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079/GatewayW5100.ino.elf" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\sketch\GatewayW5100.ino.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\Dhcp.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\Dns.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\Ethernet.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\EthernetClient.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\EthernetServer.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\EthernetUdp.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\utility\socket.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Ethernet\utility\w5100.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\Wire\Wire.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\libraries\SPI\SPI.cpp.o" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079\core\variant.cpp.o" -Wl,--start-group "-LC:\Users\Alex\AppData\Local\Arduino15\packages\arduino\tools\CMSIS\4.5.0/CMSIS/Lib/GCC/" -larm_cortexM0l_math -lm "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079/core\core.a" -Wl,--end-group "C:\Users\Alex\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O binary "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079/GatewayW5100.ino.elf" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079/GatewayW5100.ino.bin" "C:\Users\Alex\AppData\Local\Arduino15\packages\arduino\tools\arm-none-eabi-gcc\4.8.3-2014q1/bin/arm-none-eabi-objcopy" -O ihex -R .eeprom "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079/GatewayW5100.ino.elf" "C:\Users\Alex\AppData\Local\Temp\arduino_build_753079/GatewayW5100.ino.hex" Multiple libraries were found for "Ethernet.h" Used: C:\Users\Alex\AppData\Local\Arduino15\packages\MySensors\hardware\samd\1.0.5\libraries\Ethernet Not used: C:\Program Files (x86)\Arduino\libraries\Ethernet Using library Ethernet at version 1.1.2 in folder: C:\Users\Alex\AppData\Local\Arduino15\packages\MySensors\hardware\samd\1.0.5\libraries\Ethernet Using library MySensors at version 2.2.0-beta in folder: C:\Users\Alex\Documents\Arduino\libraries\MySensors Using library Wire at version 1.0 in folder: C:\Users\Alex\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\libraries\Wire Using library SPI at version 1.0 in folder: C:\Users\Alex\AppData\Local\Arduino15\packages\arduino\hardware\samd\1.6.12\libraries\SPI Sketch uses 45512 bytes (17%) of program storage space. Maximum is 262144 bytes.``` -
Below is the startup log from my Gateway with W5100 and RFM69 attached:
0;255;3;0;9;MCO:BGN:INIT GW,CP=RRNGS--,VER=2.2.0-beta 0;255;3;0;9;TSF:LRT:OK 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.66 0;255;3;0;9;MCO:BGN:STP 0;255;3;0;9;MCO:BGN:INIT OK,TSP=1As seen, the W5100 is initialized with ip address,
Telnet to the Gateway is also working:
thomas at thomas-ThinkPad-L450 in ~ >telnet 192.168.1.66 5003 Trying 192.168.1.66... Connected to 192.168.1.66. Escape character is '^]'. 200;255;4;0;0;FFFFFFFFFFFFFFFF0300 200;255;0;0;17;2.2.0-beta 200;255;3;0;6;0 200;255;3;0;11;Sensebender Micro 200;255;3;0;12;1.4 200;1;0;0;6; 200;2;0;0;7; 200;1;1;0;0;23.3 200;2;1;0;1;46 200;255;3;0;0;81The above is with the stock example sketch from mysensors (right now latest development branch though). The only things I changed, was to enable RFM69, instead of NRF24, and set a different IP address, to match my network settings.
Everything else is running as is, delivered from the mysensors examples..