Connecting Gateway to Domoticz
Decided to switch to Domoticz, ran into problem.
How does one make them talk to each other? Any help is appreciated.
Try adding a talkative device device and enabling it. Then you'll know if it's working.
sudo ./bin/mysgw -dand the Gateway seems to be listening
What can I do next?
@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.
@mfalkvidd @NeverDie I tried all sorts of combinations. Like for example:
and in Domoticz MySensors Gateway USB with dev/ttyAMA0
and in Domoticz MySensors Gateway with LAN
I used other different combinations and this is as close to the connection as I could get
I feel like I'm missing something.
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.
@ceech all parameters for the configure command need to be added in one line
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.
@NeverDie I have no idea.
@mfalkvidd It's a good advice, unfortunately it didn't resolve the problem.
@NeverDie There are two serial ports available in Domoticz. Right? And you have to specify which one you are using in Gateway configuration. Right?
@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?
@mfalkvidd Right. This is the Domoticz's part of the setting
And I configured Gateway like this:
./configure --my-transport=nrf24 --my-gateway=ethernet --my-controller-ip-address=192.168.1.120
sudo make install
sudo systemctl enable mysgw.service # << adding to boot
sudo systemctl start mysgw.service # << starting
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.
@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
@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.
@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
@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.
@ceech I'll be happy to update the guide if you could be a bit more specific.