Starting with MySensors



  • Hi guys,

    Just started and finished my ESP8266MQTTClient, I still don't understand how all this works and I was wondering if there is any documentation or just a simple example like:
    Node - button - present it and send msg when button is pressed
    MQTTGateway - I don't know what goes into presentation or loop and haven't seen any examples for receive yet

    My guess is that I still need a controller which gets the information from the gateway but it's only a guess I haven't found any documentation yet on how to get started.

    Thanks, feel free to refer me to other posts if this was already answered


  • Mod

    @siddmon welcome to the MySensors community!

    The best place to start is the Getting started guide.

    The button example is available here: https://www.mysensors.org/build/binary



  • Thanks for the links, I got the gateway working (I think)

    ..0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    .pm open,type:2 0
    ...0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ............................................................................................................................0;255;3;0;9;TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=255
    0;255;3;0;9;TSF:PNG:SEND,TO=0
    0;255;3;0;9;TSF:CKU:OK
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    ...0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ............................................................................................................................0;255;3;0;9;TSF:MSG:READ,255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0:
    0;255;3;0;9;TSF:MSG:BC
    0;255;3;0;9;TSF:MSG:FPAR REQ,ID=255
    0;255;3;0;9;TSF:PNG:SEND,TO=0
    0;255;3;0;9;TSF:CKU:OK
    0;255;3;0;9;TSF:MSG:GWL OK
    0;255;3;0;9;TSF:MSG:SEND,0-0-255-255,s=255,c=3,t=8,pt=1,l=1,sg=0,ft=0,st=OK:0
    ..0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ....0;255;3;0;9;TSF:MSG:READ,255-255-0,s=255,c=3,t=3,pt=0,l=0,sg=0:
    ...............................
    

    I think that means it's receiving data from the other node.

    In my other node I have the following output, which I think is sending information correctly

    0 MCO:BGN:INIT NODE,CP=RNNNA--,VER=2.2.0-beta
    4 TSM:INIT
    4 TSF:WUR:MS=0
    11 TSM:INIT:TSP OK
    13 TSM:FPAR
    15 TSF:MSG:SEND,255-255-255-255,s=255,c=3,t=7,pt=0,l=0,sg=0,ft=0,st=OK:
    823 TSF:MSG:READ,0-0-255,s=255,c=3,t=8,pt=1,l=1,sg=0:0
    828 TSF:MSG:FPAR OK,ID=0,D=1
    2023 TSM:FPAR:OK
    2024 TSM:ID
    2025 TSM:ID:REQ
    2028 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    4035 TSM:ID
    4036 TSM:ID:REQ
    4038 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    6046 TSM:ID
    6047 TSM:ID:REQ
    6049 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    8057 TSM:ID
    8058 TSM:ID:REQ
    8060 TSF:MSG:SEND,255-255-0-0,s=255,c=3,t=3,pt=0,l=0,sg=0,ft=0,st=OK:
    

    For the ESP8266MQTTClient, what IPs do I need to set?

    // Enable MY_IP_ADDRESS here if you want a static ip address (no DHCP)
    #define MY_IP_ADDRESS 192,168,1,5
    
    // If using static ip you need to define Gateway and Subnet address as well
    #define MY_IP_GATEWAY_ADDRESS 192,168,1,5  //This is the IP of my PC
    #define MY_IP_SUBNET_ADDRESS 255,255,255,0
    
    
    // MQTT broker ip address.
    #define MY_CONTROLLER_IP_ADDRESS 192, 168, 1, 88
    
    // The MQTT broker port to to open
    #define MY_PORT 1883
    

    From this code I think:
    MY_IP_ADDRESS - IP address of the gateway
    MY_IP_GATEWAY_ADDRESS - should this be the same as above?
    For connecting to Domoticz, do I need to what IP do I need to use? should it be port 1883 or something different?

    TIA



  • found this page which should help me get Domoticz configured

    https://www.domoticz.com/wiki/MySensors


  • Mod

    @siddmon
    For beginning domoticz is a good point to start with, also consider using ethernet gateway instead of mqtt as it is simpler than mqtt (al least until you are more familiar with everything)



  • @gohan, I'm so close now, I just need to make Domoticz to recognize my gw and the devices.

    I have verified that I get a message in the gw when toggling the switch in the node, so that part works 🙂

    Posted in their forums for help configuring Domoticz, I'm so close to have a working setup


  • Hardware Contributor

    @siddmon Whats the problem with domoticz and the gw? Should be very easy to setup. Here is a picture of my settings:
    0_1490808772283_upload-e4d4a00e-c7b8-43ed-8611-602ac5c6818a

    Just use the right topic names in your gw sketch. More infos on that here.


  • Mod

    @siddmon remember to install beta version of Domoticz otherwise you will not get mysensors support



  • @LastSamurai Thanks for the image, I had the address as localhost instead of the IP of the raspberry PI, changed it and everything works now 🙂

    @gohan , yes, I upgraded to beta version since release doesn't have MQTT support yet.


Log in to reply
 

Suggested Topics

66
Online

11.4k
Users

11.1k
Topics

112.7k
Posts