@OldSurferDude
The complete wipe seems to have worked. I also changed the version on HA's integration to 2.3 to match the MySensors library I use on the sketches.
Thanks for the workaround.
Posts made by Dbagioni
-
RE: Did HA just give up on MySensors?
-
RE: Did HA just give up on MySensors?
My set up is via a Serial gateway. MySensors nodes/gateway are running V2.3, but my HA only is listing version as 1.4, not sure if that could be part of my issue. Im going to try shutting down the gateway, uninstalling the intergration and then going form there. Presently Im only seeing traffic from one sensor.
-
Did HA just give up on MySensors?
Ive been running HA for about a year now. Around July(ish) I noticed Mysensors just suddenly seemed to only work with nodes that were registered prior. None of my new sensors or switches are discovered and many of my sensors have gone dead. Any thoughts or fixes?
-
HA throwing invalid serial port message on new HA install
All
Im new to HA. Ive just transitioned from another platform to HA. Im running my HA on a Ubuntu 20.04 server, and installled the HA via Docker.
When I search I can find me serial gateway on /dev/ttyUSB0, but when I enter the info into the HA integration I get "invalid serial port". Can anyone give me a clue as to how to get this running? -
RE: OH3 - MySensors Binding
@vores8 just down loaded it and installed. Showing up online with my serial gateway. Gonna let it run but looks like it’s working now. Nice work, and thank you.
-
RE: Safe AC dimmer with code
The code I posted is the raw code for the zero-cross dimmer. When I had tried to merge the "dimmer with rotary encoder" sketch and the zero-cross code I had wired it up with the ZC pin as 2 and the PWM pin on 3. Encoder was wired: SW pin on 4, CLK pin on 5 and CE pin on 6. 7/8/A2 were used for status LED's.
I was running it with an older NANO with the 328.
-
Safe AC dimmer with code
All
Has anyone found a safe and reliable dimmer code to with with an AC dimmer? I have been racking my brains and cant find a good working code. I'm using commercially made pwm/zero cross dimmers from RobotDYN(see picture). I can get a 12 volt version working but have been unsuccessful in getting this to work. Disclaimer - Im a hardware guy not a code guy.
My end goal would be to get it working with the rotary encoder. This is the RAW pwm/zero crossing code.
#include "hw_timer.h" #include <Time.h> #include <TimeLib.h> #include <TimeAlarms.h> //Pin Setups const int zcPin = 12; //zero-cross detection pin D6 const int pwmPin = 13; //pwm pin - fires the triac D7 //Dimmer Settings including fades. byte fade = 1; byte state = 1; byte tarBrightness = 255; //"target" brightness - going to have go convert this to a precentage for OH byte curBrightness = 0; //current brightness level byte zcState = 0; // 0 = ready; 1 = processing; char lvl[50]; void setup() { Serial.begin(115200); //Sets the data rate in bits per second (baud) for serial data transmission. //Dimmer pins -set up the pwm and zero cross pins pinMode(zcPin, INPUT_PULLUP); pinMode(pwmPin, OUTPUT); attachInterrupt(zcPin, zcDetectISR, RISING); // Attach an Interupt to Pin 2 (interupt 0) for Zero Cross Detection hw_timer_init(NMI_SOURCE, 0); hw_timer_set_func(dimTimerISR); } // END SETUP void dimTimerISR() { if (fade == 1) { if (curBrightness > tarBrightness || (state == 0 && curBrightness > 0)) { --curBrightness; } else if (curBrightness < tarBrightness && state == 1 && curBrightness < 255) { ++curBrightness; } } else { if (state == 1) { curBrightness = tarBrightness; } else { curBrightness = 0; } } if (curBrightness == 0) { state = 0; digitalWrite(pwmPin, 0); } else if (curBrightness == 255) { state = 1; digitalWrite(pwmPin, 1); } else { digitalWrite(pwmPin, 1); } zcState = 0; } void zcDetectISR() { if (zcState == 0) { zcState = 1; if (curBrightness < 255 && curBrightness > 0) { digitalWrite(pwmPin, 0); int dimDelay = 30 * (255 - curBrightness) + 400;//400 hw_timer_arm(dimDelay); } } }
Can anyone help?
-
Status LED issues with Raspberry Pi gateway
Morning all.
Ive just had to completely rebuild my openhab and mysensors set up. Im running OH 2.4 on a Raspberry Pi 3B+, with the MySensors 2.4 bindings. Gateway compiles and runs fine....butttt I acidentaly configured --my-leds-blinking-inverse. How do i unconfigure it.Second led issue. The red error led is always lit, no blink, just steady burn. It is wired as noted in the guide.
Should i reneter the options and then remake the gate way? Im not sure how to go about this I was using arduinos before and there you just deleted the options from the sketch and reloaded it.
Thanks for the advice in advance
-
Having an issue with message signing.
Hello again
I am having an issue with message signing. I have begun to expand my mysensors devices to include some actuators and sensors I want to secure. I have tried to get this to work, but keep hitting a wall.
Here;s my set up for my testing. My mega Ethernet gateway with software backed signing enabled, and my Uno set up as a mock relay actuator with software backed signing enabled. If I set up MY_SIGNING_SIMPLE_PASSWD "blahblahblah", everything works great. As soon as thats disabled...nothing wants to talk to each other.
How I have programmed the devices. On the gateway I ran the personalizer sketch and generated the HMAC and AES keys. I copied that info into the proper sections, disabled generate keys and enabled personalize soft. I then ran the personalizer on both the gateway and the node and received a "Succes" message.
This is my gateway 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 // Enable and select radio type attached #define MY_RADIO_RF24 // 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 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,69 // If using static ip you can define Gateway and Subnet address as well #define MY_IP_GATEWAY_ADDRESS 192,168,1,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, 0xEF, 0xFE, 0xED // Set LOW transmit power level as default, if you have an amplified NRF-module and // power your radio separately with a good regulator you can turn up PA level. #define MY_RF24_PA_LEVEL RF24_PA_MAX // 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 90 // Digital pin used for inclusion mode button #define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Inverses the behavior of leds #define MY_WITH_LEDS_BLINKING_INVERSE // Flash leds on rx/tx/err // Uncomment to override default HW configurations #define MY_DEFAULT_ERR_LED_PIN 40 // Error led pin #define MY_DEFAULT_RX_LED_PIN 42 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 44 // Transmit led pin #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #define MY_SIGNING_SOFT #define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 #define MY_SIGNING_SIMPLE_PASSWD "MyEmmaBemma2015" #define MY_SIGNING_WEAK_SECURITY #include <Ethernet.h> #include <MyConfig.h> #include <MySensors.h> void setup() { // Setup locally attached sensors } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }
When I run the gateway I get the following message in the serial monitor
8732 TSF:MSG:BC 8734 TSF:MSG:FPAR REQ,ID=22 8736 TSF:CKU:OK,FCTRL 8738 TSF:MSG:GWL OK 9288 SGN:SKP:MSG CMD=3,TYPE=8 9293 TSF:MSG:SEND,0-0-22-22,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0 9300 TSF:MSG:READ,6-6-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1 9306 TSF:MSG:PINGED,ID=6,HP=1 9308 SGN:SGN:NREQ=6 9312 TSF:MSG:SEND,0-0-6-6,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1 10048 TSF:MSG:READ,6-6-0,s=3,c=1,t=1,pt=7,l=5,sg=0:53.3 10778 TSF:MSG:READ,22-22-0,s=255,c=3,t=24,pt=1,l=1,sg=0:1 10783 TSF:MSG:PINGED,ID=22,HP=1 10786 SGN:SKP:MSG CMD=3,TYPE=25 10791 TSF:MSG:SEND,0-0-22-22,s=255,c=3,t=25,pt=1,l=1,sg=0,ft=0,st=OK:1 10813 TSF:MSG:READ,22-22-0,s=255,c=3,t=15,pt=6,l=2,sg=0:0101 10819 SGN:PRE:SGN REQ,FROM=22 10822 SGN:PRE:SGN NREQ,TO=22 10824 SGN:PRE:WHI NREQ,TO=22 10827 SGN:SKP:MSG CMD=3,TYPE=15 10834 TSF:MSG:SEND,0-0-22-22,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 10842 SGN:PRE:XMT,TO=22 10846 TSF:MSG:READ,22-22-0,s=255,c=0,t=17,pt=0,l=5,sg=0:2.3.0 10856 TSF:MSG:READ,22-22-0,s=255,c=3,t=6,pt=1,l=1,sg=0:0 12869 TSF:MSG:READ,22-22-0,s=255,c=3,t=11,pt=0,l=5,sg=0:Relay 12879 TSF:MSG:READ,22-22-0,s=255,c=3,t=12,pt=0,l=3,sg=0:2.0 12890 TSF:MSG:READ,22-22-0,s=1,c=0,t=3,pt=0,l=0,sg=0: 12901 TSF:MSG:READ,22-22-0,s=255,c=3,t=26,pt=1,l=1,sg=0:2 12906 SGN:SKP:MSG CMD=3,TYPE=16 12913 TSF:MSG:SEND,0-0-22-22,s=255,c=3,t=16,pt=0,l=0,sg=0,ft=0,st=OK: 12919 SGN:SGN:NCE REQ,TO=22 12940 TSF:MSG:READ,22-22-0,s=255,c=3,t=17,pt=6,l=25,sg=0:<NONCE> 12946 SGN:NCE:FROM=22 12948 SGN:BND:NONCE=B8E06B367486872EC1CE2CADBF969CAAE127BADED76DF0095DAAAAAAAAAAAAAA 13035 SGN:BND:HMAC=0699DD1F9CE2830EC9F09D858D8AB9627DDA55AFBE587C1115A95C962E0AFFF1 13043 SGN:SGN:SGN 13048 TSF:MSG:SEND,0-0-22-22,s=255,c=3,t=27,pt=1,l=1,sg=1,ft=0,st=OK:1
Here is my node 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 **** Dave Version 1 */ // Enable debug prints to serial monitor #define MY_DEBUG #define MY_DEBUG_VERBOSE_SIGNING // Enable and select radio type attached #define MY_RADIO_RF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 // Enable repeater functionality for this node //#define MY_REPEATER_FEATURE // Inverses the behavior of leds #define MY_WITH_LEDS_BLINKING_INVERSE // Flash leds on rx/tx/err // Uncomment to override default HW configurations #define MY_DEFAULT_ERR_LED_PIN 4 // Error led pin #define MY_DEFAULT_RX_LED_PIN 5 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 6 // the PCB, on board LED #define MY_NODE_ID 22 // Select soft/hardware signing method #define MY_SIGNING_SOFT //SOFTWARE BASED //#define MY_SIGNING_ATSHA204 //HARDWARE BASED #define MY_SIGNING_REQUEST_SIGNATURES //Hardware configuration for signing services #define MY_SIGNING_SOFT_RANDOMSEED_PIN 7 //#define MY_SIGNING_ATSHA204_PIN A3 #define MY_SIGNING_SIMPLE_PASSWD "MyEmmaBemma2015" #include <MyConfig.h> #include <MySensors.h> #include <SPI.h> #define RELAY_1 3 // Arduino Digital I/O pin number for first relay (second on pin+1 etc) #define NUMBER_OF_RELAYS 1// Total number of attached relays #define RELAY_ON 1 // GPIO value to write to turn on attached relay #define RELAY_OFF 0 // GPIO value to write to turn off attached relay void before() { for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) { // Then set relay pins in output mode pinMode(pin, OUTPUT); // Set relay to last known state (using eeprom storage) digitalWrite(pin, loadState(sensor)?RELAY_ON:RELAY_OFF); } } void setup() { } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("Relay", "2.0"); for (int sensor=1, pin=RELAY_1; sensor<=NUMBER_OF_RELAYS; sensor++, pin++) { // Register all sensors to gw (they will be created as child devices) present(sensor, S_BINARY); } } void loop() { } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if (message.type==V_STATUS) { // Change relay state digitalWrite(message.sensor-1+RELAY_1, message.getBool()?RELAY_ON:RELAY_OFF); // Store state in eeprom saveState(message.sensor, message.getBool()); // Write some debug info Serial.print("Incoming change for sensor:"); Serial.print(message.sensor); Serial.print(", New status: "); Serial.println(message.getBool()); } }
And this is the serial monitor output.
| \/ |_ _/ ___| ___ _ __ ___ ___ _ __ ___ | |\/| | | | \___ \ / _ \ `_ \/ __|/ _ \| `__/ __| | | | | |_| |___| | __/ | | \__ \ _ | | \__ \ |_| |_|\__, |____/ \___|_| |_|___/\___/|_| |___/ |___/ 2.3.0 16 MCO:BGN:INIT NODE,CP=RNNNAS--,VER=2.3.0 25 MCO:BGN:BFR 50 !SGN:PER:TAMPERED 86 SGN:INI:BND OK 87 TSM:INIT 88 TSF:WUR:MS=0 95 TSM:INIT:TSP OK 97 TSM:INIT:STATID=22 102 TSF:SID:OK,ID=22 104 TSM:FPAR 105 SGN:SGN:NREQ=255 142 TSF:MSG:SEND,22-22-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK: 954 TSF:MSG:READ,0-0-22,s=255,c=3,t=8,pt=1,l=1,sg=0:0 959 SGN:SKP:MSG CMD=3,TYPE=8 962 TSF:MSG:FPAR OK,ID=0,D=1 988 TSF:MSG:READ,6-6-22,s=255,c=3,t=8,pt=1,l=1,sg=0:1 992 SGN:SKP:MSG CMD=3,TYPE=8 1762 TSF:MSG:READ,1-1-22,s=255,c=3,t=8,pt=1,l=1,sg=0:1 1767 SGN:SKP:MSG CMD=3,TYPE=8 2150 TSM:FPAR:OK 2151 TSM:ID 2152 TSM:ID:OK 2154 TSM:UPL 2155 SGN:SGN:NREQ=0 2161 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 2176 TSF:MSG:READ,0-0-22,s=255,c=3,t=25,pt=1,l=1,sg=0:1 2181 SGN:SKP:MSG CMD=3,TYPE=25 2184 TSF:MSG:PONG RECV,HP=1 2187 TSM:UPL:OK 2188 TSM:READY:ID=22,PAR=0,DIS=1 2191 SGN:PRE:SGN REQ 2193 SGN:PRE:WHI NREQ 2195 SGN:SGN:NREQ=0 2198 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0101 2205 SGN:PRE:XMT,TO=0 2207 SGN:PRE:WAIT GW 2217 TSF:MSG:READ,0-0-22,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 2223 SGN:SKP:MSG CMD=3,TYPE=15 2226 SGN:SGN:NREQ=0 2230 TSF:MSG:SEND,22-22-0-0,s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=OK:2.3.0 2236 SGN:SGN:NREQ=0 2242 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=0,st=OK:0 4248 SGN:SGN:NREQ=0 4253 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=11,pt=0,l=5,sg=0,ft=0,st=OK:Relay 4260 SGN:SGN:NREQ=0 4264 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=OK:2.0 4271 SGN:SGN:NREQ=0 4277 TSF:MSG:SEND,22-22-0-0,s=1,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=OK: 4283 MCO:REG:REQ 4284 SGN:SGN:NREQ=0 4290 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 4297 TSF:MSG:READ,0-0-22,s=255,c=3,t=16,pt=0,l=0,sg=0: 4302 SGN:SKP:MSG CMD=3,TYPE=16 4320 SGN:SGN:NREQ=0 4327 TSF:MSG:SEND,22-22-0-0,s=255,c=3,t=17,pt=6,l=25,sg=0,ft=0,st=OK:<NONCE> 4334 SGN:NCE:XMT,TO=22 4468 TSF:MSG:READ,0-0-22,s=255,c=3,t=27,pt=1,l=1,sg=1:1 4473 !SGN:VER:STATE 4475 !TSF:MSG:SIGN VERIFY FAIL 4477 MCO:BGN:STP 4480 MCO:BGN:INIT OK,TSP=1
What am I missing here?
-
RE: MySensors 2.3.0 on Mega 2560 Ethernet Gateway
As promised this is my wiring and code, hope this help people out
First the wiring.
Radio - Mega Pin
+3V - NA
-3V - NA
CSN/CS(Yellow) - 6
CE(Orange) - 5
SCK(Green) - 14
MISO(White) - 15
MOSI(Blue) - 16
IRQ(Gray) - 2Switch - Mega
Left - RESET
Right - 3 (inclusion Button)LEDs - Mega
Red(Err) - 40
Orange(Rx) - 42
Green(Tx) - 44
All are grounded with 330 Ohm resistors.And here is my Sketch. One thing I had done when I was just getting lots of shutdowns and errors was to wipe the board - I uploaded blink and left it alone for a minute and then reloaded the gateway with the updated libraries and (knocking on wood) it seems to be stable.
/** * 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 // Enable and select radio type attached #define MY_RADIO_RF24 // 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 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,XXX // If using static ip you can define Gateway and Subnet address as well #define MY_IP_GATEWAY_ADDRESS 192,168,1,XXX #define MY_IP_SUBNET_ADDRESS 255,255,255,XXX // 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 // Set LOW transmit power level as default, if you have an amplified NRF-module and // power your radio separately with a good regulator you can turn up PA level. #define MY_RF24_PA_LEVEL RF24_PA_MAX // 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 90 // Digital pin used for inclusion mode button #define MY_INCLUSION_MODE_BUTTON_PIN 3 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Inverses the behavior of leds #define MY_WITH_LEDS_BLINKING_INVERSE // Flash leds on rx/tx/err // Uncomment to override default HW configurations #define MY_DEFAULT_ERR_LED_PIN 40 // Error led pin #define MY_DEFAULT_RX_LED_PIN 42 // Receive led pin #define MY_DEFAULT_TX_LED_PIN 44 // Transmit led pin #if defined(MY_USE_UDP) #include <EthernetUdp.h> #endif #define MY_SIGNING_SOFT #define MY_SIGNING_SOFT_RANDOMSEED_PIN 23 #define MY_SIGNING_WEAK_SECURITY #include <Ethernet.h> #include <MyConfig.h> #include <MySensors.h> void setup() { // Setup locally attached sensors } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }```
-
RE: MySensors 2.3.0 on Mega 2560 Ethernet Gateway
@scalz It was the big chip on the board heating up. I had thought that too so I swapped the mega out last night(had to wait until Amazon delivered it). It got warm (100ish Degrees) but not as hot as the other one did. But I tried to power the gateway as I had originally and the problems started right up again. So Im going with the issue was power related. Im going to keep the fan because a little extra cooling isn't going to hurt anything.
-
MySensors 2.3.0 on Mega 2560 Ethernet Gateway
All
A little while ago I had upgraded to MySensors 2.3.0 with horrible results....my 18 node network went kablooey. I couldn't get anything stable to save my own life. I was getting 30-90 minutes of runtime on the gateway before it was shutting down and going off line. I of course did this at the exact same time I was rebuilding my gateway, transitioning to the Mega 2560 from thr UNO 328 due to memory and lag issues. To top it all off I am running an NRF24 LNA/PNA radio at MAX because of distance and placement issues.What I have found was needed to stabilize the gateway.....POWER POWER POWER! It became the Achilles heel of my project. I was initially feeding into the radio then sending power to the Mega via its VCC input (this was ok for the UNO). Voltage going over was good, current wasn't and the gateway would shutdown no matter what the radio power settings were of which radio chip I used. So I switched to a 12v 2.5A power supply and wyed it one connection to the radio board (which has its own voltage regulator) and the other to the Mega's DC jack. Second issue I noted was heat - the Mega runs hotter than the UNO did. I had 130 degrees Fahrenheit on the processor chip. I solved that with a heat sink I had from a raspberry pi and adding a small fan fed from the Mega's 5v pin placed at the back of the Mega. Since that, chip is a cool 80 degrees. I suspect since Im using the Ethernet shield that played a big role in the Mega heating up and the fan really helped.
The Fan is seen to the immediate left of the LAN jack.
The toggle switch serves 2 functions...when pushed to the right it resets the gateway, to the left enables inclusion mode. The three LEDs are TX/RX/ERR.Hope this helps folks. I will add my wiring and code when I get a chance.
Heres the gateway mounted in my Ubuntu box, which runs my home media server and OpenHab.
Happy Building and THANK YOU to everyone who has posted ideas and code snipets that made this possible.
-
RE: Arduino Mega 2560 Ethernet Gateway - Cant get it going.
I hadn't seen that, as it appears it was posted after I had written my post.
I had changed the CE/CSN pins based on the tutorial written on the Site and numerous other posters had states they had to make those changes to get the Mega and W5100 Shiled to work.I will give this a try and see what happens.
Thanks you for the point in this directions.....Y'All rock
DB
-
RE: How to build up a sensor network
Wow thats quite the project.....Im a pretty new guy here also. I tried something similar with my nano(and then uno) gateway and adding some sensors to it....I eventually abandoned it because it was just causing a log jam of data through the gateway and controller(I use OpenHAB), also if the sensor malfunctioned it took down the gateway on several occassions
My reccommendation is to set up a controller and gateway as standalone devices and then tie sensors and actuators in from there. Ive also found that it makes troubleshooting issues because the system is more modular.
Just my advice,, Wish you lots of luck and hope its as good and experience for you as its been for me.
-
Arduino Mega 2560 Ethernet Gateway - Cant get it going.
Hello all
I am in the process of moving my gateway over to an Arduino Mega 2560 R3.....presently it is running on an UNO R3 but that is my template device and I kinda want it back for that. Im using a W5100 Ethernet Shield, found here
My base gateway code comes from this post.
And my wiring is; (power is just off the Mega for testing only)
NRF - MEGA
Vcc - 3.3V
Gnd - Gnd
CE - 49 with change made in code
CSN - 53 with change made in code
SCK - 52
MOSI - 51
MISO - 50/** * 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 received. In inclusion mode will blink fast only on presentation received * - TX (yellow) - blink fast on radio message transmitted. In inclusion mode will blink slowly * - ERR (red) - fast blink on error during transmission error or receive crc error * * See http://www.mysensors.org/build/ethernet_gateway for wiring instructions. * */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_NRF5_ESB //#define MY_RADIO_RFM69 //#define MY_RADIO_RFM95 // 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 49 #endif #ifndef MY_RF24_CS_PIN #define MY_RF24_CS_PIN 53 #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,178,66 // 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 Arduino 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() { // Setup locally attached sensors } void presentation() { // Present locally attached sensors here } void loop() { // Send locally attached sensors data here }``` But no matter what I do I get the following error. Ive read through every post I can find here and nothing seems to get me going.
0 MCO:BGN:INIT GW,CP=RNNGA---,VER=2.3.0
3 TSM:INIT
4 TSF:WUR:MS=0
11 !TSM:INIT:TSP FAIL
12 TSM:FAIL:CNT=1
14 TSM:FAIL:DIS
15 TSF:TDI:TSL```Any ideas? If I load any other gateway sketch it fires up without a problem.
Thanks a bunch.
Dave -
RE: sha204 library questions
Thats the example I used.```
/*- 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.
/
#include <sha204_library.h>
#include <sha204_lib_return_codes.h>
#define MY_CORE_ONLY
#include <MySensors.h>
/*********************************** User defined key data ***************************************/But Im still getting this error.
#include "sha204_includes/sha204_lib_return_codes.h" ^ compilation terminated. exit status 1 Error compiling for board Arduino/Genuino Uno.
Im at a total loss. The return_codes is located in a separate folder in the libraries file - SRC (which has the main sha204_library.h file), under the SRC folder is a folder titled "includes" which has the 'return_codes.h' file. Any attempt to place it in the #include decleration results in this error.
Dave -
sha204 library questions
Hello all.
Im a little confused here, what can I say Im a hardware, oscilloscope, soldering iron kinda guy so code is still a bit confusing to me. Im trying to set up the security personalizer ino and keep hitting a small wall.
The code calls for the following;
#include "sha204_library.h" #include "sha204_lib_return_codes.h"
Except in all my searching Im only finding 'sha204_library.h', all of the branches and files I can get say "sha204_lib_return_codes.h is included".
Does this mean I only need to include the main sha204_library and not include the 'return_codes' portion separately? If I use the main library the code compiles without issues, if I'm trying to include the 'return_codes' portion it gets flagged.
Id appreciate any thoughts.
Dave -
Trying to get a dual mode sleep going.
Hello Everyone
Im trying to get a dual sleep code going. My project is a monitor for my detached shed. It will be powered by either a 12 or 9 volt battery and the radio will have to be the higher powered NRF24 LNA/PNA (Its a good 200 yards from the house).
I've managed to get the node base code working fine....reports the doors open/closed, sends back temp/humidity/battery percent.......but only when the door are opened or closed, which as you can imagine I don't sped a ton of time in the shed so its not that often.What I want to do is have the sensor wake under 2 conditions.....1 every hour or two to send temp/humidity and battery data back, and 2 when the doors are opened or closed (the kids have a habit of leaving the door open after getting their bikes).
I could use a little help.
/* * MySensors Custom Door/Window Sensor, with temperature sensor * and battery level reporting Version 2.2 * * D.B******* 7/13/2018 * * Version 1 - Initial concept code * Version 2 - adds Temp/humidity/ and battery monintoring * * The Mysensors libraries will handle all the radio protocols * and create the network. * * DO NOT USE REPEATER MODE if this is battery powered * * Connect one button or door/window reed switch between * digital I/O pin 3 (BUTTON_PIN below) and GND and the other * one in similar fashion on digital I/O pin 2. * This example is designed to fit Arduino Nano/Pro Mini */ //Enble serial monitoring #define MY_DEBUG //Enable radio (Im using NRLF24A) #define MY_RADIO_NRF24 // Set blinking period #define MY_DEFAULT_LED_BLINK_PERIOD 300 // Inverses the behavior of leds #define MY_WITH_LEDS_BLINKING_INVERSE // Flash leds on rx/tx/err // Uncomment to override default HW configurations #define MY_DEFAULT_TX_LED_PIN 6 // tramsmit led pin #include <MyConfig.h> #include <MySensors.h> #include <DHT.h> #include <DHT_U.h> #define SKETCH_NAME "Shed Monitoring Sensor" #define SKETCH_VERSION "2.0" #define CHILD_ID_BATTERY 1 #define CHILD_ID_HUMIDITY 2 #define CHILD_ID_SENSOR1 3 #define CHILD_ID_SENSOR2 4 #define CHILD_ID_TEMPF 5 #define CHILD_ID_TEMPC 6 #define SENSOR1_PIN 2 //digital pin to connect sensors to. #define SENSOR2_PIN 3 #define BATTERY_SENSE_PIN A0 // select the input pin for the battery sense point #define DHT_PIN 4 //digital pin for the DHT sensor #define DHTTYPE 11 #define SENSOR_TEMP_OFFSET 0 //allows for small corrections to sensor innacuracies unsigned long SLEEP_TIME = 300000; //600000 = 10 min, 300000 = 5 min - Sleep time in MilliSeconds // Sleep time between sensor updates (in milliseconds) // Must be >1000ms for DHT22 and >2000ms for DHT11 static const uint64_t UPDATE_INTERVAL = 2100; // 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; float lastTempF; //stores farenheit float lastTempC; float lastHum; uint8_t nNoUpdatesTempF; uint8_t nNoUpdatesHum; uint8_t nNoUpdatesTempC; #if (SENSOR1_PIN < 2 || SENSOR1_PIN > 3) #error SENSOR1_PIN must be either 2 or 3 for interrupts to work #endif #if (SENSOR2_PIN < 2 || SENSOR2_PIN > 3) #error SENSOR2_PIN must be either 2 or 3 for interrupts to work #endif #if (SENSOR1_PIN == SENSOR2_PIN) #error SENSOR1_PIN and SENSOR2_PIN2 cannot be the same #endif #if (CHILD_ID_SENSOR1 == CHILD_ID_SENSOR2) #error CHILD_ID_SENSOR1 and CHILD_ID_SENSOR2 cannot be the same #endif MyMessage msgBatt(CHILD_ID_BATTERY, V_VAR1); MyMessage msgHum(CHILD_ID_HUMIDITY, V_HUM); MyMessage msgSensor1(CHILD_ID_SENSOR1, V_TRIPPED); MyMessage msgSensor2(CHILD_ID_SENSOR2, V_TRIPPED); MyMessage msgTempF(CHILD_ID_TEMPF, V_TEMP); MyMessage msgTempC(CHILD_ID_TEMPC, V_TEMP); int oldBatteryPcnt = 0; //sets initial battery precentage to 0 DHT dht(DHT_PIN, DHTTYPE); void setup() { dht.begin(); batteryReference(); pinMode(SENSOR1_PIN, INPUT_PULLUP); pinMode(SENSOR2_PIN, INPUT_PULLUP); } void batteryReference(){ // use the 1.1 V internal reference #if defined(__AVR_ATmega2560__) analogReference(INTERNAL1V1); #else analogReference(INTERNAL); #endif } void presentation(){ sendSketchInfo(SKETCH_NAME, SKETCH_VERSION); present(CHILD_ID_BATTERY, S_CUSTOM); present(CHILD_ID_HUMIDITY, S_HUM); present(CHILD_ID_SENSOR1, S_DOOR); present(CHILD_ID_SENSOR2, S_DOOR); present(CHILD_ID_TEMPF, S_TEMP); present(CHILD_ID_TEMPC, S_TEMP); } void loop() { uint8_t value; static uint8_t sentValue=2; static uint8_t sentValue2=2; // Short delay to allow buttons to properly settle sleep(5); value = digitalRead(SENSOR1_PIN); if (value != sentValue) { // Value has changed from last transmission, send the updated value send(msgSensor1.set(value==HIGH)); sentValue = value; } value = digitalRead(SENSOR2_PIN); if (value != sentValue2) { // Value has changed from last transmission, send the updated value send(msgSensor2.set(value==HIGH)); sentValue2 = value; } float temperaturef = dht.readTemperature(true); float temperaturec = dht.readTemperature(false); float humidity = dht.readHumidity(); if (isnan(temperaturef)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperaturef != lastTempF || nNoUpdatesTempF == 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 lastTempF = temperaturef; nNoUpdatesTempF = 0; temperaturef += SENSOR_TEMP_OFFSET; send(msgTempF.set(temperaturef, 1)); #ifdef MY_DEBUG Serial.print("Temp F: "); Serial.println(temperaturef); #endif } else { nNoUpdatesTempF++; } if (isnan(temperaturec)) { Serial.println("Failed reading temperature from DHT!"); } else if (temperaturec != lastTempC || nNoUpdatesTempC == 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 lastTempC = temperaturec; nNoUpdatesTempC = 0; temperaturec += SENSOR_TEMP_OFFSET; send(msgTempC.set(temperaturec, 1)); #ifdef MY_DEBUG Serial.print("Temp C: "); Serial.println(temperaturec); #endif } else { nNoUpdatesTempC++; } 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("Humidity: "); Serial.println(humidity); #endif } else { // Increase no update counter if the humidity stayed the same nNoUpdatesHum++; } int sensorValue = analogRead(BATTERY_SENSE_PIN); Serial.println(sensorValue); // 1M, 470K divider across battery and using internal ADC ref of 1.1V // Sense point is bypassed with 0.1 uF cap to reduce noise at that point // ((1e6+470e3)/470e3)*1.1 = Vmax = 3.44 Volts // 3.44/1023 = Volts per bit = 0.003363075 // vout = (sensorvalue x 3.3) / 1023 //vin = vout / (R2/(R1+R2)); float batteryV = ( sensorValue * 0.003225806 ) / 0.3; // divide R2/(R1+R2) int batteryPcnt = sensorValue / 10 ; if ( batteryPcnt > 100 ) batteryPcnt = 100; Serial.print("Battery Voltage: "); Serial.print(batteryV); Serial.println(" V"); Serial.print("Battery percent: "); Serial.print(batteryPcnt); Serial.println(" %"); if (oldBatteryPcnt != batteryPcnt) { // Power up radio after sleep send(msgBatt.set(batteryPcnt)); oldBatteryPcnt = batteryPcnt; } // Sleep until something happens with the sensor sleep(SENSOR1_PIN-2, CHANGE, SENSOR2_PIN-2, CHANGE, 0); }
Ive tried adding the SLEEP_TIME into the sleep line, but when I put in in the door monitor becomes unresponsive.
-
RE: Serial gateway issues - Ubuntu 16
Ok I have made some progress. I have a gateway showing up as online and it is discovering nodes...but after a while it all goes 'offline' and Im stuck rebooting the entire box.
The UNO is registering with Ubuntu, it shows up as /dev/ttyACM0 (Arduino/Genuino Uno).
The initial error message (I lost the copy of it) basically said it was "unable to open the serial port /dev/ttyACM0"
What I did to get the gateway to come online.
I added the following item in Openhab2.
String UnoGateway { serial="/dev/ttyACM0@115200" }Then I added the following to the /etc/defaults/openhab2 file.
######################### ## JAVA OPTIONS ## Additional options for the JAVA_OPTS environment variable. ## These will be appended to the execution of the openHAB Java runtime in front of a$ ## ## A couple of independent examples: ## EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyAMA0" ## EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyUSB0:/dev/ttyS0:/dev/ttyS2:/$ ## EXTRA_JAVA_OPTS="-Djna.library.path=/lib/arm-linux-gnueabihf/ -Duser.timezone=E$ EXTRA_JAVA_OPTS="-Dgnu.io.rxtx.SerialPorts=/dev/ttyACM0"
I also added that line to the karaf runtime file.
But I have no idea now why it keeps going offline.
-
Serial gateway issues - Ubuntu 16
Greetings All.
I have hit a wall here. I am setting up openhab2 on my Ubuntu box. Im running Ubuntu 16.04 LTS, with Openhab 2 stable release installed.I can get every other thing configured and running smoothly EXCEPT for this serial gateway.
My gateway is an Arduino Uno, flashed with the lastest stable MySensors library and serial gateway sketch. When its connected to the box via USB it comes up as /dev/ttyAMC0, and Im able to see it running via serial monitors. But when I go into openhab to add it the gateway still shows up as offline. I've already added openhab to 'dialout' and 'tty' groups and made the java exceptions changes and enabled the serial transport via karaf console as noted in the installation instructions.
The only thing the logs are producing is a generic "unable to connect to serial port tty/ACM0 message.
Im at a total loss here as Im a hardware guy, not really a software guy.
-
Serial Gateway not coming online
Greetings All.
I have hit a wall here. I am setting up openhab2 on my Ubuntu box. Im running Ubuntu 16.04 LTS, with Openhab 2 stable release installed.I can get every other thing configured and running smoothly EXCEPT for this serial gateway.
My gateway is an Arduino Uno, flashed with the lastest stable MySensors library and serial gateway sketch. When its connected to the box via USB it comes up as /dev/ttyAMC0, and Im able to see it running via serial monitors. But when I go into openhab to add it the gateway still shows up as offline. I've already added openhab to 'dialout' and 'tty' groups and made the java exceptions changes and enabled the serial transport via karaf console as noted in the installation instructions.
The only thing the logs are producing is a generic "unable to connect to serial port tty/ACM0 message.
Im at a total loss here.