Skip to content

Troubleshooting

Help! Everything just falls apart
2.7k Topics 21.5k Posts
  • Vera MySensors plugin : Cannot send command - communications error

    10
    3
    0 Votes
    10 Posts
    3k Views
    BulldogLowellB
    @korttoma I'm using MySensors 2.0.0, which was the default when I downloaded using the Arduino IDE's library manager. I'll probably linger here a while until i learn all of the MySensors abstractions. It is nice and easy now. I'm using Arduino 1.8.2, which is almost C++ 11. I really like the latest version, I'll just keep using the AVR Boards 1.6.11 for my MySensors projects. @peterjackson set me straight, and all is working well. I'm up and running with all of the MySensors nodes I've built. It is a drag updating some of my devices; many were not built for easy access to the USB serial connectors. I have only myself to blame for that. I'd been working mainly with WiFi devices lately, but they get expensive if all you want is basic functionality, the MySensors backbone is perfect. Built any cool projects lately?
  • Temperature sensor issu ( Maybe something with 2.0 vs 2.1.1 library)

    2
    0 Votes
    2 Posts
    984 Views
    dbemowskD
    @Dominic-Bonneau In 2.0 it was just called getConfig. Change this float temperature = static_cast<float>(static_cast<int>((getControllerConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.; to this float temperature = static_cast<float>(static_cast<int>((getConfig().isMetric?sensors.getTempCByIndex(i):sensors.getTempFByIndex(i)) * 10.)) / 10.; and you shouldn't get that error. Can't say for sure you wont get others though.
  • Debugging the debugging output...

    3
    0 Votes
    3 Posts
    863 Views
    Bogus ExceptionB
    @mfalkvidd Sorry for not being smart enough to know that. I read the how to post, and have a list of barely acceptable excuses as to why I didn't figure that out prepared-in case you're interested! :) Also, I unzipped a backup's script.sql, and it showed me all the possibilities: [...] (58, 'S_HVAC', 'V_HVAC_SPEED'), (59, 'S_MULTIMETER', 'V_VOLTAGE'), (60, 'S_MULTIMETER', 'V_CURRENT'), (61, 'S_MULTIMETER', 'V_IMPEDANCE'), (62, 'S_SPRINKLER', 'V_STATUS'), [...]
  • Can't detect Interrupt on Arduino Mini Pro or can't wake MySensor ?

    5
    0 Votes
    5 Posts
    1k Views
    ghislainG
    This is my change and it is working, thank you for your help. /** * 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. * ******************************* * * DESCRIPTION * * Simple binary switch example * Connect button or door/window reed switch between * digitial I/O pin 3 (BUTTON_PIN below) and GND. * http://www.mysensors.org/build/binary */ // Enable debug prints to serial monitor //#define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 #define MY_RF24_PA_LEVEL RF24_PA_LOW #define MY_NODE_ID 8 #include <SPI.h> #include <MySensors.h> #include <Vcc.h> #define CHILD_ID_MAIL 0 #define CHILD_ID_MAIL2 1 #define CHILD_ID_VOLT 2 // Child id for battery reading #define BUTTON_PIN 2 // Arduino Digital I/O pin for button/reed switch #define BUTTON2_PIN 3 // Arduino Digital I/O pin for button/reed switch #define SLEEP_TIME 1 * 60 * 1000UL int oldValueC1=-1; int oldValueC2=-1; boolean gwSend = true; const float VccMin = 3; // Minimum expected Vcc level, in Volts. const float VccMax = 4; // Maximum expected Vcc level, in Volts. const float VccCorrection = 1.0/1.0; // Measured Vcc by multimeter divided by reported Vcc float batteryV = 0; int batteryPcnt = 0; Vcc vcc(VccCorrection); // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msgMail(CHILD_ID_MAIL,V_TRIPPED); MyMessage msgMail2(CHILD_ID_MAIL2,V_TRIPPED); MyMessage msgVolt(CHILD_ID_VOLT, V_VOLTAGE); void setup() { // Setup the button pinMode(BUTTON_PIN, INPUT); pinMode(BUTTON2_PIN, INPUT); // Activate internal pull-up digitalWrite(BUTTON_PIN,HIGH); digitalWrite(BUTTON2_PIN,HIGH); #ifdef MY_DEBUG Serial.begin(115200); #endif } void presentation() { // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. sendSketchInfo("BAL", "1.0"); present(CHILD_ID_MAIL, S_DOOR); present(CHILD_ID_MAIL2, S_DOOR); present(CHILD_ID_VOLT, S_MULTIMETER); } // Check if digital input has changed and send in new value void loop() { wait(100); // Get the update value uint8_t volet = digitalRead(BUTTON_PIN); uint8_t porte = digitalRead(BUTTON2_PIN); #ifdef MY_DEBUG Serial.println(volet); Serial.println(porte); #endif if (volet != oldValueC1) { // Send in the new value gwSend = true; #ifdef MY_DEBUG Serial.println(volet); #endif oldValueC1 = volet; } if (porte != oldValueC2) { // Send in the new value gwSend = true; #ifdef MY_DEBUG Serial.println(porte); #endif oldValueC2 = porte; } batteryV = vcc.Read_Volts(); batteryPcnt = vcc.Read_Perc(VccMin, VccMax); send(msgVolt.set(batteryV, 2)); sendBatteryLevel(batteryPcnt); #ifdef MY_DEBUG //delay(2000); Serial.println(batteryPcnt); #endif if (gwSend == true) { send(msgMail.set(volet==LOW ? 1 : 0)); send(msgMail2.set(porte==LOW ? 1 : 0)); send(msgVolt.set(batteryV, 2)); sendBatteryLevel(batteryPcnt); gwSend = false; } else { } sleep(0, FALLING, 1, FALLING, SLEEP_TIME); }
  • Combining code together. Nightmare bug

    2
    0 Votes
    2 Posts
    619 Views
    M
    Well guess it was a bug. Removed some of the include libs. Deleted serial output and ... it worked. Now one more thing to solve but i guess that's another story
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    19 Views
    No one has replied
  • Simple binary switch example, trying to add second switch

    5
    0 Votes
    5 Posts
    2k Views
    Mitja BlazinsekM
    thank you very much boots33 and mfalkvidd finaly wor also learn a lot on this example, its time now to try with relays i will add 2 relays that i can triger with switch or controler my working code for switch: /** 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. ******************************* DESCRIPTION Simple binary switch example updated for 2 switches Connect button or door/window reed switch between digitial I/O pin 3 (BUTTON_PIN below) and GND. http://www.mysensors.org/build/binary */ // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #include <SPI.h> #include <MySensors.h> #include <Bounce2.h> #define CHILD_ID_ST1 3 #define CHILD_ID_ST2 4 #define ST1_PIN 3 // Arduino Digital I/O pin for button/reed switch #define ST2_PIN 4 Bounce debouncer1 = Bounce(); Bounce debouncer2 = Bounce(); int oldValue = -1; int oldValue1 = -1; // Change to V_LIGHT if you use S_LIGHT in presentation below MyMessage msgst1(CHILD_ID_ST1, V_TRIPPED); MyMessage msgst2(CHILD_ID_ST2, V_TRIPPED); void setup() { // Setup the button1 pinMode(ST1_PIN, INPUT); debouncer1.attach(ST1_PIN); debouncer1.interval(5); digitalWrite(ST1_PIN, HIGH); // Setup the button2 pinMode(ST2_PIN, INPUT); debouncer2.attach(ST2_PIN); debouncer2.interval(5); digitalWrite(ST2_PIN, HIGH); } void presentation() { // Register binary input sensor to gw (they will be created as child devices) // You can use S_DOOR, S_MOTION or S_LIGHT here depending on your usage. // If S_LIGHT is used, remember to update variable type you send in. See "msg" above. present(CHILD_ID_ST1, S_DOOR); present(CHILD_ID_ST2, S_DOOR); } // Check if digital input has changed and send in new value void loop() { debouncer1.update(); // Get the update value int value = debouncer1.read(); if (value != oldValue) { // Send in the new value send(msgst1.set(value == HIGH ? 1 : 0)); oldValue = value; } debouncer2.update(); // Get the update value int value1 = debouncer2.read(); if (value1 != oldValue1) { // Send in the new value send(msgst2.set(value1 == HIGH ? 1 : 0)); oldValue1 = value1; } }
  • MQTT - RFM69 Gateway stops communicating randomly and doesn't recover

    14
    1 Votes
    14 Posts
    3k Views
    CarywinC
    @gieemek Glad to hear it's working. I don't think SoftSPI needs to be atomic in its transactions the same way hardSPI does, so you're probably not missing anything important.
  • Sesnsor Door and Relay

    3
    0 Votes
    3 Posts
    1k Views
    dbemowskD
    Not sure if this will help, but some time back I built a motion sensor setup to control a flood light for my driveway. The node has a lux/LDR sensor for light/dark, relay and a motion sensor. The idea with that node was that the light would turn on if motion was detected and if it was dark enough. You mat be able to go through the code and take out the motion sensor parts and just use the light sensor and relay code. Here was my writeup on the project. https://forum.mysensors.org/topic/5243/driveway-motion-light
  • Odd Readings From HTU21D

    1
    0 Votes
    1 Posts
    478 Views
    No one has replied
  • Ping Pong with ESP8266 results in !TSM:FPAR:NO REPLY [solved]

    29
    0 Votes
    29 Posts
    6k Views
    O
    @mpp said in Ping Pong with ESP8266 results in !TSM:FPAR:NO REPLY [solved]: So now the node is sending data but there's no ack/Invalid message length.. @gohan they're all HW, yes. I tested with single wire and coil antenna's. Atm I'm testing with authentic Moteino's with single wire. They all result in !TSM:FPAR:FAIL. Any progress on this front? I got the exact same things as the log you posted; loads of NACK's. Checked/replaced radios, antennes and caps ..
  • Help with sketch (motion/distance)

    9
    0 Votes
    9 Posts
    2k Views
    Cliff KarlssonC
    I never understod how the millis() -part worked so I just changed it to a simple countdown instead.
  • Connecting external power and FTDI adapter?

    3
    0 Votes
    3 Posts
    2k Views
    NeverDieN
    Or use a level shifter.
  • first battery powered DHT lux

    10
    0 Votes
    10 Posts
    2k Views
    markjgabbM
    @sundberg84 nah just prrof of build at the moment...ill fix them with my proper node ID's when it's build time....waiting on step up's at the moment..... they seem to take a while when you find them cheaper
  • Combine airquality, temperature code and send to the ethernet gateway

    9
    0 Votes
    9 Posts
    2k Views
    gohanG
    For alarm you need to create a rule in Openhab that when value goes over a certain value it sets of the alarm
  • mysensor error-handling missing ?

    error-handling error freeze
    6
    0 Votes
    6 Posts
    1k Views
    ArthurA
    "#define MY_TRANSPORT_WAIT_READY_MS 100" worked indeed ! An error-handling is better but this is already nice, my prototype is running now with and without Mysensor-gateway active. I will look at the error led option too, Thanks !! ;-) Arthur
  • 0 Votes
    21 Posts
    5k Views
    gohanG
    The RPI becomes an ethernet gateway.
  • Get date from Domoticz into Node

    2
    0 Votes
    2 Posts
    702 Views
    L
    Request is the way to go as far as i know. You also need to implement the method handling incoming messages though to work with the answer. There are some threads about requesting values from domoticz in this forum. (Haven't read them) but imo there are some values that can't be requested from domotizc so better check that and maybe change the variable type.
  • Binary switch code written for 1.5.4

    5
    0 Votes
    5 Posts
    1k Views
    ihtgtwtdI
    No, of course not. Here you go, have fun everyone :-) #define MY_DEBUG #define MY_RADIO_NRF24 #include <MySensors.h> #include <SPI.h> #include <Bounce2.h> #define SKETCH_NAME "Binary Sensor" #define SKETCH_MAJOR_VER "1" #define SKETCH_MINOR_VER "0" #define first_CHILD_ID 0 #define second_CHILD_ID 1 #define third_CHILD_ID 2 #define fourth_CHILD_ID 3 #define fifth_CHILD_ID 4 #define sixth_CHILD_ID 5 #define NUMBER_OF_SWITCHES 6 Bounce debouncer[NUMBER_OF_SWITCHES]; int oldValue[NUMBER_OF_SWITCHES]; byte switchPin[NUMBER_OF_SWITCHES] = {3,4,5,6,7,8}; //<<<<<<<<<<< set your switch pins here MyMessage msg(0,V_STATUS); void setup() { for (int i = 0; i < NUMBER_OF_SWITCHES; i++) { pinMode(switchPin[i],INPUT_PULLUP); debouncer[i] = Bounce(); debouncer[i].attach(switchPin[i]); debouncer[i].interval(5); } for (int i = 0; i < NUMBER_OF_SWITCHES; i++) { present(i, S_BINARY); delay(250); } } // void loop() { for (int i = 0; i < NUMBER_OF_SWITCHES; i++) { debouncer[i].update(); int value = debouncer[i].read(); if (value != oldValue[i]) { send(msg.setSensor(i).set(value == HIGH? true : false), false); } oldValue[i] = value; } }
  • Test time with TimeAwareSensor sketch

    6
    0 Votes
    6 Posts
    1k Views
    mfalkviddM
    @Fl0rian exactly. To do that you would need a rtc, or use smartsleep, depending on your use case.

14

Online

11.7k

Users

11.2k

Topics

113.1k

Posts