Python Plugin: Broadlink RM2

Python and python framework
zak45
Posts: 352
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Thursday 26 October 2017 18:31

@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.

macben44
Posts: 4
Joined: Thursday 26 October 2017 9:25
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by macben44 » Thursday 26 October 2017 20:02

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 !

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Sunday 12 November 2017 17:23

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.

macben44
Posts: 4
Joined: Thursday 26 October 2017 9:25
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by macben44 » Sunday 12 November 2017 20:07

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/

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Sunday 12 November 2017 20:26

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'

macben44
Posts: 4
Joined: Thursday 26 October 2017 9:25
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by macben44 » Sunday 12 November 2017 20:54

Which is the result for :

ls -lrt /usr/local/lib/python3.5/dist-packages/broadlink/

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Sunday 12 November 2017 21:06

Here:
[email protected]:~ $ 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__
[email protected]:~ $

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Saturday 18 November 2017 16:21

I try it all over again and always the same. Any help appreciated.

Thanks

zak45
Posts: 352
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Sunday 19 November 2017 1:35

@Kruu
problem look like pyaes is missing.
try : sudo pip3 install pyaes
and copy it under /usr/lib/python3.5

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Sunday 19 November 2017 16:01

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.

zak45
Posts: 352
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Sunday 19 November 2017 18:23

unfortunately, broadlink still require pycrypto.
Do the same for it (pip3), take care that folder name could be Crypto

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Sunday 19 November 2017 19:42

I installed it allready:

Code: Select all

[email protected]:~ $ 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


zak45
Posts: 352
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Monday 20 November 2017 18:35

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 :

[email protected]:/# find . -name 'pyaes' -print
[email protected]:/# find . -name 'Crypto' -print
./usr/lib/python3.5/Crypto
./usr/lib/python2.7/dist-packages/Crypto
./usr/local/lib/python3.5/dist-packages/Crypto
[email protected]:/#

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Monday 20 November 2017 19:56

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'

zak45
Posts: 352
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Monday 20 November 2017 20:13

do the full search on your device and show result.

Kruu
Posts: 14
Joined: Tuesday 17 January 2017 21:27
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by Kruu » Monday 20 November 2017 21:10

Result: No such file or directory

davidrq78
Posts: 2
Joined: Sunday 26 November 2017 13:22
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by davidrq78 » Sunday 26 November 2017 13:26

Hi guys. Can you help me to solve this problem? What should i do ?
Image

zak45
Posts: 352
Joined: Sunday 22 January 2017 12:37
Target OS: Windows
Domoticz version: V3.8153
Contact:

Re: Python Plugin: Broadlink RM2

Post by zak45 » Monday 27 November 2017 0:48

@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

davidrq78
Posts: 2
Joined: Sunday 26 November 2017 13:22
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2

Post by davidrq78 » Monday 27 November 2017 11:16

zak45 wrote:
Monday 27 November 2017 0:48
do not forget to give +x
What do you mean ? Where should i give +x?

User avatar
blacksn0w
Posts: 116
Joined: Friday 10 March 2017 23:27
Target OS: Raspberry Pi
Domoticz version: Beta
Location: Germany
Contact:

Re: Python Plugin: Broadlink RM2

Post by blacksn0w » Monday 27 November 2017 11:31

davidrq78 wrote:
Monday 27 November 2017 11:16
zak45 wrote:
Monday 27 November 2017 0:48
do not forget to give +x
What do you mean ? Where should i give +x?
Execute permissions.
chmod +x plugin_http.py
This post was made with ♥ in Cologne. Raspberry Pi 3B (with SSD), Aeotec Z-Stick Gen5, RFLink R48, MiHome

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests