Skip to content
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo
M

Michael M

@Michael M
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Actuators receiving extra data
    M Michael M

    @AcidUK said:

    int requestedLevel = message.getInt();

    It works like a charm now :) Thank you

    Troubleshooting

  • Actuators receiving extra data
    M Michael M

    @AcidUK Perhaps I'm an earlier generation of monkey then you are, because I can't get it to work properly :) Could you please tell me what steps did you take to get this working? I've changed MyMessage.cpp to this:

    /*
    int16_t MyMessage::getInt() const {
    	if (miGetPayloadType() == P_INT16) { 
    		return iValue;
    	} else if (miGetPayloadType() == P_STRING) {
    		return atoi(data);
    	} else {
    		return 0;
    	}
    }
    */
    
    int16_t MyMessage::getInt() const {
        if (miGetPayloadType() == P_INT16) { 
            return iValue;
        } else if (miGetPayloadType() == P_STRING) {
            // Null terminate string according to message length to prevent reading old bytes from data
            char* ca;
            ca = (char *) data;
            ca += miGetLength();
            *ca = '\0';
            
            return atoi(data);
        } else {
            return 0;
        }
    }
    

    Then I reflashed gateway and sensor and the result is the same as before:

    read: 0-0-2 s=0,c=0,t=3,pt=0,l=2,sg=0:35
    351mableLED
    Changing level to 100, from 0
    

    Am I missing something besides my programming skills ? :)

    Troubleshooting

  • Actuators receiving extra data
    M Michael M

    I'm getting the same behavior with latest dev (as of 27.12.2015). I'm using ESP8266 mqtt client gateway.

    Gateway:

    0;0;3;0;9;Message arrived on topic: mysensorsgwin/2/1/1/1/3
    0;0;3;0;9;send: 0-0-2-2 s=1,c=1,t=3,pt=0,l=2,sg=0,st=ok:50
    0;0;3;0;9;read: 2-2-0 s=1,c=1,t=3,pt=0,l=2,sg=0:50
    0;0;3;0;9;Sending message on topic: mysensorsgwout/2/1/1/1/3
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=2,pt=2,l=2,sg=0:1
    0;0;3;0;9;Sending message on topic: mysensorsgwout/2/0/1/0/2
    0;0;3;0;9;read: 2-2-0 s=0,c=1,t=3,pt=2,l=2,sg=0:100
    0;0;3;0;9;Sending message on topic: mysensorsgwout/2/0/1/0/3
    

    Sensor:

    read: 0-0-2 s=1,c=1,t=3,pt=0,l=2,sg=0:50
    send: 2-2-0-0 s=1,c=1,t=3,pt=0,l=2,sg=0,st=ok:50
    501mableLED
    Changing level to 100, from 0
    send: 2-2-0-0 s=0,c=1,t=2,pt=2,l=2,sg=0,st=ok:1
    send: 2-2-0-0 s=0,c=1,t=3,pt=2,l=2,sg=0,st=ok:100```
    Troubleshooting
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • MySensors
  • OpenHardware.io
  • Categories
  • Recent
  • Tags
  • Popular