zaraki673 / MiPow-PlayBulb

Mipow Playbulb plugin for Domoticz
1 stars 4 forks source link

Error on latest rasbian & latest domoticz #3

Open mecrip opened 7 years ago

mecrip commented 7 years ago

Hello!

I'm trying to use this plugin with a fresh install of jessie & domoticz on a raspberry (using colorpicker). I followed the instructions, but I get this error: 2017-09-02 08:50:13.485 Error: (Playbulb1) ----> Line 487 in /home/mirko/domoticz/plugins/mipow/plugin.py, function onCommand 2017-09-02 08:50:13.485 Error: (Playbulb1) ----> Line 189 in /home/mirko/domoticz/plugins/mipow/plugin.py, function onCommand 2017-09-02 08:50:15.990 Error: (Playbulb1) 'onCommand' failed 'NameError':'name 'Swhite' is not defined'. on every device that appears in domoticz..

Any hints?

zaraki673 commented 7 years ago

i will check, (hope this next week)

poudenes commented 7 years ago

Got same error as mecrip.

Also when did a clear install of OSMC OS with Domoitcz.

Would be great to let the colorpicker work on Domoticz latest stable and or beta version with Raspbian.

Beside: GREAT JOB already for this plugin creation

poudenes commented 7 years ago

I see you updated the plugin. Is het a requirement to have Python 3.5 installed and bluepy from source?

"install bluepy first (https://github.com/IanHarvey/bluepy - install it from source)

then you should need to make a symlink : sudo ln -s /usr/local/lib/python3.5/dist-packages/bluepy /usr/lib/python3.5/"

I installed all the time bluepy using :

sudo pip3 install bluepy sudo ln -s /usr/local/lib/python3.4/dist-packages/bluepy /usr/lib/python3.4/bluepy

Can you confirm?

meanwhile did a clear install: Latest Raspbian Latest Domoticz sable version the source install of bluepy used the latest colorpicker script

get errors. does not work. What you did to let it work?

zaraki673 commented 7 years ago

Only RGBW as been update, you can use Python3.4 or Python3.5 as you want

;)

2017-09-06 11:21 GMT+02:00 poudenes notifications@github.com:

I see you updated the plugin. Is het a requirement to have Python 3.5 installed and bluepy from source?

"install bluepy first (https://github.com/IanHarvey/bluepy - install it from source)

then you should need to make a symlink : sudo ln -s

/usr/local/lib/python3.5/dist-packages/bluepy /usr/lib/python3.5/"

I installed all the time bluepy using :

sudo pip3 install bluepy sudo ln -s /usr/local/lib/python3.4/dist-packages/bluepy /usr/lib/python3.4/bluepy

Can you confirm? Meanwhile im now config whole new sdcard with latest domoticz and Raspbian and the python 3.5 and bluepy source

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3#issuecomment-327426754, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7B30zqlrr8_3rhA68J9Yv5AcoEIbks5sfmQjgaJpZM4PK0nS .

poudenes commented 7 years ago

Will you also try to let the color picker work? Would be great to have that one instead of 4 devices for color :))

Verstuurd vanaf mijn iPhone

Op 6 sep. 2017 om 14:16 heeft zaraki673 notifications@github.com het volgende geschreven:

Only RGBW as been update, you can use Python3.4 or Python3.5 as you want

;)

2017-09-06 11:21 GMT+02:00 poudenes notifications@github.com:

I see you updated the plugin. Is het a requirement to have Python 3.5 installed and bluepy from source?

"install bluepy first (https://github.com/IanHarvey/bluepy - install it from source)

then you should need to make a symlink : sudo ln -s

/usr/local/lib/python3.5/dist-packages/bluepy /usr/lib/python3.5/"

I installed all the time bluepy using :

sudo pip3 install bluepy sudo ln -s /usr/local/lib/python3.4/dist-packages/bluepy /usr/lib/python3.4/bluepy

Can you confirm? Meanwhile im now config whole new sdcard with latest domoticz and Raspbian and the python 3.5 and bluepy source

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3#issuecomment-327426754, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7B30zqlrr8_3rhA68J9Yv5AcoEIbks5sfmQjgaJpZM4PK0nS .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

zaraki673 commented 7 years ago

Yes, i'm on it :D

2017-09-06 14:23 GMT+02:00 poudenes notifications@github.com:

Will you also try to let the color picker work? Would be great to have that one instead of 4 devices for color :))

Verstuurd vanaf mijn iPhone

Op 6 sep. 2017 om 14:16 heeft zaraki673 notifications@github.com het volgende geschreven:

Only RGBW as been update, you can use Python3.4 or Python3.5 as you want

;)

2017-09-06 11:21 GMT+02:00 poudenes notifications@github.com:

I see you updated the plugin. Is het a requirement to have Python 3.5 installed and bluepy from source?

"install bluepy first (https://github.com/IanHarvey/bluepy - install it from source)

then you should need to make a symlink : sudo ln -s

/usr/local/lib/python3.5/dist-packages/bluepy /usr/lib/python3.5/"

I installed all the time bluepy using :

sudo pip3 install bluepy sudo ln -s /usr/local/lib/python3.4/dist-packages/bluepy /usr/lib/python3.4/bluepy

Can you confirm? Meanwhile im now config whole new sdcard with latest domoticz and Raspbian and the python 3.5 and bluepy source

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3# issuecomment-327426754, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7B30zqlrr8_ 3rhA68J9Yv5AcoEIbks5sfmQjgaJpZM4PK0nS .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3#issuecomment-327466610, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7CL1JZ-bErmROShXxGGREX7-ck7Hks5sfo67gaJpZM4PK0nS .

poudenes commented 7 years ago

Rasbian Stretch Python 3.5 Domoticz latest stable

2017-09-06 13:35:05.609 (Candle) Initialized version 1.0.1, author 'zaraki673' 2017-09-06 13:35:05.619 (Candle) Not connect. 2017-09-06 13:35:05.620 (Candle) Plugin is started. 2017-09-06 13:35:11.340 User: Admin initiated a switch command (1/Candle - Status/On) 2017-09-06 13:35:11.381 (Candle) Error sending BT command 2017-09-06 13:35:11.393 (Candle) ERROR when setting plug On or Off 2017-09-06 13:35:11.394 (Candle) Error getting status 2017-09-06 13:35:11.407 (Candle) error while get status 2017-09-06 13:35:11.416 (Candle) Update 1:'on' SignalLevel:12 batteryLevel:'0%' (Candle - Status) 2017-09-06 13:35:11.419 (Candle) Update 1:'100' SignalLevel:12 batteryLevel:'0%' (Candle - Red) 2017-09-06 13:35:11.422 (Candle) Update 1:'100' SignalLevel:12 batteryLevel:'0%' (Candle - Green) 2017-09-06 13:35:11.425 (Candle) Update 1:'100' SignalLevel:12 batteryLevel:'0%' (Candle - Blue) 2017-09-06 13:35:11.434 (Candle) Update 1:'100' SignalLevel:12 batteryLevel:'0%' (Candle - White) 2017-09-06 13:35:15.153 (Candle) Not connect.

zaraki673 commented 7 years ago

shut down then up your candle (try with hctitool lescan to see it)

poudenes commented 7 years ago

Great work already !!! You make some great improvements!!

RGB Plugin _

Rasbian Jessy Python 3.4 Latest stable Domoticz 3.8153 1 Candle for testing

Everything seems to work. After shutdown Domoticz i get this error. After restart the candle still works.

2017-09-07 11:23:05.958  Error: (Candle) 'onStop' failed 'BrokenPipeError'.
2017-09-07 11:23:05.958  Error: (Candle) ----> Line 397 in /home/pi/domoticz/plugins/mipow-rgb/plugin.py, function onStop
2017-09-07 11:23:05.958  Error: (Candle) ----> Line 175 in /home/pi/domoticz/plugins/mipow-rgb/plugin.py, function onStop
2017-09-07 11:23:05.958  Error: (Candle) ----> Line 562 in /home/pi/domoticz/plugins/mipow-rgb/plugin.py, function disconnect
2017-09-07 11:23:05.958  Error: (Candle) ----> Line 416 in /usr/lib/python3.4/bluepy/btle.py, function disconnect
2017-09-07 11:23:05.958  Error: (Candle) ----> Line 268 in /usr/lib/python3.4/bluepy/btle.py, function _writeCmd
Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 1292, in _shutdown
    t = _pickSomeNonDaemonThread()
  File "/usr/lib/python3.4/threading.py", line 1299, in _pickSomeNonDaemonThread
    for t in enumerate():
  File "/usr/lib/python3.4/threading.py", line 1269, in enumerate
    return list(_active.values()) + list(_limbo.values())
TypeError: bad argument type for built-in operation
2017-09-07 11:23:06.248  (Candle) Exiting work loop...
2017-09-07 11:23:06.248  (Candle) Stopped.

_

Colorpicker Plugin

Rasbian Jessy Python 3.4 Latest stable Domoticz 3.8153 1 Candle for testing

Everything seems to work. After shutdown Domoticz i get this error. After restart the candle still works.


2017-09-07 11:32:03.374  Error: (Hal) 'onStop' failed 'BrokenPipeError.
2017-09-07 11:32:03.374  Error: (Hal) ----> Line 388 in /home/pi/domoticz/plugins/mipow-cp/plugin.py, function onStop
2017-09-07 11:32:03.374  Error: (Hal) ----> Line 167 in /home/pi/domoticz/plugins/mipow-cp/plugin.py, function onStop
2017-09-07 11:32:03.374  Error: (Hal) ----> Line 538 in /home/pi/domoticz/plugins/mipow-cp/plugin.py, function disconnect
2017-09-07 11:32:03.374  Error: (Hal) ----> Line 416 in /usr/lib/python3.4/bluepy/btle.py, function disconnect
2017-09-07 11:32:03.374  Error: (Hal) ----> Line 268 in /usr/lib/python3.4/bluepy/btle.py, function _writeCmd
Exception ignored in: <module 'threading' from '/usr/lib/python3.4/threading.py'>
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 1292, in _shutdown
    t = _pickSomeNonDaemonThread()
  File "/usr/lib/python3.4/threading.py", line 1299, in _pickSomeNonDaemonThread
    for t in enumerate():
  File "/usr/lib/python3.4/threading.py", line 1269, in enumerate
    return list(_active.values()) + list(_limbo.values())
TypeError: bad argument type for built-in operation
2017-09-07 11:32:03.510  (Hal) Exiting work loop...
2017-09-07 11:32:03.529  (Hal) Stopped.```

Creating a scene with colorpicker won't work. When you activate the scene the bulb goes on in white and not the given color

zaraki673 commented 7 years ago

error are in bluepy, i can't do anything,

have you install bluepy from source ?

2017-09-07 13:39 GMT+02:00 poudenes notifications@github.com:

Creating a scene with colorpicker won't work. When you activate the scene the bulb goes on in white and not the given color

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3#issuecomment-327774451, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7BZZvPM04Q908SK2njHaSGs16NNqks5sf9XcgaJpZM4PK0nS .

poudenes commented 7 years ago

Ok. If the error won't hurt the domoticz config than its ok :)

I used this:

sudo apt-get install python3-pip libglib2.0-dev
sudo pip3 install bluepy    
sudo ln -s /usr/local/lib/python3.4/dist-packages/bluepy /usr/lib/python3.4/bluepy

So if i installed from source the scene will work or the error will gonna away?

zaraki673 commented 7 years ago

yes i have the same issue when i install from pip

2017-09-07 14:52 GMT+02:00 poudenes notifications@github.com:

Ok. If the error won't hurt the domoticz config than its ok :)

I used this:

sudo apt-get install python3-pip libglib2.0-dev sudo pip3 install bluepy sudo ln -s /usr/local/lib/python3.4/dist-packages/bluepy /usr/lib/python3.4/bluepy

So if i installed from source the scene will work or the error will gonna away?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3#issuecomment-327789807, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7MspNt9Ix8kLllrfZSIvbqYlFA6Iks5sf-cFgaJpZM4PK0nS .

zaraki673 commented 7 years ago

you need to delete your old hardware and create them again

poudenes commented 7 years ago

Deleted all mipow bulbs and reboot domoticz. then add them again. After reboot Domoticz i get this error:

2017-09-08 19:14:07.852  (Candle 3) Initialized version 1.0.2, author 'zaraki673'
2017-09-08 19:14:08.113  (Candle 2) Initialized version 1.0.2, author 'zaraki673'
2017-09-08 19:14:08.366  (Candle 1) Initialized version 1.0.2, author 'zaraki673'
2017-09-08 19:14:08.420  Error: Domoticz received fatal signal 11 !...
2017-09-08 19:14:08.425  Error:   /home/pi/domoticz/domoticz() [0x1cdc48]
2017-09-08 19:14:08.426  Error:   /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1cdd00]
2017-09-08 19:14:08.426  Error:   /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76a85180]

After this removed whole database and add the bulbs 1 by 1 and add devices. See some unexpected errors but everything still work. So seems it needed to build the whole domoticz config totally new....

poudenes commented 7 years ago

I tried this. This gives a advanced bluetooth option in gui and you can trust bluetooth devices. Add all bulbs as trusted. When start domoticz it take some time to let work all bulbs.

It will not start always correct get some errors see below.

sudo apt-get install pi-bluetooth
sudo apt-get install bluez bluez-firmware
sudo apt-get install blueman
sudo usermod -G bluetooth -a pi
cat /etc/group | grep bluetooth
sudo apt-get --reinstall install pi-bluetooth
reboot now -h

I have isolated the error below of post. When i use 1 Spot (BTL201m v1.6) and one Smart (BTL201m v1.6) everything work great. When i add a second Smart (BTL201m v1.8) it crash. I have 4 BTL201m v1.8 and 1 BTL201m v1.6)

I have a excel sheet with all the handles for the BTL201m v1.8. You send me the command to get them. I can send them to you. Maybe you can add this version into plugin as well and maybe the problems are gone ...

2017-09-09 11:37:24.392  Error: Domoticz received fatal signal 11 !...
2017-09-09 11:37:24.393  Error: Domoticz received fatal signal 11 while backtracing !...
2017-09-09 11:37:24.394  Error:   /home/pi/domoticz/domoticz() [0x1cdc48]
2017-09-09 11:37:24.394  Error:   /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1cdd00]
2017-09-09 11:37:24.394  Error:   /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76ad2180]
poudenes commented 7 years ago

I got a more specific error:

2017-09-11 10:26:35.878  Error: Domoticz received fatal signal 11 !...
2017-09-11 10:26:35.879  Error: (MiPowRGB) failed to add unit '1' to device dictionary.
2017-09-11 10:26:35.879  Error: (Raam Links) 'onStart' failed 'TypeError':'object of type 'traceback' has no len()'.
2017-09-11 10:26:35.879  Error: (Raam Links) ----> Line 393 in /home/pi/domoticz/plugins/mipow-rgb/plugin.py, function onStart
2017-09-11 10:26:35.879  Error: (Raam Links) ----> Line 88 in /home/pi/domoticz/plugins/mipow-rgb/plugin.py, function onStart
2017-09-11 10:26:35.881  Error: Domoticz received fatal signal 11 while backtracing !...
2017-09-11 10:26:35.881  Error:   /home/pi/domoticz/domoticz() [0x1cdc48]
2017-09-11 10:26:35.881  Error:   /home/pi/domoticz/domoticz(_Z14signal_handleri+0x58) [0x1cdd00]
2017-09-11 10:26:35.881  Error:   /lib/arm-linux-gnueabihf/libc.so.6(__default_sa_restorer_v2+0) [0x76a5e180]

Try start domoticz again and it goes well. So the errors are not everytime but unknown moments they are there

poudenes commented 7 years ago

Rasbian Jessie Python 3.4 Domoticz latest stable (3.8153) Bluepy installed using pip RGBW plugin with the correction of 3 lines (add "self.")

Can install all bulbs and bluetooth connection is stable. Work great. Restart of Domoticz gives sometimes a crash but will start when you try several times.

Colorpicker plugin work great. no problem. Only the colorpicker option seems not work correct. but thats a other discussion :)

poudenes commented 7 years ago

Tried install Domoticz on OSMC OS and when domoticz start its fast with bluetooth connection. But also got the errors and 1 large one.

> Fatal Python error: GC object already tracked
> 
> Current thread 0x710ff440 (most recent call first):
>   File "/usr/lib/python3.4/_weakrefset.py", line 38 in __init__
>   File "/usr/lib/python3.4/abc.py", line 147 in __new__
>   File "/usr/lib/python3.4/_collections_abc.py", line 687 in <module>
>   File "<frozen importlib._bootstrap>", line 321 in _call_with_frames_removed
>   File "<frozen importlib._bootstrap>", line 1471 in exec_module
>   File "<frozen importlib._bootstrap>", line 1129 in _exec
>   File "<frozen importlib._bootstrap>", line 1200 in _load_unlocked
>   File "<frozen importlib._bootstrap>", line 2226 in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 2237 in _find_and_load
>   File "/usr/lib/python3.4/os.py", line 616 in <module>
>   File "<frozen importlib._bootstrap>", line 321 in _call_with_frames_removed
>   File "<frozen importlib._bootstrap>", line 1471 in exec_module
>   File "<frozen importlib._bootstrap>", line 1129 in _exec
>   File "<frozen importlib._bootstrap>", line 1200 in _load_unlocked
>   File "<frozen importlib._bootstrap>", line 2226 in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 2237 in _find_and_load
>   File "/usr/lib/python3.4/site.py", line 78 in <module>
>   File "<frozen importlib._bootstrap>", line 321 in _call_with_frames_removed
>   File "<frozen importlib._bootstrap>", line 1471 in exec_module
>   File "<frozen importlib._bootstrap>", line 1129 in _exec
>   File "<frozen importlib._bootstrap>", line 1200 in _load_unlocked
>   File "<frozen importlib._bootstrap>", line 2226 in _find_and_load_unlocked
>   File "<frozen importlib._bootstrap>", line 2237 in _find_and_load
> Aborted

I don't know if this is because of OSMC OS or we have this also with Raspbian but not see this error at all

poudenes commented 7 years ago

Used latest Raspbian Stretch and got this errors:

Segmentation fault

Fatal Python error: GC object already tracked
Current thread 0x704ff440 (most recent call first):
  File "<frozen importlib._bootstrap>", line 499 in _spec_from_module
  File "<frozen importlib._bootstrap>", line 1107 in _setup
  File "<frozen importlib._bootstrap>", line 1134 in _install
Aborted
poudenes commented 7 years ago

Hi There,

I tried everything to solve the segmentation fault (core dumped) error

Clear install Rasbian Jessy with git install bluepy Clear install Rasbian Stretch with git install bluepy Clear install OSMC OS with git install bluepy Installed sometimes python 3.5 extra Also startup on second RPi (to check if problem was hardware)

But overtime i get error when i add more then 10 Mipow bulbs. Its not clear what it error trigger. Because the Colorpicker let domoticz not crash.

Can you try to find out what it can be for RGBW Plugin?

I tried to work with Colorpicker but you can’t use it in Scenes. So not a option for me.

Hope you can help and can solve this :)

I have also the API tools from Mipow. Had some contact with them. If you want i can sent you the file

Cheers, Peter

On 6 Sep 2017, at 14:40, zaraki673 notifications@github.com wrote:

Yes, i'm on it :D

2017-09-06 14:23 GMT+02:00 poudenes notifications@github.com:

Will you also try to let the color picker work? Would be great to have that one instead of 4 devices for color :))

Verstuurd vanaf mijn iPhone

Op 6 sep. 2017 om 14:16 heeft zaraki673 notifications@github.com het volgende geschreven:

Only RGBW as been update, you can use Python3.4 or Python3.5 as you want

;)

2017-09-06 11:21 GMT+02:00 poudenes notifications@github.com:

I see you updated the plugin. Is het a requirement to have Python 3.5 installed and bluepy from source?

"install bluepy first (https://github.com/IanHarvey/bluepy - install it from source)

then you should need to make a symlink : sudo ln -s

/usr/local/lib/python3.5/dist-packages/bluepy /usr/lib/python3.5/"

I installed all the time bluepy using :

sudo pip3 install bluepy sudo ln -s /usr/local/lib/python3.4/dist-packages/bluepy /usr/lib/python3.4/bluepy

Can you confirm? Meanwhile im now config whole new sdcard with latest domoticz and Raspbian and the python 3.5 and bluepy source

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3# issuecomment-327426754, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7B30zqlrr8_ 3rhA68J9Yv5AcoEIbks5sfmQjgaJpZM4PK0nS .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3#issuecomment-327466610, or mute the thread https://github.com/notifications/unsubscribe-auth/AHGF7CL1JZ-bErmROShXxGGREX7-ck7Hks5sfo67gaJpZM4PK0nS .

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/zaraki673/MiPow-PlayBulb/issues/3#issuecomment-327470612, or mute the thread https://github.com/notifications/unsubscribe-auth/AEMhrPUckymU_rTAkcow9uGulBqS18d6ks5sfpKkgaJpZM4PK0nS.

poudenes commented 7 years ago

In Domoticz 3.8440 Beta RGBW plugin works normal. 👍 All the problems are gone.

Now if possible let colorpicker work as well also with scenes.. Maybe we can focus on that one :)

poudenes commented 7 years ago

Had contact with Mipow. They are more then helpful to give some support to build a good plugin and maybe to improve it for future domoticz releases. They send me the API if your want.

They more then happy if you contact them and see where they can help with this script: Paultaipo at gmail.com

zaraki673 commented 7 years ago

Hi, can you close issue who has been solve with lastest domoticz beta,

will check for colorpicker

poudenes commented 7 years ago

The RGBW 1.0.1 plugin works in latest Beta 3.8451 not the new 1.0.2 version

poudenes commented 7 years ago

I will thank you for all the energy to let this work. For me i moved on to Mi-Light bulbs because they are supported inside Domoticz. Cheers.