Skip to content

Troubleshooting

Help! Everything just falls apart
2.7k Topics 21.5k Posts
  • [SOLVED] Combine sketches for Relay + status (RGB)LED

    4
    0 Votes
    4 Posts
    1k Views
    Boots33B
    Great! Glad it worked for you
  • 0 Votes
    12 Posts
    5k Views
    Nca78N
    @TheoL it is. When you define a radio, it defines MY_RADIO_FEATURE // Enable radio "feature" if one of the radio types was enabled #if defined(MY_RADIO_NRF24) || defined(MY_RADIO_RFM69) || defined(MY_RS485) #define MY_RADIO_FEATURE #endif Same thing when you define a gateway : #if defined(MY_GATEWAY_SERIAL) || defined(MY_GATEWAY_W5100) || defined(MY_GATEWAY_ENC28J60) || defined(MY_GATEWAY_ESP8266) || defined(MY_GATEWAY_MQTT_CLIENT) #define MY_GATEWAY_FEATURE Then at the end if MY_RADIO_FEATURE and MY_GATEWAY_FEATURE are not defined it generates this compilation error #if !defined(MY_GATEWAY_FEATURE) && !defined(MY_RADIO_FEATURE) #error No forward link or gateway feature activated. This means nowhere to send messages! Pretty pointless. #endif
  • Burn bootloader while NRF24L01 is connected

    11
    0 Votes
    11 Posts
    2k Views
    F
    I am using IDE 1.6.8
  • Sleep walk?

    3
    0 Votes
    3 Posts
    697 Views
    bjacobseB
    @Danhiel said: BinarySwitchSleepSensor.ino If the sleep you mention, is the one to let your buttons settle as the code in this example, line100. then it's "just" to let your buttons settle, to handle the contact/switch bounce // Short delay to allow buttons to properly settle sleep(5); https://github.com/mysensors/MySensors/blob/development/examples/BinarySwitchSleepSensor/BinarySwitchSleepSensor.ino
  • Mqtt and openhab

    4
    0 Votes
    4 Posts
    881 Views
    TheoLT
    @Dominic-Bonneau Have a look at this thread https://forum.mysensors.org/topic/4415/my-final-setup-to-get-mysensors-and-openhab-communicating-via-mqtt it might provide you with the answers you seek.
  • How to determine from which Node a message is comming from

    3
    0 Votes
    3 Posts
    1k Views
    TheoLT
    @mfalkvidd Thanx for the quick reply and the example. It's exactly what I was I was looking for. I just overlooked the union definition in Message.h. I'm currently sending the message to the Node itself as a test. But event that that works.
  • Trying my first temperature sketch

    2
    0 Votes
    2 Posts
    821 Views
    raptorjrR
    I found the link to the updated 2.0 sketch and even though I still have problems, this is not one of them anymore =) https://github.com/mysensors/MySensorsArduinoExamples
  • Looking for a Gas Usage Monitor Sketch

    1
    0 Votes
    1 Posts
    501 Views
    No one has replied
  • Trying to convert a rain sensor sketch. get a fail error

    1
    0 Votes
    1 Posts
    560 Views
    No one has replied
  • How to change sender, command, msg type, payload type, ... ?

    8
    0 Votes
    8 Posts
    3k Views
    mfalkviddM
    @npkhoi thanks for e plaining. Then it should be sufficient to replace send(msg.set((int16_t)ceil(valMQ))); with send(msg.set(random()));
  • 2 Pushbuttons with sleep, lots of st=fail

    18
    0 Votes
    18 Posts
    4k Views
    CrankyCoderC
    Just finished switching them out with 100's. MUCH better. Still having a fail on startup. looks like it's when it's sending the framework version TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=ok:0100 !TSP:MSG:SEND 1-1-0-0 s=255,c=0,t=17,pt=0,l=5,sg=0,ft=0,st=fail:2.0.0 TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=ok:0 TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=11,pt=0,l=10,sg=0,ft=0,st=ok:WallSwitch TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=12,pt=0,l=3,sg=0,ft=0,st=ok:1.1 TSP:MSG:SEND 1-1-0-0 s=1,c=0,t=3,pt=0,l=0,sg=0,ft=0,st=ok: Request registration... TSP:MSG:SEND 1-1-0-0 s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=ok:2 TSP:MSG:READ 0-0-1 s=255,c=3,t=27,pt=1,l=1,sg=0:1 Node registration=1 Init complete, id=1, parent=0, distance=1, registration=1 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:0 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:0 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:0 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:0 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:1 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:1 TSP:MSG:SEND 1-1-0-0 s=1,c=1,t=2,pt=2,l=2,sg=0,ft=0,st=ok:1 TSP:MSG:READ 0-0-1 s=1,c=1,t=2,pt=2,l=2,sg=0:1 Connected much faster and 3 presses of both buttons all succeeded.
  • Arduino Nano and NRF24L01+PA+LNA

    12
    0 Votes
    12 Posts
    5k Views
    Boots33B
    Yes it is hard to find a data sheet on, most suppliers seem to quote around 115mA but I would allow a bit more just in case.
  • VeraEdge & serial gateway

    1
    1 Votes
    1 Posts
    571 Views
    No one has replied
  • two arduino, two avrdude error ..

    10
    0 Votes
    10 Posts
    3k Views
    Dominic BonneauD
    OMG I think I found my problem .... Is it possible to put code into Arduino mini pro with this : https://cdn-shop.adafruit.com/1200x900/954-02.jpg Because I check tuto on the web and they all use this : https://abra-electronics.com/images/thumbnails/280/217/detailed/134/ARD-FTDI-F(1).jpg Thanks
  • Help with Switch/Case/Break statement

    11
    0 Votes
    11 Posts
    3k Views
    D
    @tbowmo Thanks for the help. I see now where I was going wrong. I have everything working as expected. The only thing I needed to do was add some special commands to the message statement. For some reason, the relay would not turn off when the water low level was reached; used this below as a counter for now. Thanks again. /** * 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 * * DESCRIPTION * Automated Sump-Pump for De-Humidifier * * PURPOSE: * To automatically when water is at a pre-set level, have small * sump pump engage and empty water until it hits the desired * level. Uses the NewPING Library with Ultrasonic Sensor HC-SR04 * */ // Enable debug prints #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 #define MY_NODE_ID 22 //or comment out for automatic // #define MY_REPEATER_FEATURE // Enabled repeater feature for this node #include <SPI.h> #include <MySensors.h> #include <NewPing.h> #define RELAY_PIN 3 // To control the sump pump, define relay pin here. #define TRIGGER_PIN 4 //HC-SR04 Trgger Pin (Transmit) #define ECHO_PIN 5 //HC-SR04 Echo Pin (Receive) #define MAX_DISTANCE 100 //Maximum Distance for Sensor scan (tank depth) no more than 297f int LOW_WATER = 2; // int HIGH_WATER = 20; // int RADIUS = 15; //Radius of cylindrical bucket. Used for Flow calculations int bucketDepth = 30; int waterDepth = 5; unsigned long SEND_VOLUME = 0; // Trigger to send flow values to HA controller unsigned long WATER_VOLUME = 0; // Just a place holder.... unsigned long previousMillis = 0; //Tracks time list last depth report. unsigned long reportMillis = 10000; //How often to do depth report unsigned long manualWait = 20000; //Time for manual pump on action. 20 seconds default (to avoid pump dryout) long unsigned int Distance = 5; long unsigned int oldDepth = 0; //used to track transmission of water level on change only. #define CHILD_ID_RELAY 0 //To allow manual control of the sump pump from HA controller #define CHILD_ID_DEPTH 1 // Used to show water depth. #define CHILD_ID_VOLUME 2 // Sensor to send Water Volume info NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum depth // MySensors Message Initialization MyMessage msgRelay(CHILD_ID_RELAY, V_LIGHT); MyMessage msgDepth(CHILD_ID_DEPTH, V_DISTANCE); MyMessage msgPrefix(CHILD_ID_DEPTH, V_UNIT_PREFIX); //Adds SI unit (CM) for depth measurement. MyMessage msgVolume(CHILD_ID_VOLUME, V_VOLUME); // Water volume info. In Metres cubed unsigned long previousReport = 0; // For tracking report time void setup() { pinMode(RELAY_PIN, OUTPUT); digitalWrite(RELAY_PIN, LOW); send(msgPrefix.set("CM")); } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("DeHumidifierSumpPump", "1.0"); // Register all sensors to gw (they will be created as child devices) present(CHILD_ID_RELAY, S_LIGHT); present(CHILD_ID_DEPTH, S_DISTANCE); present(CHILD_ID_VOLUME, S_WATER); send(msgPrefix.set("CM")); } void loop() { unsigned long currentMillis = millis(); Distance = sonar.ping_cm(); waterDepth = (bucketDepth - Distance); if (waterDepth >= HIGH_WATER && SEND_VOLUME == 0){ digitalWrite(RELAY_PIN, HIGH); send(msgRelay.set(1)); SEND_VOLUME = 1; } else if ( (waterDepth <= LOW_WATER) && SEND_VOLUME == 1 ) { digitalWrite(RELAY_PIN, LOW); send(msgRelay.set (0)); SEND_VOLUME = 0; } if ( (currentMillis - previousMillis) >= reportMillis) { send(msgDepth.set(Distance)); send(msgPrefix.set("CM")); WATER_VOLUME = ((((sq(RADIUS)) * 3.14) * (waterDepth)) / 1000); send(msgVolume.set(WATER_VOLUME)); previousMillis = currentMillis; } wait(reportMillis); } void receive(const MyMessage &message) { // We only expect one type of message from controller. But we better check anyway. if ((message.type==V_LIGHT) && (waterDepth >= LOW_WATER)) { // Change pump state for 20 seconds. digitalWrite(RELAY_PIN, HIGH); send(msgRelay.set(1)); wait(manualWait); digitalWrite(RELAY_PIN, LOW); send(msgRelay.set(0)); } }
  • Arduino Mega + RelayWithButtonActuator sketch

    11
    0 Votes
    11 Posts
    4k Views
    jnatherJ
    Please, could you post your code? I can´t make my arduino mega work.
  • This topic is deleted!

    1
    0 Votes
    1 Posts
    2 Views
    No one has replied
  • Trouble with GatewayW5100

    3
    0 Votes
    3 Posts
    805 Views
    D
    @Boots33 - You'd the Man Boots!!! That was it. Commented that line out, and it's working! After inspecting the code again, I noticed the "!" (NOT) defined for "MY_W5100_SPI_EN" which indeed must have stopped Soft SPI. Thanks again!
  • if use sleep() the node can't receive message?

    9
    0 Votes
    9 Posts
    3k Views
    AWIA
    @Magic-W the intention is that you send a Request from your node when you want to Receive a status update from the controller. The controller sends you a response with the requested status. You keep the node awake Wait until you receive the message from the controller. In fact you are polling for new messages every x time or whenever you need an update.
  • Gateway freezes again

    4
    0 Votes
    4 Posts
    2k Views
    K
    @DavidZH i have thought the same, but that software is an very simple script. Still, you might be right.

25

Online

11.7k

Users

11.2k

Topics

113.1k

Posts