Sensor reading incorrect



  • Having a strange problem - got a NodeMCU running with a ESP8266 as the gateway. For a sensor I have a Arduino mini pro with a MQ-2 Gas sensor. The controller is a domoticz.

    For the past 12 hours the sensor has been logging fine, 30 mins ago it stopped logged. I then did a update to domoticz after which the gateway started logging data again but the value is incorrect.

    Sensor output on com port:

    LPG:0ppm    CO:0ppm    SMOKE:0ppm
    send: 2-2-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:0
    

    If I telnet to the esp8266 gateway on port 5003 I can see the data being logged to it but the value is wrong. Its constantly logging 536870912

    2;0;1;0;37;536870912
    

    This has happened a few times now - restarting the sensor fixes the issue.

    After sensor restart:

    2;255;3;0;11;Air Quality Sensor
    2;255;3;0;12;1.0
    2;0;1;0;37;0
    

    If the sensor reboot fixes the issue it looks like this is the problem. But looking at the com port info the correct data is being sent.

    Any ideas on this one?


  • Contest Winner

    Could be a power issue. I've had it with one of my sensor. When I powered the sensors directly from the adapter (instead of the Arduino) my problems were solved.



  • Thanks - I'll try that. Also powering it from the Arduino. Will try a separate supply and see if it helps.



  • Tried powering the sensor from a seperate supply. I seem to be having endless stability issues with getting this working.

    LPG:0ppm    CO:0ppm    SMOKE:0ppm
    send: 2-2-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:0
    0
    LPG:0ppm    CO:0ppm    SMOKE:0ppm
    send: 2-2-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:0
    0
    LPG:0ppm    CO:0ppm    SMOKE:0ppm
    send: 2-2-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:0
    0
    LPG:0ppm    CO:0ppm    SMOKE:0ppm
    send: 2-2-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:0
    

    The sensor starts of ok - logs to the gateway and onto Domoticz. After a random time it just stops logging now. I'm still seeing the st=ok from the sensor. Does this mean its been successfully sent to the gateway? Could the issue be from the gateway to domoticz?



  • @gmccarthy said:

    Could the issue be from the gateway to domoticz?

    Something similar was discussed in this thread regarding integers passing from arduino to ESP. I don't know if it was resolved. I do not use ESP myself.


  • Admin

    Yes, this has been resolved in the development branch.



  • Thanks - I've updated to the latest dev version and things are looking promising.

    Been running 2 hours so far with no issues.


  • Mod

    Great news! I'm working on getting an ESP8266 working as well. Will make sure I use the development branch.
    Speaking of that, how do you guys handle different MySensors versions? (created a separate thread to not derail this thread)



  • I found the ESP8266 rock stable - been running for around 2 weeks so far. No issues.

    The issue above also seems to be fixed - been about 24 hours now, no crashes, no odd values.

    Update: Just done a update to Domoticz and now the value is incorrect and seems to be stuck there.

    Sensor debug:

    0
    LPG:0ppm    CO:0ppm    SMOKE:0ppm
    send: 1-1-0-0 s=0,c=1,t=37,pt=2,l=2,sg=0,st=ok:0
    

    Controller log:

    subtype       = Voltcraft CO-20
    CO2 = 536870912 ppm
    Quality = Bad
    2015-11-08 21:29:09.177  (ESP8266 Gateway) Air Quality (Air Quality1)
    

    This is the 2nd time its happened right after a domoticz update (I'm running the dev build)

    Could this be a issue with domoticz? Its weird how it only does it now after a update. To fix it however I need to reset the sensor.


Log in to reply
 

Suggested Topics

0
Online

11.2k
Users

11.1k
Topics

112.5k
Posts