Page 4 of 16
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Sunday 26 November 2017 17:34
by mrinner
@DAVIZINHO
Try delete __pycache__ in plugin folder and stop/start domoticz... Really seems like something cached.. in latest dz plugin system sends 2 parameters instead 4 as was before.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Sunday 26 November 2017 17:59
by DAVIZINHO
mrinner wrote: ↑Sunday 26 November 2017 17:34
@DAVIZINHO
Try delete __pycache__ in plugin folder and stop/start domoticz... Really seems like something cached.. in latest dz plugin system sends 2 parameters instead 4 as was before.
thanks for the advice. done and not works.
I delete de folder with "sudo rm -Rf __pycache__" then stop/start and the problem persist

Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Monday 27 November 2017 19:14
by kurairaito
Hi,
Does this script/plugin works for the second generation (international version) or only with the first gen ?
Thanks
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Monday 27 November 2017 19:52
by mrinner
@kurairaito
I don't have 2nd, but someone said that python-miio lib works with 2nd version, so should be ok if so..
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 28 November 2017 8:26
by Quax1507
I can confirm, Domoticz V 8747 is still crashing
Code: Select all
2017-11-28 06:53:31.255 (Mi Robot EG) Sending 8 bytes of data:
2017-11-28 06:53:31.255 (Mi Robot EG) 91 a6 73 74 61 74 75 73 .. .. .. .. .. .. .. .. .. .. .. .. <91>¦status
2017-11-28 06:53:31.257 Error: /home/pi/domoticz/domoticz() [0x2336f0]
2017-11-28 06:53:31.257 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x4c) [0x2337a8]
2017-11-28 06:53:31.257 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer+0) [0x76c616b0]
Anyone an idea?
Quaxx
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 28 November 2017 9:36
by mrinner
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 28 November 2017 11:17
by napo7
It seems that every python plugin are crashing on beta version on domoticz.
I had to go back to stable, because beta has memory leaks, and python does crash.
Now you are running server outside domoticz, could you backport this to stable ?
I think it should work...
EDIT : It seems I speak a bit too quickly.
I tried the last version of plugin on stable version of domoticz.
I had to download msgpack and put it into xiaomi-robot folder. This allowed me to run the plugin correctly.
Then I ran into "onMessage takes 2 arguments..." error, so I corrected the 3 lines containing this def with the same signature than the old version of the plugin... I had one successfull update of my xiaomi devices, but then I got "Error: Domoticz received fatal signal 11" at each startup....
So, even with stable version of domoticz, I'm still having crashes.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 28 November 2017 15:12
by mrinner
@napo7
Try updated version 0.1.3 of plugin (with fixes for 3.8153).
Tested only on dev env with Ubuntu for 3.8153 and 3.8755.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 28 November 2017 15:23
by Quax1507
OK, just updated to 0.1.3 (on Domoticz 3.8755)
Will let You know if it fixes the issue...
Edit: running for about 5 hours now without issues. Keeping fingers crossed!

Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Wednesday 29 November 2017 7:11
by Quax1507
Still crashing (after about 12 hours)

Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Wednesday 29 November 2017 9:06
by mrinner
@Quax1507
0.1.3 just have fix for support 3.8153.
I also have crashes of domoticz on the last beta (RPI3) with any plugin. Only on my dev env (ubuntu 16.04) with last beta works ok.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Wednesday 29 November 2017 10:20
by Quax1507
@mrinner
So ist's a problem with the python3 libs on Stretch?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Wednesday 29 November 2017 17:07
by mrinner
@Quax1507
I think something with integration C and Python in Domoticz.
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Thursday 30 November 2017 13:24
by matteos1
how is it possible to retriew the TOKEN for robot?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Thursday 30 November 2017 13:31
by Quax1507
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Tuesday 12 December 2017 22:50
by BullHead
Hello!
When i try to runt test script during installation i get this message:
Code: Select all
pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo ./test.py
test: python modules path: ././.env/lib/python3.5/site-packages
test: trying connect to 127.0.0.1:22222
test: sent request to server [status]
test: reading response...
test: got server reply {'cmd': 'status', 'exception': 'python-miio: Unable to discover the device 192.168.1.16'}
Is there a simple solution for this?
And yes, the robot has been set to a static ip number in the router.
And yes, MiHome app is able to talk to the robot on 192.168.1.16 ip number.
EDIT:
Got it to work now.
Solution = Reboot router

Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 15 December 2017 3:13
by Noka
Hi,
Firstly thanks for your work

hope it will work for me too.
I follow all your steps, the test say everything goes fine. But when I go to domoticz I don't have any Xiaomi vacuum robot available. Don't know why...
Do you have any recommandation?
Thanks in advance
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 15 December 2017 7:39
by mrinner
@Noka
Did you add hardware with name 'Xiaomi Mi Robot Vacuum' in domoticz? If you did it - check the devices menu, all devices should be created anyway, with test or without. If test goed fine the plugin would works fine:)
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 15 December 2017 13:37
by Noka
mrinner wrote: ↑Friday 15 December 2017 7:39
@Noka
Did you add hardware with name 'Xiaomi Mi Robot Vacuum' in domoticz? If you did it - check the devices menu, all devices should be created anyway, with test or without. If test goed fine the plugin would works fine:)
When I want to add hardware I don't have the vacuum on the list. So I can't add it in domoticz :/ ! Am wrong ?
Re: Python plugin: Xiaomi Mi Robot Vacuum
Posted: Friday 15 December 2017 14:12
by napo7
Can you show us the listing of the "plugins" directory inside your domoticz installation ?
In this folder, you should have a "xiaomi-robot" folder or so. Can you also show us the content of this folder ?