Page 9 of 123

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:06
by arkoko
corbin wrote:It might be another program listening on UDP. I will try to stop the crash in my code. Are you running other programs or plugins that could be conflicting?
I had same error when HomeAssistant ran in the background. After stoping and disabling this service no more errors.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:08
by vetalok
corbin wrote:
vetalok wrote:
Yes. System crashed and not restarted.
Only If I delete a domoticz.db file, the system runs.
What am I doing wrong? Why do I have this issue?
It might be another program listening on UDP. I will try to stop the crash in my code. Are you running other programs or plugins that could be conflicting?
No, my netstat:

Code: Select all

tcp        0      0 127.0.0.1:5037          0.0.0.0:*               LISTEN      12020/adb       
tcp        0      0 127.0.0.1:63342         0.0.0.0:*               LISTEN      16440/java      
tcp        0      0 127.0.0.1:30000         0.0.0.0:*               LISTEN      23787/bash      
tcp        0      0 0.0.0.0:10000           0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:5940          0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.1.1:53            0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:631           0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:445             0.0.0.0:*               LISTEN      -               
tcp        0      0 127.0.0.1:6942          0.0.0.0:*               LISTEN      16440/java      
tcp        0      0 0.0.0.0:24800           0.0.0.0:*               LISTEN      24429/synergys  
tcp        0      0 0.0.0.0:40801           0.0.0.0:*               LISTEN      7489/skype      
tcp        0      0 0.0.0.0:8999            0.0.0.0:*               LISTEN      7783/qbittorrent
tcp        0      0 127.0.0.1:3306          0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:139             0.0.0.0:*               LISTEN      -               
tcp        0      0 0.0.0.0:42572           0.0.0.0:*               LISTEN      24414/synergy   
tcp6       0      0 :::80                   :::*                    LISTEN      -               
tcp6       0      0 :::1714                 :::*                    LISTEN      4776/kdeconnectd
tcp6       0      0 :::22                   :::*                    LISTEN      -               
tcp6       0      0 ::1:631                 :::*                    LISTEN      -               
tcp6       0      0 :::445                  :::*                    LISTEN      -               
tcp6       0      0 :::8999                 :::*                    LISTEN      7783/qbittorrent
tcp6       0      0 :::139                  :::*                    LISTEN      -  
My network:
Image


What is necessary to enter in the address and port fields?

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:11
by corbin
arkoko wrote:I had same error when HomeAssistant ran in the background. After stoping and disabling this service no more errors.
I've changed my code at https://github.com/corbinmunce/domoticz to set the "reuse_address" option before sending the device discovery message, which may fix this problem. Could you test please?

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:15
by corbin
vetalok wrote: What is necessary to enter in the address and port fields?
Thanks, it doesn't look like there is anything listening on UDP. What command did you use for netstat?

Address needs to be the IP address of your gateway, the port can be anything, 9898 is a good number to use.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:18
by arkoko
corbin wrote:Could you test please?
Not anymore. After your last beautiful additions (temp & hum sensor, switch control) I uninstalled HomeAssistant from my pi :)

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:20
by vetalok
corbin wrote:
arkoko wrote:I had same error when HomeAssistant ran in the background. After stoping and disabling this service no more errors.
I've changed my code at https://github.com/corbinmunce/domoticz to set the "reuse_address" option before sending the device discovery message, which may fix this problem. Could you test please?
OK, building...

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:22
by corbin
arkoko wrote: Not anymore. After your last beautiful additions (temp & hum sensor, switch control) I uninstalled HomeAssistant from my pi :)
Awesome! :)

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:23
by corbin
vetalok wrote: OK, building...
Thank you! I hope to get it working for you.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:39
by vetalok
corbin wrote:
vetalok wrote: OK, building...
Thank you! I hope to get it working for you.
Oh.. =(((

Code: Select all

2016-12-31 11:33:49.388  Domoticz V3.6253 (c)2012-2016 GizMoCuz
2016-12-31 11:33:49.388  Build Hash: 928fcd1, Date: 2016-12-31 11:06:24
2016-12-31 11:33:49.389  Startup Path: /home/vetal/domoticzv3/domoticz/
2016-12-31 11:33:49.494  PluginSystem: Started, Python version '3.5.2'.
2016-12-31 11:33:49.497  Active notification Subsystems: http (1/12)
2016-12-31 11:33:49.497  WebServer(HTTP) started on address: :: with port 8080
2016-12-31 11:33:49.499  WebServer(SSL) started on address: :: with port 443
2016-12-31 11:33:49.500  Proxymanager started.
2016-12-31 11:33:49.500  Starting shared server on: :::6144
2016-12-31 11:33:49.500  TCPServer: shared server started...
2016-12-31 11:33:49.501  RxQueue: queue worker started...
2016-12-31 11:33:51.502  EventSystem: reset all events...
2016-12-31 11:33:51.502  EventSystem: reset all device statuses...
2016-12-31 11:33:51.502  EventSystem: Started
2016-12-31 11:33:51.954  PluginSystem: Entering work loop.
2016-12-31 11:33:56.563  Incoming connection from: 127.0.0.1
2016-12-31 11:35:10.369  XiaomiGateway: Worker started...
terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::system::system_error> >'
  what():  bind: Address already in use

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:44
by arkoko
Did you try 'netstat -aun' to figure out used UDP ports?

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:46
by vetalok
Hah... problem fixed when I changed port on line

XiaomiGateway.cpp:

Code: Select all

XiaomiGateway::xiaomi_udp_server::xiaomi_udp_server(boost::asio::io_service& io_service, int m_HwdID, XiaomiGateway *parent)
	: socket_(io_service, boost::asio::ip::udp::endpoint(boost::asio::ip::udp::v4(), 9898))
9898 to 9899

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:52
by arkoko
It means that something using 9898 port.
netstat -tulpn part from my pi:
udp 0 0 0.0.0.0:9898 0.0.0.0:* 4748/domoticz
What is in your case?

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:54
by vetalok
arkoko wrote:It means that something using 9898 port.
netstat -tulpn part from my pi:
udp 0 0 0.0.0.0:9898 0.0.0.0:* 4748/domoticz
What is in your case?
netstat -tulnp | grep 9898
udp 2496 0 0.0.0.0:9898 0.0.0.0:* 30151/python

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 10:55
by arkoko
sudo ls -l /proc/30151/exe
ps aux |grep 30151

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 11:20
by corbin
Do you know what is already using port 9898? I guess my code still crashes - which I would like to fix, but you can't be running two sockets on the same port.

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 11:26
by vetalok
corbin wrote:Do you know what is already using port 9898? I guess my code still crashes - which I would like to fix, but you can't be running two sockets on the same port.
https://pypi.python.org/pypi/pdbx/0.3.0

Remote PDB Debugger use port 9898

Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 11:50
by levynger
corbin wrote:Switches now have the extra options:

xiaom_switches.PNG
Thanks!
Just updated from git,
the wireless switch now identifies as Selector, after adding as switch, no way to edit and it recieved only "off" commands.
WirelessSwitch.PNG
WirelessSwitch.PNG (7.07 KiB) Viewed 2296 times
WirelessSwitch_Added.PNG
WirelessSwitch_Added.PNG (19.35 KiB) Viewed 2296 times
Any ideas?


EDIT: i have added it manually, and it works!!
the Long Press appears twice in logs (one for press and once for release i assume)

Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 11:53
by Coldman
corbin wrote:only in my repository at this stage, so something like this:

git clone https://github.com/corbinmunce/domoticz.git domoticz
I have installed from your repositary, how to I can update it, or I should installing again full version?

Sent from my MI PAD 2 using Tapatalk

Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 12:00
by levynger
Coldman wrote:
corbin wrote:only in my repository at this stage, so something like this:

git clone https://github.com/corbinmunce/domoticz.git domoticz
I have installed from your repositary, how to I can update it, or I should installing again full version?

Sent from my MI PAD 2 using Tapatalk
I also moved from offical to corbin's git, i simply installed in a different folder and restored DB into it.

Re: RE: Re: RE: Re: Xiaomi Smart Home Suite (very cheap) compatibilty?

Posted: Saturday 31 December 2016 12:03
by Coldman
levynger wrote:
Coldman wrote:
corbin wrote:only in my repository at this stage, so something like this:

git clone https://github.com/corbinmunce/domoticz.git domoticz
I have installed from your repositary, how to I can update it, or I should installing again full version?

Sent from my MI PAD 2 using Tapatalk
I also moved from offical to corbin's git, i simply installed in a different folder and restored DB into it.
Thanks

Отправлено с моего MI PAD 2 через Tapatalk