Page 10 of 12
Re: Python Plugin: Broadlink RM2
Posted: Thursday 26 October 2017 18:31
by zak45
@macben44
maybe by copying broadlink to the right folder
" sudo cp -r /usr/local/lib/python3.4/dist-packages/Crypto/ /usr/lib/python3.4/
and
sudo cp -r /usr/local/lib/python3.4/dist-packages/broadlink /usr/lib/python3.4/
"
you need to adapt that to your installation.
Re: Python Plugin: Broadlink RM2
Posted: Thursday 26 October 2017 20:02
by macben44
I don't have repository dist-packages in /usr/local/lib/python3.5...
I had already done :
Code: Select all
sudo cp -r /usr/local/lib/python3.5/site-packages/Crypto/ /usr/lib/python3.5/
sudo cp -r /usr/local/lib/python3.5/site-packages/broadlink /usr/lib/python3.5/
same probleme but... OK I'have found ! With
Code: Select all
sudo cp -r /usr/local/lib/python3.5/site-packages/Crypto/ /usr/local/lib/python3.5/
sudo cp -r /usr/local/lib/python3.5/site-packages/broadlink /usr/local/lib/python3.5/
it's okey ! I continue...
Tks a lot !
Re: Python Plugin: Broadlink RM2
Posted: Sunday 12 November 2017 16:23
by Kruu
I have done all that but also get:
2017-11-12 16:22:06.084 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/domoticz/domoticz/plugins/broadlink/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2017-11-12 16:22:06.084 Error: (Bean) Module Import failed, exception: 'ImportError'
2017-11-12 16:22:06.084 Error: (Bean) Module Import failed: ' Name: pyaes'
Is it dist-packages or site-packages. I have done it like this:
sudo cp -r /usr/local/lib/python3.5/dist-packages/broadlink/ /usr/lib/python3.5/
sudo cp -r /usr/local/lib/python3.5/dist-packages/crypto/ /usr/lib/python3.5/
Dont no what else to try.
Re: Python Plugin: Broadlink RM2
Posted: Sunday 12 November 2017 19:07
by macben44
Hello,
Try :
sudo cp -r /usr/local/lib/python3.5/dist-packages/broadlink/ /usr/local/lib/python3.5/
sudo cp -r /usr/local/lib/python3.5/dist-packages/crypto/ /usr/local/lib/python3.5/
Re: Python Plugin: Broadlink RM2
Posted: Sunday 12 November 2017 19:26
by Kruu
Nope, the same
2017-11-12 19:24:41.481 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/domoticz/domoticz/plugins/broadlink/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2017-11-12 19:24:41.481 Error: (Bean) Module Import failed, exception: 'ImportError'
2017-11-12 19:24:41.481 Error: (Bean) Module Import failed: ' Name: pyaes'
Re: Python Plugin: Broadlink RM2
Posted: Sunday 12 November 2017 19:54
by macben44
Which is the result for :
ls -lrt /usr/local/lib/python3.5/dist-packages/broadlink/
Re: Python Plugin: Broadlink RM2
Posted: Sunday 12 November 2017 20:06
by Kruu
Here:
pi@raspberrypi:~ $ ls -lrt /usr/local/lib/python3.5/dist-packages/broadlink/
total 24
-rw-r--r-- 1 root staff 16621 Stu 12 15:55 __init__.py
drwxr-sr-x 2 root staff 4096 Stu 12 15:55 __pycache__
pi@raspberrypi:~ $
Re: Python Plugin: Broadlink RM2
Posted: Saturday 18 November 2017 15:21
by Kruu
I try it all over again and always the same. Any help appreciated.
Thanks
Re: Python Plugin: Broadlink RM2
Posted: Sunday 19 November 2017 0:35
by zak45
@Kruu
problem look like pyaes is missing.
try : sudo pip3 install pyaes
and copy it under /usr/lib/python3.5
Re: Python Plugin: Broadlink RM2
Posted: Sunday 19 November 2017 15:01
by Kruu
Thanks allot that helped, but now I am on another error :
Code: Select all
2017-11-19 14:57:40.789 Error: (Bean) Error Connecting to Broadlink device....
2017-11-19 14:57:40.795 Error: (Bean) 'onCommand' failed 'TypeError':'sequence item 0: expected str instance, bytes found'.
2017-11-19 14:57:40.795 Error: (Bean) ----> Line 158 in /home/domoticz/domoticz/plugins/broadlink/plugin.py, function onCommand
2017-11-19 14:57:40.795 Error: (Bean) ----> Line 417 in /home/domoticz/domoticz/plugins/broadlink/plugin.py, function learn
2017-11-19 14:57:40.795 Error: (Bean) ----> Line 487 in /usr/lib/python3.5/broadlink/__init__.py, function enter_learning
2017-11-19 14:57:40.795 Error: (Bean) ----> Line 258 in /usr/lib/python3.5/broadlink/__init__.py, function send_packet
2017-11-19 14:57:40.795 Error: (Bean) ----> Line 162 in /usr/lib/python3.5/broadlink/__init__.py, function encrypt_pyaes
2017-11-19 14:57:57.326 Error: (Bean) ini file not found: /home/pi/domoticz/BroadlinkRM2/BroadlinkRM2-22-254.ini
I have Broadlink Bean, but I followed all the steps for RM2 because I cant finde nothing specific for Broadlink Bean.
Re: Python Plugin: Broadlink RM2
Posted: Sunday 19 November 2017 17:23
by zak45
unfortunately, broadlink still require pycrypto.
Do the same for it (pip3), take care that folder name could be Crypto
Re: Python Plugin: Broadlink RM2
Posted: Sunday 19 November 2017 18:42
by Kruu
I installed it allready:
Code: Select all
pi@raspberrypi:~ $ sudo pip3 install Crypto
Requirement already satisfied: Crypto in /usr/local/lib/python3.5/dist-packages
Requirement already satisfied: shellescape in /usr/local/lib/python3.5/dist-packages (from Crypto)
Requirement already satisfied: Naked in /usr/local/lib/python3.5/dist-packages (from Crypto)
Requirement already satisfied: requests in /usr/lib/python3/dist-packages (from Naked->Crypto)
Requirement already satisfied: pyyaml in /usr/local/lib/python3.5/dist-packages (from Naked->Crypto)
I have it in folders
Code: Select all
/usr/local/lib/python3.5/dist-packages/Crypto
/usr/local/lib/python3.5/Crypto
/usr/lib/python3.5/Crypto
Re: Python Plugin: Broadlink RM2
Posted: Monday 20 November 2017 17:35
by zak45
Some problem with Crypto&pyaes, depend of configuration.
Have been able to reproduce the case and by removing all entry related to pyaes looks like resolved the problem.
so.. uninstall pyaes and just keep Crypto.
this is what i have on my test machine :
root@test-virtual-machine:/# find . -name 'pyaes' -print
root@test-virtual-machine:/# find . -name 'Crypto' -print
./usr/lib/python3.5/Crypto
./usr/lib/python2.7/dist-packages/Crypto
./usr/local/lib/python3.5/dist-packages/Crypto
root@test-virtual-machine:/#
Re: Python Plugin: Broadlink RM2
Posted: Monday 20 November 2017 18:56
by Kruu
Removed it and now:
Code: Select all
2017-11-20 18:55:26.800 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/domoticz/domoticz/plugins/broadlink/:/usr/lib/python35.zip:/usr/lib/python3.5:/usr/lib/python3.5/plat-arm-linux-gnueabihf:/usr/lib/python3.5/lib-dynload'.
2017-11-20 18:55:26.800 Error: (bean) Module Import failed, exception: 'ImportError'
2017-11-20 18:55:26.800 Error: (bean) Module Import failed: ' Name: pyaes'
Re: Python Plugin: Broadlink RM2
Posted: Monday 20 November 2017 19:13
by zak45
do the full search on your device and show result.
Re: Python Plugin: Broadlink RM2
Posted: Monday 20 November 2017 20:10
by Kruu
Result: No such file or directory
Re: Python Plugin: Broadlink RM2
Posted: Sunday 26 November 2017 12:26
by davidrq78
Hi guys. Can you help me to solve this problem? What should i do ?
Re: Python Plugin: Broadlink RM2
Posted: Sunday 26 November 2017 23:48
by zak45
@davidrq78
you need to adapt plugin_http.sh to your env.
in your case, this should be :
nohup python3 /home/pi/domoticz/plugins/BroadlinkRM2/plugin_http.py $1 $2 $3 &
do not forget to give +x
Re: Python Plugin: Broadlink RM2
Posted: Monday 27 November 2017 10:16
by davidrq78
zak45 wrote: ↑Sunday 26 November 2017 23:48
do not forget to give +x
What do you mean ? Where should i give +x?
Re: Python Plugin: Broadlink RM2
Posted: Monday 27 November 2017 10:31
by blacksn0w
davidrq78 wrote: ↑Monday 27 November 2017 10:16
zak45 wrote: ↑Sunday 26 November 2017 23:48
do not forget to give +x
What do you mean ? Where should i give +x?
E
xecute permissions.
chmod +x plugin_http.py