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
  1. Home
  2. Development
  3. Get version response

Get version response

Scheduled Pinned Locked Moved Development
3 Posts 2 Posters 852 Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • franzelareF Offline
    franzelareF Offline
    franzelare
    wrote on last edited by
    #1

    I run a mysensor gateway on an ESP8266 with some sensors directly connected to the gateway.
    On the receiving end I have domoticz and sometimes it happens that the connection goes down and so I'm not sure of the state of the inputs of the mysensor node.

    When the ESP reconnects to domoticz, domoticz also requests the version...
    how to use this request to resend the current state of the inputs?

    ip:192.168.2.200,mask:255.255.255.0,gw:192.168.2.254
    .
    starting server

    Send sketch info
    Present temperature sensor
    Present heartbeat signal
    Setup completed
    0;0;3;0;9;Init complete, id=0, parent=0, distance=0
    0;0;3;0;9;Client 0 connected
    0;0;3;0;9;Client 0: 0;0;3;0;2;
    0;0;3;0;9;Client 0: 0;0;3;0;2;Get Version
    0;0;3;0;9;Client 0: 0;0;3;0;18;PING
    0;0;3;0;9;Client 0: 0;0;3;0;18;PING
    0;0;3;0;9;Client 0: 0;0;3;0;18;PING

    in my sketch I like to catch the message Get Version to resend the input signals, since sending this right after starting the server is no use because domoticz is not yet listening....

    like:
    void receive(const MyMessage &message) {
    if (message.???==Get Version){
    debouncer.update();
    value = debouncer.read();
    send(msgOpen.set(value==HIGH ? 1 : 0));
    ....and so on
    }
    }

    anyone any idea how to do this?

    1 Reply Last reply
    0
    • mfalkviddM Offline
      mfalkviddM Offline
      mfalkvidd
      Mod
      wrote on last edited by
      #2

      Looks like you're on the right track.

      I would move the sending code to a separate function though, so the same function can be called from loop() and receive(). Duplicated code usually causes problems.

      1 Reply Last reply
      0
      • franzelareF Offline
        franzelareF Offline
        franzelare
        wrote on last edited by
        #3

        nobody knows how to catch the get version message?

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        11

        Online

        11.7k

        Users

        11.2k

        Topics

        113.0k

        Posts


        Copyright 2019 TBD   |   Forum Guidelines   |   Privacy Policy   |   Terms of Service
        • Login

        • Don't have an account? Register

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