Skip to content

Troubleshooting

Help! Everything just falls apart
2.7k Topics 21.5k Posts
  • Questions about power and repeater

    11
    0 Votes
    11 Posts
    3k Views
    hekH
    Ok, but it's gone in 2.0.
  • (Relay) node asks for parent. Gateway forwards (!)

    6
    0 Votes
    6 Posts
    1k Views
    E
    Hmm.. basically, this node works if signing is disabled. If it's enabled, all the nonce requests fail to transmit (with st=NACK). Disabling signing, it has greater success in transferring its data. So I guess it's yet another problem with the radio. I suspected this. This is an NRF24L01+PA+LNA module. I have: Tried multiple radio modules to rule out a faulty one. Put the radio module on a dedicated 3.3V power regulator. Tried both high and low PA level. Same thing on gateway - NRF24L01+PA+LNA, on dedicated 3.3V power regulator. It seems to succeed in most cases, at least when it's sending just a set request. Presentations and others do not work. It's like it's having trouble transmitting longer messages. Odd. The code in this sketch is using an interrupt handler to count pulsess on my energy meter. Could this be related? Some debug output from the node, with signing disabled: MCO:BGN:INIT REPEATER,CP=RNNRA--,VER=2.0.1-beta TSM:INIT TSM:INIT:TSP OK TSF:ASID:OK,ID=4 TSM:FPAR TSF:MSG:SEND,4-4-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=bc: TSF:MSG:READ,0-0-4,s=255,c=3,t=8,pt=1,l=1,sg=0:0 TSF:MSG:FPAR RES,ID=0,D=0 TSF:MSG:FPAR OK,ID=0,D=1 TSM:FPAR:OK TSM:ID TSM:ID:OK,ID=4 TSM:UPL TSF:PING:SEND,TO=0 TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=24,pt=1,l=1,sg=0,ft=0,st=OK:1 TSF:MSG:READ,0-0-4,s=255,c=3,t=25,pt=1,l=1,sg=0:1 TSF:MSG:PONG RECV,HP=1 TSF:CHKUPL:OK TSM:UPL:OK TSM:READY TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=15,pt=6,l=2,sg=0,ft=0,st=OK:0100 !TSF:MSG:SEND,4-4-0-0,s=255,c=0,t=18,pt=0,l=10,sg=0,ft=0,st=NACK:2.0.1-beta TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=6,pt=1,l=1,sg=0,ft=1,st=OK:0 TSF:MSG:READ,0-0-4,s=255,c=3,t=15,pt=6,l=2,sg=0:0100 TSF:MSG:READ,0-0-4,s=255,c=3,t=6,pt=0,l=1,sg=0:M !TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=11,pt=0,l=12,sg=0,ft=0,st=NACK:Energy Meter TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=12,pt=0,l=3,sg=0,ft=1,st=OK:1.1 TSF:MSG:SEND,4-4-0-0,s=4,c=0,t=13,pt=0,l=0,sg=0,ft=0,st=OK: MCO:REG:REQ TSF:MSG:SEND,4-4-0-0,s=255,c=3,t=26,pt=1,l=1,sg=0,ft=0,st=OK:2 TSF:MSG:READ,0-0-4,s=255,c=3,t=27,pt=1,l=1,sg=0:1 MCO:PIM:NODE REG=1 setup(). Radio Channel is 42 TSF:MSG:SEND,4-4-0-0,s=4,c=2,t=24,pt=0,l=0,sg=0,ft=0,st=OK: MCO:BGN:INIT OK,ID=4,PAR=0,DIS=1,REG=1 TSF:MSG:READ,0-0-4,s=4,c=1,t=24,pt=0,l=7,sg=0:7418044 Received last pulse count from gw:7418044 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=17,pt=5,l=4,sg=0,ft=0,st=OK:3169 Watt:3169 !TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=NACK:7418088 !TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=18,pt=7,l=5,sg=0,ft=1,st=NACK:741.8089 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=17,pt=5,l=4,sg=0,ft=2,st=OK:3156 Watt:3156 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=OK:7418132 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=18,pt=7,l=5,sg=0,ft=0,st=OK:741.8133 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=17,pt=5,l=4,sg=0,ft=0,st=OK:3169 Watt:3169 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=OK:7418177 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=18,pt=7,l=5,sg=0,ft=0,st=OK:741.8177 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=17,pt=5,l=4,sg=0,ft=0,st=OK:7311 Watt:7241 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=24,pt=5,l=4,sg=0,ft=0,st=OK:7418249 TSF:MSG:SEND,4-4-0-0,s=4,c=1,t=18,pt=7,l=5,sg=0,ft=0,st=OK:741.8249```
  • Dallas Temp failure to compile

    23
    0 Votes
    23 Posts
    8k Views
    R
    It's my code :scream: I changed this method from private to public, this function is used to determine wait time needed for right non-blocking wait call. Seems like I should make PR to original library instead of modifying MYS copy.
  • NRF24-Autoack

    6
    0 Votes
    6 Posts
    3k Views
    cimba007C
    I stripped down my example and tried to capsulate it in its own wrapper class. This is by no means complete or ready to use .. it is just there to give interested people some kind of input on how to work with the wait/autoack stuff if you can't use your radios autoretry feature like me. If you need some comments to understand parts of the code feel free to ask. LightSensorSoftwareAckNRF24_class.ino #define MY_NODE_ID 10 #define MY_BAUD_RATE 57600 // 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> #define LIGHT_SENSOR_ANALOG_PIN A3 #define MINUTES 60000UL #define CHILD_ID_LIGHT 0 #include "helper.cpp" void before() { // LightSensor // http://akizukidenshi.com/download/ds/senba/GL55%20Series%20Photoresistor.pdf // GL5549 pinMode(A3,INPUT_PULLUP); // 20-50 kOhm pinMode(A2,OUTPUT); digitalWrite(A2,LOW); } MySensorChild photoSensor = MySensorChild(CHILD_ID_LIGHT,S_LIGHT_LEVEL,"Photoresistor GL5549"); void setup() { } void presentation() { // Send the sketch version information to the gateway and Controller sendSketchInfo("LightClass_Test", "0.1"); photoSensor.do_present(); } void loop() { // Set Message photoSensor.message()->set(random(0,100)); // Print Result photoSensor.print(photoSensor.waitsend(250)); delay(1000); } helper.cpp #include "core/MySensorsCore.h" #include "core/MyTransport.h" #include "drivers/RF24/RF24.h" #include <stdarg.h> class MySensorChild { public: typedef struct { uint8_t rpd; unsigned long long elapsedtime; uint8_t success; uint8_t retrycount; } return_struct; void print(return_struct r) { Serial.print(r.success == 1 ? "success" : "fail "); Serial.print(" | "); Serial.print("time: "); p(F("%8d"),r.elapsedtime); Serial.print("uS | "); Serial.print("retr.: "); p(F("%2d"),r.retrycount); Serial.print(" | "); Serial.print("rpd: "); Serial.print(r.rpd); Serial.print(" | "); Serial.println(); } public: MySensorChild(uint8_t childid, uint8_t valuetype, char * description) { // Base Values that define a Message this->description = description; this->childid = childid; this->valuetype = valuetype; this->message_internal = MyMessage(childid, valuetype); } MyMessage * MySensorChild::message() { return &this->message_internal; } void do_present() { present(this->childid, this->valuetype, this->description); } return_struct MySensorChild::waitsend(unsigned long ms) { bool ok = false; const uint8_t retrycountlimit = 10; unsigned long long starttime = micros(); return_struct r; send(message_internal,true); uint8_t c = retrycountlimit; while(!ok && c) { // Ack?! if(wait(ms,message_internal.getCommand(),message_internal.type)) { r.rpd = RF24_readByteRegister(RPD); r.elapsedtime = micros()-starttime; r.success = true; r.retrycount = retrycountlimit-c; return r; //Serial.print(" | rpd: "); Serial.print(RF24_readByteRegister(RPD)); // Return! //return true; } else { if(!isTransportOK()) { Serial.print(" | Transport broken! "); wait(100); } //Serial.print("~"); send(message_internal,true); } c--; } if(c == 0) { r.elapsedtime = micros()-starttime; r.success = false; r.retrycount = retrycountlimit-c; return r; //return false; } } private: // Base Values that define a Message MyMessage message_internal; char * description; uint8_t childid; uint8_t valuetype; unsigned long lastSend; void p(const __FlashStringHelper *fmt, ... ){ char buf[128]; // resulting string limited to 128 chars va_list args; va_start (args, fmt); #ifdef __AVR__ vsnprintf_P(buf, sizeof(buf), (const char *)fmt, args); // progmem for AVR #else vsnprintf(buf, sizeof(buf), (const char *)fmt, args); // for the rest of the world #endif va_end(args); Serial.print(buf); }; }; Example output (mydebug enabled @ gateway) success | time: 16mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 17mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 13mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 10mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 11mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 10mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 13mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 10mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 11mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 12mS | retr.: 0 | rpd: 1 | <\r><\n> fail | time: 2504mS | retr.: 10 | rpd: 0 | <\r><\n> fail | time: 2505mS | retr.: 10 | rpd: 0 | <\r><\n> Always a good idea to disable debugging if you are happy with the performance. Debugging output on serial on the mqtt-gateway (esp8266) takes quite a while. success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 2mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 2mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 4mS | retr.: 0 | rpd: 1 | <\r><\n> success | time: 5mS | retr.: 0 | rpd: 1 | <\r><\n>
  • Library 1.6 devel - How query the parent node?

    6
    0 Votes
    6 Posts
    1k Views
    X
    @hek I can retrive the parent node by requesting it, that's ok. I have no idea how to do that (if you can point me to an example...) BTW, if I would like to inform the Controller (OpenHAB) on which parent is used by a node (I'm using MQTTClient as GW) I need to present and register this information as written by me before or there is another way as well? Thanks! simon
  • Problems with first sensors

    62
    0 Votes
    62 Posts
    29k Views
    blebbensB
    There is no device listed in APPS/DEV APPS/Serial Port Config. There is only a save button. That´s the big problem. Vera does not recognize the to USB connected gateway.
  • [Closed][Unresolved]gateway DHCP Fail

    5
    0 Votes
    5 Posts
    2k Views
    markjgabbM
    worked around the issue but making it a serial gateway instead as long as my nas is happy i dont mind how it plugs in....
  • Does ESP8266 WIFI only node require IP gateway?

    4
    0 Votes
    4 Posts
    1k Views
    mfalkviddM
    @stephenmhall it needs a controller with an ip address, not a gateway. https://www.mysensors.org/about/network describes the difference between a controller and a gateway. Are you using the mqtt gateway or the ethernet gateway? According to the Vera page, Vera supports ethernet gateway, but not mqtt. Therefore you should probably use the ethernet gateway and leave MY_CONTROLLER_IP_ADDRESS disabled/commented (the way it is by default). You then add the ethernet gateway to Vera according to the instructions here. I don't use Vera though so I have not tried this myself.
  • [Solved] Node not reconnecting

    Locked
    17
    1 Votes
    17 Posts
    6k Views
    corbinC
    @tekka said: if(isTransportOK()){ sleep(30000); // transport is OK, node can sleep } else { wait(5000); // transport is not operational, allow the transport layer to fix this } I've only just found this post, and these lines of code have me excited! fixes my problem, thank you!
  • [Solved] Node not resetting itself

    Locked
    8
    0 Votes
    8 Posts
    2k Views
    tekkaT
    @kenci Not yet :smile:
  • Question about wait() and program logic

    9
    0 Votes
    9 Posts
    2k Views
    X
    @hek ok, thank you! I'll adopt your example as starting point. Many thanks! Simon
  • [SOLVED] Domoticz find just one of two flow sensors!

    5
    0 Votes
    5 Posts
    2k Views
    vichoV
    @mfalkvidd yes, it is very strange. Before to write here I try to change the child id - first the sensors have id 50 and 51. After I try with 30, 31 and 31,32 but the same result - domoticz see just one of the flow meters. I try to reprogram GW and new node (clear both EEPROM) - note get new ID and the rusult are the same. Clear Domoticz database - same. Very strange for me. All other work well - have attached RFXTRX433 with energy monitor and some switches at 433Mhz, some nodes with light sensors and ds18b20 for testing.
  • [Solved] Function repeater not working

    Locked
    16
    0 Votes
    16 Posts
    4k Views
    D
    @tekka said: @Daemon-D Can you explain how you solved the issue - I'm sure other user could also profit if they face a similar problem. Thanks. The problem was solved by moving to the top of the sketch exactly like the to test the sketch before #include // Enable debug prints to serial monitor #define MY_DEBUG // Enable and select radio type attached #define MY_RADIO_NRF24 //#define MY_RADIO_RFM69 // Enabled repeater feature for this node #define MY_REPEATER_FEATURE #include <SPI.h> #include <MySensors.h>
  • 0 Votes
    12 Posts
    8k Views
    wahidW
    hello, i know it is late, but others could see it too. i had the same problem running small (LOW POWER) modules on power banks, because the battery or power bank has a built in power meter, while it is charging and consuming power, there will be power on the USB port, but the arduino's consumption is very tiny regarding charging a phone. you need to disable this feature somehow.
  • [SOLVED] Just started, but already stuck

    Locked
    7
    0 Votes
    7 Posts
    2k Views
    nick van alstN
    Thank you guys, its all working now!
  • The Light Sensor can't be discoverd

    2
    0 Votes
    2 Posts
    630 Views
    mfalkviddM
    @Magic-W the light sensor sleeps most of the time, so it is not likely to see incoming messages. Try replacing sleep() with wait().
  • Battery powering

    27
    0 Votes
    27 Posts
    6k Views
    Nca78N
    Hello I gave you some tips for button cell on your other thread. In addition: if you are using interrupts only then your power consumption should be extremely low, I don't think it's necessary to wake up regularly to send battery level. If you don't do it then then you have even lower consumption because the watchdog timer is turned off, my CR2032 door/windows nodes using the sleep method from MySensors draws less than 2uA, there can be no visible change in battery level except if you leave your node in a closet for one year ;)
  • first tries with MySensors v2.0: problem staring up.

    9
    0 Votes
    9 Posts
    3k Views
    vgaV
    ok, thank you Yveaux for your help! to understand the mechanism, when the sensor node starts to search for parent again, why doesn´t it find the parent node, which used before?
  • [Solved] API 2.0 void receive(const MyMessage& message) Problem

    8
    0 Votes
    8 Posts
    2k Views
    paqorP
    @TheoL said: @paqor That's great. I looked at the Sketch you posted on your site and noticed you're still using a delay. Which as short as it may be can cause messages to be missed. void loop(){ //----------------------------------------------------------------------------- //TEMP_FEUCHTE delay(dht.getMinimumSamplingPeriod()); My advice is to do this with a wait as well. void loop(){ //----------------------------------------------------------------------------- //TEMP_FEUCHTE wait(dht.getMinimumSamplingPeriod()); // Changed ByTheo That way you don't block incoming messages. Generally, if you want your sketch to wait use a wait. genial, works perfectly....
  • Radio stop emitting after a few hours...

    8
    0 Votes
    8 Posts
    3k Views
    TheoLT
    @ybycode could be. I once had a MySensors project which used a speaker. The speaker was very close to the radio and that Node behaved just like yours. When I move the speaker away from the node it became stable. Not sure if an inductive speak could be the cause, when you use the break-out relays. But that's a good question for someone with more electronics knowledge. I've found a tutorial about watch dogs. It is a last resort, but adding a watchdog will reset your arduino if it stalls. It doesn't resolve the cause though. But I'm thinking about adding a watchdog to all of my sensors. Just to make sure they can't stall in case hardware related issues.

16

Online

11.7k

Users

11.2k

Topics

113.2k

Posts