Python Plugin: Broadlink RM2 V3

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 RM2 V3

Post by zak45 »

leandrosaltori wrote: Friday 09 February 2018 12:35 Guys, I do not know what else to do. I was thrilled with the idea of controlling the broadlink and syncing with Xiaomi cameras and gateways, but exhausted all my test possibilities.

I have already tried to install on 2 computers (Notebook / Desktop), with Windows 10 Pro, both to no avail.

The entire installation was in administrator mode.
After all installation, the HARDWARE / BROADLINK option does not appear.

Installed Items:
- Domoticz 3.8892
- Python-3.4.0
- pycrypto-2.6.1.win32-py3.4
- setup ( broadlink )

Note: in Windows 10 several versions of Python have been tested.
Should I give up, I know the forum discussion is already old. Does anyone still use this Domoticz with broadlink?
Use it every day....
Please go to now:
viewtopic.php?f=65&t=21645
provide same informations as already requested from others + contents of your plugins directory
leandrosaltori
Posts: 23
Joined: Tuesday 06 February 2018 20:04
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by leandrosaltori »

Thank you for the support
;)
zak45 wrote: Friday 09 February 2018 17:40
leandrosaltori wrote: Friday 09 February 2018 12:35 Guys, I do not know what else to do. I was thrilled with the idea of controlling the broadlink and syncing with Xiaomi cameras and gateways, but exhausted all my test possibilities.

I have already tried to install on 2 computers (Notebook / Desktop), with Windows 10 Pro, both to no avail.

The entire installation was in administrator mode.
After all installation, the HARDWARE / BROADLINK option does not appear.

Installed Items:
- Domoticz 3.8892
- Python-3.4.0
- pycrypto-2.6.1.win32-py3.4
- setup ( broadlink )

Note: in Windows 10 several versions of Python have been tested.
Should I give up, I know the forum discussion is already old. Does anyone still use this Domoticz with broadlink?
Use it every day....
Please go to now:
viewtopic.php?f=65&t=21645
provide same informations as already requested from others + contents of your plugins directory
Lars65
Posts: 41
Joined: Thursday 14 July 2016 20:49
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by Lars65 »

Does the plugin support the newer Broadlink IHC app?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by zak45 »

Lars65 wrote: Sunday 11 February 2018 8:36 Does the plugin support the newer Broadlink IHC app?
nope
Overdrive
Posts: 2
Joined: Tuesday 20 February 2018 22:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by Overdrive »

Hi,
I've got something similar to ChopCZ has been describing in the previous page.
My setup is domoticz v3.8892 on a rasberry pi.
When I add some broadlink hardware to my setup domoticz crashes, and it continues to do so at each service restart until I remove that hardware at startup, before plugins are launched.
The crash is a segmentation fault as far as I can tell : "Error: Domoticz received fatal signal 11 !..."

I opened the broadlink python plugin and commented pretty much everything until I found it crashes when importing broadlink components.
If I comment the import the plugin loads without problem (at least it doesn't crash the all thing).
If I make a random python script outside domoticz I can however import the exact same broadlink library ! I check path so that's not the problem...

How can I tell the domoticz python environment causing the crash ? Does anyone have a clue ? I think I'm almost out of idea myself... :roll:

I see 2 last options :
- compiling domoticz with debug option but I'm kinda lazy...
- installing another domoticz version as the plugin run fine for others (any version in particular ?)

Thx
leandrosaltori
Posts: 23
Joined: Tuesday 06 February 2018 20:04
Target OS: Windows
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by leandrosaltori »

I'm trying to import the Plugins from Broadlink, but I do not know how to do it.

A unica tela que consigo é:
The attachment Learn.png is no longer available
I can connect normally to the Broadlink, however, it does not show this screen: "WebStart" "Generate" "Import" "Reset"
Learn.png
Learn.png (15.47 KiB) Viewed 3557 times
How do I display this screen?

I have the jsonSubIr, jsonButton, jsonIrCode files. But I do not know how to import them into domoticz ..
Overdrive
Posts: 2
Joined: Tuesday 20 February 2018 22:01
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by Overdrive »

Overdrive wrote: Tuesday 20 February 2018 22:21 Hi,
I've got something similar to ChopCZ has been describing in the previous page.
My setup is domoticz v3.8892 on a rasberry pi.
When I add some broadlink hardware to my setup domoticz crashes, and it continues to do so at each service restart until I remove that hardware at startup, before plugins are launched.
The crash is a segmentation fault as far as I can tell : "Error: Domoticz received fatal signal 11 !..."

I opened the broadlink python plugin and commented pretty much everything until I found it crashes when importing broadlink components.
If I comment the import the plugin loads without problem (at least it doesn't crash the all thing).
If I make a random python script outside domoticz I can however import the exact same broadlink library ! I check path so that's not the problem...

How can I tell the domoticz python environment causing the crash ? Does anyone have a clue ? I think I'm almost out of idea myself... :roll:

I see 2 last options :
- compiling domoticz with debug option but I'm kinda lazy...
- installing another domoticz version as the plugin run fine for others (any version in particular ?)

Thx
I can reply to myself : for some reason, it is the import of the random library by the broadlink plugin in "__init__.py" which causes domoticz to crash. It seems that importing that library in a python plugin through domoticz doesn't work and causes segfault.
For now I didn't took time to understand what was the point of the only "random.randrange(0xffff)" I found in the plugin so. I'm gonna need to replace it but at least plugin is loading in domoticz now...
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by zak45 »

Overdrive wrote: Wednesday 21 February 2018 10:55 I can reply to myself : for some reason, it is the import of the random library by the broadlink plugin in "__init__.py" which causes domoticz to crash. It seems that importing that library in a python plugin through domoticz doesn't work and causes segfault.
For now I didn't took time to understand what was the point of the only "random.randrange(0xffff)" I found in the plugin so. I'm gonna need to replace it but at least plugin is loading in domoticz now...
don't know if this could help :
viewtopic.php?f=65&t=21645&start=80#p172662
satanasinc
Posts: 41
Joined: Monday 19 October 2015 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Spain
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by satanasinc »

Hi!

First of all excuse my bad english, i do my best.
Im triying to install the plugin in my Raspberry Pi type b without luck. After resolving a couple of problems with th pip installer now i cant continue.
I have installed pyaes, broadlink an Cryptopy and create /home/pi/domoticz/plugins/Broadlink folder and copy in the 4 files from the wiki.
The problem is after restart and trying to add the new hardware but "Broadlink RM2 with Kodi Remote" is not in the list.

Can someone give me a trace to solve this problem. I got no idea what to do now.

My settings.
Now Domoticz V.3.8988
Python 3.2
Raspbian Wheezy

Image

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

Re: Python Plugin: Broadlink RM2 V3

Post by zak45 »

satanasinc wrote: Friday 09 March 2018 15:56 Hi!

The problem is after restart and trying to add the new hardware but "Broadlink RM2 with Kodi Remote" is not in the list.
Can someone give me a trace to solve this problem. I got no idea what to do now.

My settings.
Now Domoticz V.3.8988
Python 3.2
Raspbian Wheezy
Thanks and regards
Do you have followed this guide :
https://www.domoticz.com/wiki/Using_Python_plugins
druss67
Posts: 4
Joined: Tuesday 20 February 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8942
Location: France
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by druss67 »

Hello,
I have tried installation of Broadlink plugin for the RM mini, without any success.

my config :
Raspbian etch
version domoticz : 3.8942
version python : 3.5.3

Code: Select all

cd /home/pi/domoticz/plugins
mkdir BroadlinkRM
copy from the wiki of the following files into the BroadlinkRM folder.

Code: Select all

plugin_http.sh
plugin_http.py
plugin_send.py
plugin.py 

Code: Select all

pip3 install broadlink
pip3 install pycrypto

Code: Select all

sudo service domoticz restart
I go to Domoticz / Setup / Hardware and select Broadlink RM2 with Kodi Remote
Add, but Domoticz crashs.

In the log there is this message
2018-03-10 10:04:32.962 (RM2) Started.
2018-03-10 10:04:33.342 Error: Domoticz received fatal signal 11 !...
2018-03-10 10:04:33.346 Error: /home/pi/domoticz/domoticz() [0x246a90]
2018-03-10 10:04:33.346 Error: /home/pi/domoticz/domoticz(_Z14signal_handleri+0x4c) [0x246b48]
2018-03-10 10:04:33.346 Error: /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer+0) [0x76cce6b0]
any idea about this error, please ?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by zak45 »

druss67 wrote: Saturday 10 March 2018 13:55 Hello,
I have tried installation of Broadlink plugin for the RM mini, without any success.

my config :
Raspbian etch
version domoticz : 3.8942
version python : 3.5.3

2018-03-10 10:04:33.342 Error: Domoticz received fatal signal 11 !...

any idea about this error, please ?
I would try compile from source.
and takea look here :
viewtopic.php?f=6&t=20519&hilit=fatal+signal#p158662
satanasinc
Posts: 41
Joined: Monday 19 October 2015 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Spain
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by satanasinc »

zak45 wrote: Friday 09 March 2018 16:15
satanasinc wrote: Friday 09 March 2018 15:56 Hi!

The problem is after restart and trying to add the new hardware but "Broadlink RM2 with Kodi Remote" is not in the list.
Can someone give me a trace to solve this problem. I got no idea what to do now.

My settings.
Now Domoticz V.3.8988
Python 3.2
Raspbian Wheezy
Thanks and regards
Do you have followed this guide :
https://www.domoticz.com/wiki/Using_Python_plugins
Hi!

Thank you. I see maybe the Python version. I will try to upgrado to Raspbian Stretch.

Thanx again and regards!
druss67
Posts: 4
Joined: Tuesday 20 February 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8942
Location: France
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by druss67 »

Thanks, for the replies.

So, I have downgraded python to 3.4.4 using these commands :

Code: Select all

sudo apt-get remove python3.5
sudo apt-get autoremove
sudo apt-get install python3.4 libpython3.4 python3.4-dev
python -V
if this is not Python 3.4.4 redo the link with this command :

Code: Select all

sudo ln -s /usr/bin/python3.4 /usr/bin/python

Domoticz do not crashes, this is better :)

but I have these errors...
2018-03-10 18:36:00.499 Error: (BroadlinkRM2) failed to load 'plugin.py', Python Path used was '/home/pi/domoticz/plugins/BroadlinkRM/:/usr/lib/python3.4/:/usr/lib/python3.4/plat-arm-linux-gnueabihf:/usr/lib/python3.4/lib-dynload'.
2018-03-10 18:36:00.499 Error: (RM2) Module Import failed, exception: 'ImportError'
2018-03-10 18:36:00.499 Error: (RM2) Module Import failed: ' Name: broadlink'
2018-03-10 18:36:00.499 Error: (RM2) Error Line details not available.
druss67
Posts: 4
Joined: Tuesday 20 February 2018 21:52
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8942
Location: France
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by druss67 »

The problem was the installation of pip3, if you use this command

Code: Select all

 sudo apt-get install python3-pip
pip is installed and python 3.5 too :evil:

Anyway, I have found a solution here https://packaging.python.org/tutorials/ ... n-packages:
If pip isn’t already installed, then first try to bootstrap it from the standard library:

Code: Select all

python -m ensurepip --default-pip
If that still doesn’t allow you to run pip:

Securely Download get-pip.py https://bootstrap.pypa.io/get-pip.py

Run

Code: Select all

python get-pip.py
. This will install or upgrade pip. Additionally, it will install setuptools and wheel if they’re not installed already.

Warning
Be cautious if you’re using a Python install that’s managed by your operating system or another package manager. get-pip.py does not coordinate with those tools, and may leave your system in an inconsistent state. You can use python get-pip.py --prefix=/usr/local/ to install in /usr/local which is designed for locally-installed software.
Ensure pip, setuptools, and wheel are up to date

While pip alone is sufficient to install from pre-built binary archives, up to date copies of the setuptools and wheel projects are useful to ensure you can also install from source archives:

Code: Select all

python -m pip install --upgrade pip setuptools wheel

Code: Select all

sudo pip3 install broadlink

Code: Select all

sudo pip3 install pycrypto

Code: Select all

sudo service domoticz restart
Works for me should work for you :D
satanasinc
Posts: 41
Joined: Monday 19 October 2015 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Spain
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by satanasinc »

zak45 wrote: Friday 09 March 2018 16:15
satanasinc wrote: Friday 09 March 2018 15:56 Hi!

The problem is after restart and trying to add the new hardware but "Broadlink RM2 with Kodi Remote" is not in the list.
Can someone give me a trace to solve this problem. I got no idea what to do now.

My settings.
Now Domoticz V.3.8988
Python 3.2
Raspbian Wheezy
Thanks and regards
Do you have followed this guide :
https://www.domoticz.com/wiki/Using_Python_plugins
Hi!

Thanx for your help.
Now im trying to reinstall domoticz in a raspbian Stretch SD. Is a hard work.
Regards
satanasinc
Posts: 41
Joined: Monday 19 October 2015 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Spain
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by satanasinc »

Hi again!

After make afresh install of Stretch Raspbian and the last beta of Domoticz when y add my Broadlink s3 Domoticz crashed with "segmentation fault".
Removing the /home/pi/domotcz/pluginst/Broadlink and rebooting the pi makes Domotic work again but no way to make it work.

Raspbian Stretch full updated
Domoticz 3.9047
Python 3.5

Any idea?

Thanks for your help.

Greetings from spain.
CLEMENT99
Posts: 36
Joined: Friday 26 January 2018 9:18
Target OS: Windows
Domoticz version: BETA
Location: Brussels
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by CLEMENT99 »

satanasinc wrote: Thursday 15 March 2018 17:35 Hi again!

After make afresh install of Stretch Raspbian and the last beta of Domoticz when y add my Broadlink s3 Domoticz crashed with "segmentation fault".
Removing the /home/pi/domotcz/pluginst/Broadlink and rebooting the pi makes Domotic work again but no way to make it work.

Raspbian Stretch full updated
Domoticz 3.9047
Python 3.5

Any idea?

Thanks for your help.

Greetings from spain.
I went back to stable version :evil: after trying everything. No other solution or compile from source.
viewtopic.php?f=65&t=21645&p=173242#p173242
satanasinc
Posts: 41
Joined: Monday 19 October 2015 12:15
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.9700
Location: Spain
Contact:

Re: Python Plugin: Broadlink RM2 V3

Post by satanasinc »

CLEMENT99 wrote: Friday 16 March 2018 15:23
satanasinc wrote: Thursday 15 March 2018 17:35 Hi again!

After make afresh install of Stretch Raspbian and the last beta of Domoticz when y add my Broadlink s3 Domoticz crashed with "segmentation fault".
Removing the /home/pi/domotcz/pluginst/Broadlink and rebooting the pi makes Domotic work again but no way to make it work.

Raspbian Stretch full updated
Domoticz 3.9047
Python 3.5

Any idea?

Thanks for your help.

Greetings from spain.
I went back to stable version :evil: after trying everything. No other solution or compile from source.
viewtopic.php?f=65&t=21645&p=173242#p173242
Hi again!

Thank you for your answer clement99.
Finaly it works in domoticz, or a part at least. The main problem like clement99 says is stable version.
But now i get in the log "2018-03-17 17:26:00.816 Error: (TeleDormitorio) Get Energy error" So i cant see the power consumption.
Someone has solved this problem?.

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

Re: Python Plugin: Broadlink RM2 V3

Post by zak45 »

satanasinc wrote: Saturday 17 March 2018 8:53
Finaly it works in domoticz, or a part at least. The main problem like clement99 says is stable version.
But now i get in the log "2018-03-17 17:26:00.816 Error: (TeleDormitorio) Get Energy error" So i cant see the power consumption.
Someone has solved this problem?.
There is a problem in the version available in pypi. Download the one provided in dropbox : python-broadlink-master-0.6.zip
unzip it, go to the folder and do 'pip install .'
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest