Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with the documentation #24

Open
fd025270 opened this issue Jan 8, 2020 · 3 comments
Open

Problem with the documentation #24

fd025270 opened this issue Jan 8, 2020 · 3 comments

Comments

@fd025270
Copy link

fd025270 commented Jan 8, 2020

Hello,
I setup the plugin following the documentation. It works without any issue.

But after rebooting the Pi, the switch appears in red in domoticz.

I try to troubleshoot, and i think i do something wrong with env.

Do we have to deactivate the env in the installation instruction after pip3 install -r pip_req.txt ?

I rerun manually ./test.py, and i failed (service not started?)
i try to run these command again :
cd xiaomi-mirobot
virtualenv -p python3 .env
source .env/bin/activate

and then:

pip3 install -r pip_req.txt

and then i was able to start the service and run the test.py

What did i do wrong ?

To start the service, 2 solutions :
1 - run as system service
2 - run manually

my question : is it possible start the service trhought a script and not as service ?

Thanks for your help

@fd025270
Copy link
Author

fd025270 commented Jan 8, 2020

here is the log after restarting the pi:

pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo service miio_server stop pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo service miio_server start pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ ./test.py test: python modules path: ././.env/lib/python3.5/site-packages test: trying connect to 127.0.0.1:22222 Traceback (most recent call last): File "./test.py", line 22, in <module> client = socket.create_connection((args.host, args.port)) File "/usr/lib/python3.5/socket.py", line 712, in create_connection raise err File "/usr/lib/python3.5/socket.py", line 703, in create_connection sock.connect(sa) ConnectionRefusedError: [Errno 111] Connection refused

@fd025270
Copy link
Author

fd025270 commented Jan 8, 2020

And the log to get back service operating :

pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ virtualenv -p python3 .env Already using interpreter /usr/bin/python3 Using base prefix '/usr' New python executable in /home/pi/domoticz/plugins/xiaomi-mirobot/.env/bin/python3 Not overwriting existing python script /home/pi/domoticz/plugins/xiaomi-mirobot/.env/bin/python (you must use /home/pi/domoticz/plugins/xiaomi-mirobot/.env/bin/python3) Installing setuptools, pip, wheel... done. pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ source .env/bin/activate (.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo service miio_server stop (.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ sudo service miio_server start (.env) pi@raspberrypi:~/domoticz/plugins/xiaomi-mirobot $ ./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 {'state_code': 2, 'error': None, 'clean_seconds': 1, 'battery': 93, 'clean_area': 0.0, 'cmd': 'status', 'fan_level': 75}

@fd025270
Copy link
Author

fd025270 commented Jan 8, 2020

What i am missing to get the service start correctly ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant