Connecting Gateway to Domoticz


  • Hardware Contributor

    Decided to switch to Domoticz, ran into problem.
    So, Domoticz
    0_1505828508978_Domoticz.png
    and Gateway
    https://www.mysensors.org/build/raspberry
    got installed.
    How does one make them talk to each other? Any help is appreciated.


  • Hero Member

    @ceech
    Try adding a talkative device device and enabling it. Then you'll know if it's working.


  • Hardware Contributor

    I tried sudo ./bin/mysgw -d and the Gateway seems to be listening

    0_1505829110671_Gateway.png
    What can I do next?


  • Mod

    @ceech did you make a serial or ethernet gateway? (which configure command did you use?)

    If serial/USB: Domoticz does not like the default name, so you need to change it according to the instructions on the build page.
    If ethernet: the gateway needs to be added as ethernet, not serial/USB in Domoticz.

    EDIT: I see now that you made an ethernet gateway so the second statement applies.


  • Hardware Contributor

    @mfalkvidd @NeverDie I tried all sorts of combinations. Like for example:
    ./configure --my-transport=nrf24
    ./configure --my-gateway=serial
    ./configure --my-serial-is-pty
    ./configure --my-serial-pty=/dev/ttyMySensorsGateway

    and in Domoticz MySensors Gateway USB with dev/ttyAMA0

    then
    ./configure --my-transport=nrf24
    ./configure --my-gateway=ethernet
    ./configure --my-controller-ip-address=192.168.1.120
    and in Domoticz MySensors Gateway with LAN

    I used other different combinations and this is as close to the connection as I could get
    0_1505839132337_Domoticz.png
    I feel like I'm missing something.


  • Hero Member

    @ceech
    No, no, no. I wouldn't mess with that. Remember that it's supposed to be a GUI. First turn a device on, so that it "phones home" and registers itself with the gateway. Then go to setup, and add the device using the GUI. At least, that's how I did it when I tried it out, and it worked. I wouldn't call it a great UI design (feels more like a work in progress), but it is semi-intuitive if you approach it that way.


  • Mod

    @ceech all parameters for the configure command need to be added in one line


  • Hero Member

    Are you sure you're using the right serial port? I did it on a Windows PC (I think only Windows 10 worked for me), and I never did find the Linux way of naming serial ports all that memorable.


  • Hardware Contributor

    @NeverDie I have no idea.


  • Hardware Contributor

    @mfalkvidd It's a good advice, unfortunately it didn't resolve the problem.


  • Hardware Contributor

    @NeverDie There are two serial ports available in Domoticz. Right? And you have to specify which one you are using in Gateway configuration. Right?


  • Mod

    @ceech you'll need to quite a bit more detailed than that if anyone is to have a chance to help you.

    What are the exact commands you used?
    What was the output in the terminal?
    What did you do in Domoticz?
    What does the domoticz log say?


  • Hardware Contributor

    @mfalkvidd Right. This is the Domoticz's part of the setting
    0_1505841041884_Untitled.png
    And I configured Gateway like this:
    ./configure --my-transport=nrf24 --my-gateway=ethernet --my-controller-ip-address=192.168.1.120

    make
    sudo make install

    sudo systemctl enable mysgw.service # << adding to boot
    sudo systemctl start mysgw.service # << starting


  • Hero Member

    I'm going to defer to mfalkvidd. Sounds like he has more of a handle on the Pi version of this, which is what you need. If you're stuck though, try the PC version. Maybe it's easier. Then you can return to the Pi once you get your bearings on how to navigate it.


  • Mod

    @ceech what did sudo ./bin/mysgw -d say at startup and when Domoticz tried to connect?
    What does the domoticz log say?

    If you run netstat -nap in another terminal window (while mysgw -d is running), does it say something like this?

    tcp        0      0 0.0.0.0:5003              0.0.0.0:*               LISTEN    2281/mysgw
    

  • Mod

    @ceech I think I have located the error.

    Domoticz wants to connect to the gateway, but in the configure command --my-controller-ip-address was used. This means that the gateway will connect to the controller, which Domoticz does not support.

    So drop --my-controller-ip-address, run the configure command again, run make and start up again.

    When I run sudo ./bin/mysgw -d with your configuration I get lots of these:

    pi@raspi1:~/MySensors $ sudo ./bin/mysgw -d
    mysgw: Starting gateway...
    mysgw: Protocol version - 2.1.1
    mysgw: MCO:BGN:INIT GW,CP=R-NG---,VER=2.1.1
    mysgw: connect: Connection refused
    mysgw: failed to connect
    mysgw: Eth: connect
    mysgw: connect: Connection refused
    mysgw: failed to connect
    

    which shows that the gateway is unable to connect to the controller.


  • Hardware Contributor

    @mfalkvidd Removing --my-controller-ip-address did in fact solve the issue.
    Thank you for your help.
    So, to sum up, these are commands to be used when configuring Gateway for Domoticz ethernet (LAN) connection:

    ./configure --my-transport=nrf24 --my-gateway=ethernet
    
    make
    sudo make install
    
    sudo systemctl enable mysgw.service # << adding to boot
    sudo systemctl start mysgw.service # << starting

  • Mod

    @ceech yes and no. Skipping the test step is a bad idea. If that step is skipped, people have to resort to asking questions in the forum 😉


  • Hardware Contributor

    @mfalkvidd Of course. Skipping test is a bad idea. It is obvious, though that people who resort to asking questions on the forum have tried the test step several times to try and figure things out for themselves. Maybe if the https://www.mysensors.org/build/raspberry wasn't misleading they would even succeed.


  • Mod

    @ceech I'll be happy to update the guide if you could be a bit more specific.


  • Hardware Contributor

    @mfalkvidd First thing one does is to follow instructions exactly and hope things will work out. They don't. You try a different type of connection. Which one? Why one or the other? Which option among the same type? It doesn't work, either. Now, you are thinking, ok this guide is for several controllers, so how do I adapt it for my specific case.
    The point being, you can't adapt the instructions on your own. You have to ask someone who's done it before and knows what commands to use in order to make Gateway connect to the specific controller.
    For example: using
    --my-gateway=ethernet --my-controller-url-address=YOUR-CONTROLLER-ADDRESS
    will never connect your Gateway to Domoticz. How can one know that this is the line to be modified?


Log in to reply
 

Suggested Topics

  • 5
  • 1
  • 2
  • 1
  • 1
  • 2

0
Online

11.4k
Users

11.1k
Topics

112.7k
Posts