Python Plugin : Broadlink

Python and python framework

Moderator: leecollings

zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Code: Select all

2022-01-28 08:17:54.728 Error: Broadlink TV slaapkamer: ERR : remote_plugin--_Error receive / save file from Cloud Drive : 
Maybe try to see if you have enough rights on the plugin directory ?
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink

Post by kollemt »

Thanks for your help. Below the access rights. Can you see anything what needs to be changed?

drwxr-xr-x 11 pi pi 4096 Jan 28 20:17 domoticz
drwxr-xr-x 7 pi pi 4096 Nov 9 2020 plugins
drwxr-xr-x 9 pi pi 4096 Dec 13 20:31 Broadlink

drwxr-xr-x 9 pi pi 4096 Dec 13 20:31 .
drwxr-xr-x 7 pi pi 4096 Nov 9 2020 ..
-rwxr-xr-x 1 root root 7840 Dec 13 20:04 broadlink_cli.py
-rwxr-xr-x 1 root root 1452 Dec 13 20:04 broadlink_discovery.py
-rwxr-xr-x 1 root root 34987 Dec 13 20:04 Dombroadlink.py
drwxr-xr-x 4 pi pi 4096 Dec 14 15:48 ini
drwxr-xr-x 2 root root 4096 Dec 13 20:04 lng
drwxr-xr-x 2 pi pi 4096 Dec 14 08:41 log
-rwxr-xr-x 1 root root 213722 Dec 13 20:04 plugin.py
drwxr-x--- 2 root root 4096 Dec 13 20:15 __pycache__
drwxr-xr-x 4 root root 4096 Dec 13 20:04 python-broadlink-master
-rw-r--r-- 1 root root 4350 Dec 13 20:04 README.md
drwxr-xr-x 2 root root 4096 Dec 13 20:04 scr
-rwx--x--x 1 pi pi 9129 Dec 13 20:04 setup.py
-rw-r----- 1 root root 213722 Jan 28 14:53 tst-plugin
drwxr-xr-x 5 root root 4096 Dec 13 20:04 web
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Really not linux specialist but maybe put 777 on the Broadlink folder (recursive)?!
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink

Post by kollemt »

did chmod 777 for the Broadlink folder and all files in the folder.
Still get :
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: (Broadlink) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/Broadlink/:/usr/lib/python37.zip:/usr/lib/python3.7:/usr/lib/python3.7/lib-dynload:/usr/local/lib/python3.7/dist-packages:/usr/lib/python3/dist-packages:/usr/lib/python3.7/dist-packages'.
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: Module Import failed, exception: 'InternalError'
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: Error Line details not available.
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: Exception traceback:
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 129 in '/home/pi/domoticz/plugins/Broadlink/plugin.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 12 in '/usr/local/lib/python3.7/dist-packages/requests_toolbelt/__init__.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 12 in '/usr/local/lib/python3.7/dist-packages/requests_toolbelt/adapters/__init__.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 12 in '/usr/local/lib/python3.7/dist-packages/requests_toolbelt/adapters/ssl.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 55 in '/usr/lib/python3/dist-packages/requests/__init__.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 59 in '/usr/lib/python3/dist-packages/requests/packages/__init__.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 49 in '/usr/lib/python3/dist-packages/requests/packages/__init__.py', function vendored
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 47 in '/usr/lib/python3/dist-packages/urllib3/contrib/pyopenssl.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 8 in '/usr/lib/python3/dist-packages/OpenSSL/__init__.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 12 in '/usr/lib/python3/dist-packages/OpenSSL/rand.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 6 in '/usr/lib/python3/dist-packages/OpenSSL/_util.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 195 in '/usr/local/lib/python3.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py', function <module>
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 151 in '/usr/local/lib/python3.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py', function init_static_locks
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 134 in '/usr/local/lib/python3.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py', function _ensure_ffi_initialized
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 120 in '/usr/local/lib/python3.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py', function _register_osrandom_engine
2022-01-28 23:37:10.633 Error: Broadlink TV woonkamer: ----> Line 78 in '/usr/local/lib/python3.7/dist-packages/cryptography/hazmat/bindings/openssl/binding.py', function _openssl_assert

NB !!
I have created two Broadlink hardware components, one for the Slaapkamer tv and one for the Woonkamer tv.
I noticed that the error at startup only happens randomly for one tv. In the above only for the Woonkamer tv.
The startup for the Slaapkamer tv does not give any problem. However at a next reboot the error could come for the Slaapkamer tv.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Humm.. and did you access the same Broadlink hardware, I mean.. do you have one or two Broadlink devices ?
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink

Post by kollemt »

I have two Broadlink devices, one in front of the Woonkamer tv and one in front of the Slaapkamer tv.
Both do work fine. Only have after reboot to deactivate and then to activate the hardware of the Broadlink which gave the error.
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

ok, strange ...
looks like problem related to cryptography module.

Please, show your python module list:
sudo pip3 list ( something like that ...)
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink

Post by kollemt »

See below the pip3 list.
A suggestion: could the problem be caused by the fact that two hardwares, one for the Slaapkamer broadlink device and one for the Woonkamer
Broadlink device are use the same plugins/broadlink directory and maybe a simultaneous start by Domotics of the two hardwares does cause the error ?

pi@raspberrypi:~ $ sudo pip3 list
Package Version
----------------- -----------
asyncio 3.4.3
automationhat 0.2.0
blinker 1.4
blinkt 0.1.2
broadlink 0.14.1
buttonshim 0.0.2
Cap1xxx 0.1.3
certifi 2021.10.8
cffi 1.14.0
chardet 3.0.4
Click 7.0
colorama 0.3.7
cryptography 2.8
drumhat 0.1.0
envirophat 1.0.0
ExplorerHAT 0.4.2
Flask 1.0.2
fourletterphat 0.1.0
googletrans 3.0.0
gpiozero 1.4.1
h11 0.9.0
h2 3.2.0
hpack 3.0.0
hstspreload 2021.12.1
httpcore 0.9.1
httpx 0.13.3
hyperframe 5.2.0
idna 2.6
irgen 0.2.0
itsdangerous 0.24
jedi 0.10.2
Jinja2 2.10
keyring 10.1
keyrings.alt 3.1.1
MarkupSafe 1.1.0
microdotphat 0.2.1
mote 0.0.4
motephat 0.0.3
numpy 1.16.2
oauthlib 2.1.0
pantilthat 0.0.7
pgzero 1.2
phatbeat 0.1.1
pianohat 0.1.0
picamera 1.13
picraft 1.0
piglow 1.2.5
pigpio 1.44
Pillow 5.4.1
pip 18.1
pyaes 1.6.1
pyasn1 0.4.2
pycparser 2.19
pycrc 0.9.2
pycrypto 2.6.1
pygame 1.9.4.post1
PyGObject 3.30.4
pyinotify 0.9.6
PyJWT 1.7.0
pyOpenSSL 16.2.0
pyserial 3.4
python-apt 1.8.4.1
pyxdg 0.25
rainbowhat 0.1.0
requests 2.12.4
requests-oauthlib 1.0.0
requests-toolbelt 0.9.1
rfc3986 1.5.0
RPi.GPIO 0.7.0
RTIMULib 7.2.1
scrollphat 0.0.7
scrollphathd 1.2.1
SecretStorage 2.3.1
sense-emu 1.1
sense-hat 2.2.0
setuptools 40.8.0
simplejson 3.16.0
six 1.12.0
skywriter 0.0.7
sn3218 1.2.7
sniffio 1.2.0
spidev 3.4
thonny 2.1.16
touchphat 0.0.1
twython 3.4.0
unicornhathd 0.0.4
urllib3 1.19.1
Werkzeug 0.14.1
wheel 0.32.3
Attachments
13C2809C-8DE7-463A-8623-2E007118E5D3.jpeg
13C2809C-8DE7-463A-8623-2E007118E5D3.jpeg (82.55 KiB) Viewed 1898 times
BD48E1E7-8CEC-4175-B225-2DAB7FA7A92F.jpeg
BD48E1E7-8CEC-4175-B225-2DAB7FA7A92F.jpeg (265.01 KiB) Viewed 1898 times
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

Ok, thanks.
To have several times the plugin should not be a problem (but not have been able to test it).
Maybe upgrade your cryptography module to see if it's better :

sudo pip3 install cryptography --upgrade
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink

Post by kollemt »

Did the recommended upgrade but now the Broadlinks do not work at all.
I go back to the previous cryptography version
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

try this one :
pip install cryptography==3.4.6
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink

Post by kollemt »

Done.
Same oroblem. Broadlink no longer works
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

...no more idea for the moment :(
kollemt
Posts: 29
Joined: Monday 18 February 2019 20:41
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.1
Contact:

Re: Python Plugin : Broadlink

Post by kollemt »

Is there anybody who has two or more Broadlink devices connected succesfully to Domoticz on a Raspberry pi using the plugin created by Zak45?
My feeling is that having two Broadlink hardware devices defined in Domoticz, using the same plugins/Broadlink directory is causing problems.
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Python Plugin : Broadlink

Post by DAVIZINHO »

hello to all
i bought a broadklink rm4 pro today and im trying to conect to my domoticz in docker (oficial docker image).
I modify some things:
- on the setup.py (remove the sudo, because in docker the sudo not works).
- create manually de log folder in the plugin folder

and seems to work, i can acces to the portal in port 9000 and apears in the custom seccion (my docker is in host network)

the problem for me is i run the broadklink_discovery.py and returns a device thant not apears in the combo to overwrite it in domoticz.
the device type is 0x649b

any help with this?
thanks a lot!

EDIT:
when the setup.py launch this comand "python -m pip install python-broadlink-master/." it install the python-broadlink version 0.14.1 but if i go to https://github.com/mjg59/python-broadlink i can see that the master version is = "0.18.0"
is this correct?
or im making something wrong?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DAVIZINHO wrote: Wednesday 02 February 2022 17:46 when the setup.py launch this comand "python -m pip install python-broadlink-master/." it install the python-broadlink version 0.14.1 but if i go to https://github.com/mjg59/python-broadlink i can see that the master version is = "0.18.0"
is this correct?
or im making something wrong?
Correct.
the problem for me is i run the broadklink_discovery.py and returns a device thant not apears in the combo to overwrite it in domoticz.
the device type is 0x649b
Do you have tried with the default value ? or maybe some others ?
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Python Plugin : Broadlink

Post by DAVIZINHO »

zak45 wrote: Thursday 03 February 2022 0:17 Do you have tried with the default value ? or maybe some others ?
yes, but not change. i aply a rm4pro, but nothing ocurs, no change :-(

why the version is diferent? , its posible that this was my problem?
its posible to update the version?
maybe my problem is the ini file in the remote folder is a file empty (not empty but only this:
[Custom]
command = 0,
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DAVIZINHO wrote: Thursday 03 February 2022 0:21 why the version is diferent? , its posible that this was my problem?
its posible to update the version?
- Plugin has been made with this version.
- This is the problem, have seen that on new one this device has been added.
- yes, with some time.
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Python Plugin : Broadlink

Post by DAVIZINHO »

zak45 wrote: Thursday 03 February 2022 0:27
DAVIZINHO wrote: Thursday 03 February 2022 0:21 why the version is diferent? , its posible that this was my problem?
its posible to update the version?
- Plugin has been made with this version.
- This is the problem, have seen that on new one this device has been added.
- yes, with some time.
ok thanks for the reply!.
tomorrow i will try with the cli and try to launch the rf comands with the cli. if this works i can use scripts for my use.
thanks again
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin : Broadlink

Post by zak45 »

DAVIZINHO wrote: Thursday 03 February 2022 0:30 tomorrow i will try with the cli and try to launch the rf comands with the cli. if this works i can use scripts for my use.
Great, let us know if this work.. should help others.
Have seen that version 0.18.0 has been there still long time... will try to update the plugin
but there is a lot of "breaking" changes ..; !!! :(
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest