Python Plugin : Broadlink RM2 V4

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 » Monday 14 May 2018 19:16

henk99 wrote:
Monday 14 May 2018 16:31
I hope this is not a silly question, but I'm uncertain about the Python role in all of this. I have ordered two SP3S units and would like to use them in Domoticz, so I ended up here. I have Domoticz running on a RP. However, the domoticz dashboard is only accessed through windows machines or my phone.

Do I need to install Python on my windows pc to be able to get this to work on my domoticz, or do I need to do something on the RP? I have already checked my domoticz dashboard, but I can't find any Broadlink in 'hardware' yet.

Is it possible that someone explains it to me in 'dummy' terms? It's fine by me if that goes through Private messages ;)
There is no silly question.. only response :-)
This need to be installed in the same place as your Domoticz Server application is, so in your case the RP.
You need to configure all to have python 3.x running first, and all step can be found in wiki and sme tips/help in the forum.

Domoticz use a Web server as main interface, this is why you can access it from Win / Mac / Linux / Android etc ... this is only the client part.

henk99
Posts: 22
Joined: Thursday 02 March 2017 12:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by henk99 » Monday 14 May 2018 22:40

Thank you for the response. Does this mean I have to type in all these commands listed in the wiki?

For others
sudo pip3 install broadlink --> mandatory
sudo pip3 install pyaes --> pycrypto no more mandatory, pyaes will be used instead
download plugin.py [2]
download plugin_send.py [3]
download plugin_http.py [4]
download plugin_http.sh [5]
these files need to be on the plugins/BroadlinkRM2 folder (chmod +x should be necessary ??)
See technical area on what is necessary.
Once all is ok, restart Domoticz

I have not dared to type these commands, because I'm afraid I will ' break' my working RP domoticz setup. I assume if I type 'download plugin.py' that RP knows where it is?

Like I said, isn't there a place that explains it more for people that have little or no knowledge of this? I says these files need to be in a certain folder, but I honestly don't know how to get them there.

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 » Monday 14 May 2018 23:15

henk99 wrote:
Monday 14 May 2018 22:40
Thank you for the response. Does this mean I have to type in all these commands listed in the wiki?
I have not dared to type these commands, because I'm afraid I will ' break' my working RP domoticz setup. I assume if I type 'download plugin.py' that RP knows where it is?

Like I said, isn't there a place that explains it more for people that have little or no knowledge of this? I says these files need to be in a certain folder, but I honestly don't know how to get them there.
And this is only the part that need to be done once you have installed python on your system.... so more work to do before.
This is also on the wiki.. but on what you say.. little bit afraid for you...
If you don't want to break your Pi and you don't know what you do... not do it !!!

henk99
Posts: 22
Joined: Thursday 02 March 2017 12:36
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by henk99 » Tuesday 15 May 2018 9:38

Oh boy :shock:

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 » Wednesday 16 May 2018 18:16

henk99 wrote:
Tuesday 15 May 2018 9:38
Oh boy :shock:
If you find someone To help you for your python i will help you after for the plugin

Salammbo
Posts: 3
Joined: Saturday 19 May 2018 10:22
Target OS: Raspberry Pi
Domoticz version:
Contact:

PI3 image with a pre-installed Domiticz including the Broadlink plugin

Post by Salammbo » Saturday 19 May 2018 10:33

Hi all,
Can someone please help me get back to a normal life by sharing a PI3 image with a pre-installed Domiticz including the Broadlink plugin?

I have tried everything in this forum a beyond during 4 days but I did not manage to make it work :( .

Your help will be much appreciated, very very much.

Thank you

User avatar
Phantom
Posts: 83
Joined: Saturday 31 December 2016 15:47
Target OS: Raspberry Pi
Domoticz version: 3.8922
Location: The Netherlands
Contact:

Re: PI3 image with a pre-installed Domiticz including the Broadlink plugin

Post by Phantom » Saturday 19 May 2018 11:50

Salammbo wrote:
Saturday 19 May 2018 10:33
Hi all,
Can someone please help me get back to a normal life by sharing a PI3 image with a pre-installed Domiticz including the Broadlink plugin?

I have tried everything in this forum a beyond during 4 days but I did not manage to make it work :( .

Your help will be much appreciated, very very much.

Thank you
Hey Salammbo, i had a lot of trouble also with getting the pluing to work with debian stretch, domoticz cept crashing as soon as i enabled the pluing.
Now i am using ubuntu and running domoticz compiled from source and it working perfectly again:
https://wiki.ubuntu.com/ARM/RaspberryPi
then under: Unofficial images
Raspberry Pi 3: ubuntu-18.04-preinstalled-server-armhf+raspi3.img.xz (4G image, 296M compressed) Updated 2018-04-28 (18.04 LTS)

Salammbo
Posts: 3
Joined: Saturday 19 May 2018 10:22
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Salammbo » Saturday 19 May 2018 13:44

Thank you Phantom. I will give it a trial.

Lasermi
Posts: 12
Joined: Thursday 02 June 2016 22:08
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Lasermi » Friday 25 May 2018 9:17

Hello all,

I'm quite stuck with the plugin. Let me see if I can summarize all the testing I have already done...

1.- I currently use Domoticz 3.9483 on Raspbian Stretch (upgraded from Jessie). I have Python 3.5.3 installed.
2.- I installed the plugin following the wiki. I noticed I got the Broadlink 0.9 library.
3.- Manually triggering a Discovery in Python works, although I needed to increase the timeout. With a 5, it wouldn't find the device.
3.- I can add the Discovery device in Domoticz HW but then it immediately crashes. Trying to restart manually domoticz shows a segmentation fault just after starting the Discovery process and initiating Openzwave.
4.- Listing Python modules provides:

Code: Select all

pi@raspberrypi:~ $ sudo pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
broadlink (0.9)
cryptography (1.7.1)
gpiozero (1.4.1)
idna (2.2)
keyring (10.1)
keyrings.alt (1.3)
mcpi (0.1.1)
numpy (1.12.1)
pgzero (1.2)
picamera (1.13)
pifacecommon (4.2.1)
pifacedigitalio (3.1.0)
Pillow (4.0.0)
pip (9.0.1)
pyaes (1.6.1)
pyasn1 (0.1.9)
PyBluez (0.22)
PyCRC (1.21)
pycrypto (2.6.1)
pygame (1.9.3)
pygobject (3.22.0)
pyserial (3.2.1)
pyxdg (0.25)
RPi.GPIO (0.6.3)
RTIMULib (7.2.1)
SecretStorage (2.3.1)
sense-hat (2.2.0)
setuptools (33.1.1)
six (1.10.0)
spidev (3.3)
wheel (0.29.0)
5.- I noticed I have Pycrypto installed. When I try to uninstall it, I get

Code: Select all

sudo pip3 uninstall pycrypto
Not uninstalling pycrypto at /usr/lib/python3/dist-packages, outside environment /usr
I could not find how to uninstall it with apt-get. I guess the trick is here but googling around didn't give me many clues. I did successfully uninstall pycryptodome but that dind't provide any improvement.
6.- Removing the plugin files or renaming them will allow Domoticz to run perfectly, but of course without broadlink plugin.

Can anybody provide any idea?
Thanks in advance!!
Lasermi

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 » Friday 25 May 2018 18:07

Lasermi wrote:
Friday 25 May 2018 9:17
Hello all,

I'm quite stuck with the plugin. Let me see if I can summarize all the testing I have already done...

1.- I currently use Domoticz 3.9483 on Raspbian Stretch (upgraded from Jessie). I have Python 3.5.3 installed.
I could not find how to uninstall it with apt-get. I guess the trick is here but googling around didn't give me many clues. I did successfully uninstall pycryptodome but that dind't provide any improvement.
6.- Removing the plugin files or renaming them will allow Domoticz to run perfectly, but of course without broadlink plugin.

Can anybody provide any idea?
Thanks in advance!!
Lasermi
maybe something like that :
sudo apt-get remove python-crypto

Lasermi
Posts: 12
Joined: Thursday 02 June 2016 22:08
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Lasermi » Friday 25 May 2018 19:12

Hi Zak45, and thank you.

Finally, I executed:

Code: Select all

 sudo apt-get remove python3-crypto 
I also ran

Code: Select all

sudo apt-get remove python3-cryptography 
Just in case, but no joy. I still get the same fault:

Code: Select all

pi@raspberrypi:~/domoticz $ sudo ./domoticz
2018-05-25 19:10:51.595  Domoticz V3.9483 (c)2012-2018 GizMoCuz
2018-05-25 19:10:51.595  Build Hash: a74f7c4a, Date: 2018-05-24 11:42:36
2018-05-25 19:10:51.595  Startup Path: /home/pi/domoticz/
2018-05-25 19:10:51.622  Sunrise: 06:40:00 SunSet: 21:17:00
2018-05-25 19:10:51.622  Day length: 14:37:00 Sun at south: 13:05:00
2018-05-25 19:10:51.622  Civil twilight start: 06:08:00 Civil twilight end: 21:48:00
2018-05-25 19:10:51.622  Nautical twilight start: 05:30:00 Nautical twilight end: 22:27:00
2018-05-25 19:10:51.622  Astronomical twilight start: 04:46:00 Astronomical twilight end: 23:11:00
2018-05-25 19:10:51.622  EventSystem: reset all events...
2018-05-25 19:10:51.710  PluginSystem: Started, Python version '3.5.3'.
2018-05-25 19:10:51.719  Active notification Subsystems: http, kodi (2/14)
2018-05-25 19:10:51.721  WebServer(HTTP) started on address: :: with port 8080
2018-05-25 19:10:51.726  WebServer(SSL) started on address: :: with port 443
2018-05-25 19:10:51.728  Proxymanager started.
2018-05-25 19:10:51.729  Camera: settings (re)loaded
2018-05-25 19:10:51.729  Accepting shared server connections via MyDomotiz (see settings menu).
2018-05-25 19:10:51.808  Starting shared server on: :::6144
2018-05-25 19:10:51.808  TCPServer: shared server started...
2018-05-25 19:10:51.809  RxQueue: queue worker started...
2018-05-25 19:10:53.309  PROXY: Authenticate result: success.
2018-05-25 19:10:53.809  Hardware Monitor: Started
2018-05-25 19:10:53.827  Wunderground: Worker started...
2018-05-25 19:10:53.828  (Broadlink_Discover) Started.
2018-05-25 19:10:53.829  EventSystem: reset all events...
2018-05-25 19:10:53.830  EventSystem: reset all device statuses...
2018-05-25 19:10:53.840  Nest: Worker started...
2018-05-25 19:10:54.124  PluginSystem: Entering work loop.
2018-05-25 19:10:54.327  OpenZWave: using config in: /home/pi/domoticz/Config/
2018-05-25 19:10:54.329 Always, OpenZwave Version 1.4.2888 Starting Up
2018-05-25 19:10:54.330  OpenZWave: Starting...
2018-05-25 19:10:54.330  OpenZWave: Version: 1.4-2888-g54682370-dirty
Violación de segmento
That is... segment violation. Any ideas?

HarleyZard
Posts: 9
Joined: Tuesday 24 April 2018 22:28
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by HarleyZard » Saturday 26 May 2018 22:21

Hi Lasermi,

I think it isn't possible to use this plugin in Raspberry with raspbian...
I tried a lot of times, and I never succeeded :? :?

If you find a solution I'll be very very interested...

I've the same log as you when I create a new material with this plugin :
pi@raspberrypi:~/domoticz $ sudo ./domoticz
2018-05-26 22:02:54.389 Domoticz V3.9476 (c)2012-2018 GizMoCuz
2018-05-26 22:02:54.389 Build Hash: 0747e583, Date: 2018-05-23 15:11:16
2018-05-26 22:02:54.390 Startup Path: /home/pi/domoticz/
2018-05-26 22:02:54.587 Sunrise: 05:46:00 SunSet: 21:44:00
2018-05-26 22:02:54.587 Day length: 15:58:00 Sun at south: 13:05:00
2018-05-26 22:02:54.587 Civil twilight start: 05:03:00 Civil twilight end: 22:27:00
2018-05-26 22:02:54.587 Nautical twilight start: 04:03:00 Nautical twilight end: 23:27:00
2018-05-26 22:02:54.587 Astronomical twilight start: 02:09:00 Astronomical twilight end: 01:21:00
2018-05-26 22:02:54.587 EventSystem: reset all events...
2018-05-26 22:02:55.243 PluginSystem: Started, Python version '3.5.3'.
2018-05-26 22:02:55.252 Active notification Subsystems: (0/14)
2018-05-26 22:02:55.295 WebServer(HTTP) started on address: :: with port 8080
2018-05-26 22:02:55.349 WebServer(SSL) started on address: :: with port 443
2018-05-26 22:02:55.350 Proxymanager started.
2018-05-26 22:02:55.354 Starting shared server on: :::6144
2018-05-26 22:02:55.354 TCPServer: shared server started...
2018-05-26 22:02:55.354 RxQueue: queue worker started...
2018-05-26 22:02:57.355 (MyBR) Started.
2018-05-26 22:02:57.355 EventSystem: reset all events...
2018-05-26 22:02:57.356 EventSystem: reset all device statuses...
2018-05-26 22:02:57.507 Python EventSystem: Initalizing event module.
2018-05-26 22:02:57.508 EventSystem: Started
2018-05-26 22:02:57.508 EventSystem: Queue thread started...
2018-05-26 22:02:57.656 PluginSystem: Entering work loop.
Erreur de segmentation
pi@raspberrypi:~/domoticz $

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 » Saturday 26 May 2018 22:42

@Lasermi

do you have tried to compile domoticz from source ?

Lasermi
Posts: 12
Joined: Thursday 02 June 2016 22:08
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Lasermi » Sunday 27 May 2018 15:44

Hi @zak45.
I originally installed domoticz on Raspbian Jessie some time ago, using the easy install. I since upgraded to Stretch and updated various times with sudo ./updatebeta
Do you think result could be different and I should give it a try?
Thanks!

Enviado desde mi FRD-L19 mediante Tapatalk


HarleyZard
Posts: 9
Joined: Tuesday 24 April 2018 22:28
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by HarleyZard » Sunday 27 May 2018 18:54

Hi Zak45,

I have compiled domoticz without do updatebeta, and I've the same issue... :cry:

Do you try Lasermi ?

HarleyZard

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 » Sunday 27 May 2018 22:16

HarleyZard wrote:
Sunday 27 May 2018 18:54
Hi Zak45,

I have compiled domoticz without do updatebeta, and I've the same issue... :cry:

Do you try Lasermi ?

HarleyZard
Do you have read the wiki https://www.domoticz.com/wiki/Using_Python_plugins
Looks like sometimes problem with python 3.5.x

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

Re: Python Plugin : Broadlink RM2 V4

Post by zak45 » Sunday 27 May 2018 22:20

Lasermi wrote:
Sunday 27 May 2018 15:44
Hi @zak45.
I originally installed domoticz on Raspbian Jessie some time ago, using the easy install. I since upgraded to Stretch and updated various times with sudo ./updatebeta
Do you think result could be different and I should give it a try?
Thanks!

Enviado desde mi FRD-L19 mediante Tapatalk
see wiki https://www.domoticz.com/wiki/Using_Python_plugins
maybe first try python 3.4

Lasermi
Posts: 12
Joined: Thursday 02 June 2016 22:08
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Lasermi » Sunday 27 May 2018 23:01

Hi @Zak45.
You are right, that was the problem. I had gone through that wiki page and it didn't work. However, a different thread on the forum gave me the final clue. Apparently the hints given in the wiki to change versions don't work. Domoticz for some reason always uses the highest Python version. I had not checked after switching to 3.4 and that was my mistake. Domoticz was still using 3.5. Removing it conpletely and installing only 3.4 did the trick.
Thank you so much!
Best regards from Spain!!

Enviado desde mi FRD-L19 mediante Tapatalk


Lasermi
Posts: 12
Joined: Thursday 02 June 2016 22:08
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by Lasermi » Monday 28 May 2018 0:35

Lasermi wrote:Hi @Zak45.
You are right, that was the problem. I had gone through that wiki page and it didn't work. However, a different thread on the forum gave me the final clue. Apparently the hints given in the wiki to change versions don't work. Domoticz for some reason always uses the highest Python version. I had not checked after switching to 3.4 and that was my mistake. Domoticz was still using 3.5. Removing it conpletely and installing only 3.4 did the trick.
Thank you so much!
Best regards from Spain!!

Enviado desde mi FRD-L19 mediante Tapatalk
Note edited: How to uninstall Python 3.5 without breaking the whole system is mentioned here:
viewtopic.php?f=65&t=23508
That is:

Code: Select all

sudo apt-get install python3.4 libpython3.4 python3.4-dev
sudo apt-get remove python3-dev
sudo apt-get autoremove
I now need to re-install all python modules.
This seems to at least let Domoticz start but there are still issues. I will post more progress soon...

HarleyZard
Posts: 9
Joined: Tuesday 24 April 2018 22:28
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Python Plugin : Broadlink RM2 V4

Post by HarleyZard » Tuesday 29 May 2018 9:14

zak45 wrote:
Sunday 27 May 2018 22:16
Do you have read the wiki https://www.domoticz.com/wiki/Using_Python_plugins
Looks like sometimes problem with python 3.5.x
Hi Zak45,

I've downgraded to python3.4 and it's ok, now ;) ;) ;)
=> Domoticz write it use Python 3.4 and I've not the "segmentation fault" when the plugin is started.

Thanks for your help, and thanks for your plugin !

I'll now use it.

Thanks.

Post Reply

Who is online

Users browsing this forum: htilly, l0gic, misko903 and 5 guests