Python Plugin: Samsung TV

Python and python framework

Moderator: leecollings

Pawcio
Posts: 9
Joined: Thursday 18 October 2018 23:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by Pawcio »

Hi,
I'm also happy that there is more and more python plugins developed for the domoticz, but the question is if it is done in the proper way.
I'm not the domoticz expert/developer nevertheless I can see that whole plugins mechanism is made in the asynchronous way, which means that synchronous calls should be avoided.

I've attached my implementation of the samsung tv control. Currently it supports only models which communicates over websocket protocol but it's everything what you needed to communicate with SamsungTV (there is no need to install samsungctl, etc.)
Additionally it supports wake on lan function (but remember if you are using docker, it must be created with --net=host option)

Websocket port is based on the easywebsocketclient implementation.
Feel free to reuse it and/or extend functionality.
Attachments
plugin.7z
(4.52 KiB) Downloaded 169 times
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Python Plugin: Samsung TV

Post by mark.sellwood »

Great work @Pawcio, this is the first time I have managed to get Domoticz to do something with my Samsung KS8000 TV :D
I can turn the TV on using the "PowerOn" button & if using the media player functions I can control the volume & get the Menu up.
What I cant do is turn the TV off.
If I change the volume i see the following in the log:-
2018-10-23 19:07:30.377 (TV) 57 65 62 53 6f 63 6b 65 74 2d 56 65 72 73 69 6f 6e 3a 20 31 WebSocket-Version:.1
2018-10-23 19:07:30.377 (TV) 33 0d 0a 48 6f 73 74 3a 20 31 39 32 2e 31 36 38 2e 31 2e 36 3..Host:.192.168.1.6
2018-10-23 19:07:30.377 (TV) 36 3a 38 30 30 31 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. 6:8001....
2018-10-23 19:07:30.398 (TV) Pushing 'ReadEvent' on to queue
2018-10-23 19:07:30.428 (TV) Processing 'ReadEvent' message
2018-10-23 19:07:30.428 (TV) Received 129 bytes of data
2018-10-23 19:07:30.428 (TV) 48 54 54 50 2f 31 2e 31 20 31 30 31 20 53 77 69 74 63 68 69 HTTP/1.1.101.Switchi
2018-10-23 19:07:30.428 (TV) 6e 67 20 50 72 6f 74 6f 63 6f 6c 73 0d 0a 55 70 67 72 61 64 ng.Protocols..Upgrad
2018-10-23 19:07:30.428 (TV) 65 3a 20 77 65 62 73 6f 63 6b 65 74 0d 0a 43 6f 6e 6e 65 63 e:.websocket..Connec
2018-10-23 19:07:30.428 (TV) 74 69 6f 6e 3a 20 55 70 67 72 61 64 65 0d 0a 53 65 63 2d 57 tion:.Upgrade..Sec-W
2018-10-23 19:07:30.429 (TV) 65 62 53 6f 63 6b 65 74 2d 41 63 63 65 70 74 3a 20 48 53 6d ebSocket-Accept:.HSm
2018-10-23 19:07:30.429 (TV) 72 63 30 73 4d 6c 59 55 6b 41 47 6d 6d 35 4f 50 70 47 32 48 rc0sMlYUkAGmm5OPpG2H
2018-10-23 19:07:30.429 (TV) 61 47 57 6b 3d 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. .. aGWk=....
2018-10-23 19:07:30.429 (TV) Pushing 'onMessageCallback' on to queue

But if I try to turn the TV off all I see is:-
2018-10-23 19:09:18.044 (TV) onCommand Off
2018-10-23 19:09:18.025 Status: User: Admin initiated a switch command (1/TV - Input/Off)
Any idea on how to turn the TV off from Domoticz? As this is all I really want to do, I have a scene controller, at present when I hit "Bedtime" the outside & lounge lights go off, the landing light comes on for 4 mins etc, I just want to add "turn off the tv"

Any idea?
Thanks,
Mark
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
Pawcio
Posts: 9
Joined: Thursday 18 October 2018 23:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by Pawcio »

Hi Mark,
this is because it was very early implementation without power off functionality :)

Please find updated plugin.
Attachments
plugin.7z
(4.66 KiB) Downloaded 118 times
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Python Plugin: Samsung TV

Post by mark.sellwood »

Thanks, I'll give it a try.
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
dextm80
Posts: 117
Joined: Tuesday 24 October 2017 18:32
Target OS: Linux
Domoticz version: 4.10159
Contact:

Re: Python Plugin: Samsung TV

Post by dextm80 »

I’ve a 32c6000 but seems it s not work, anyone that have this tv?
Domoticz on AsRock j3455-ITX 8gb ram - Aeotec ZWave Usb Stick - RFLink 433Mhz
1x Fibaro Wall Plug
1x Fibaro Motion Sensor
x NeoCoolcam Wall Plug
Netatmo Weather Station - Netatmo Thermostat
Philips Hue Bridge
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Python Plugin: Samsung TV

Post by mark.sellwood »

I've got a KS8000, the Oct 20 version had limited functionality, the Volume, Mute & Home buttons worked, with the Oct 31 nothing works.
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
Pawcio
Posts: 9
Joined: Thursday 18 October 2018 23:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by Pawcio »

Ok,
it means that samsung has slightly different protocol on different TV models which are communicating over ws.
Version from the Oct 31, waits for the ""ms.channel.connect" json response before keys processing (it wasn't present in the previous one).
Mark, could you turn on debugs and sends me logs? I'll check whats going on.

In the mean time please find the first plugin version with power off functionality added.
I hope it will work this time for you.
Attachments
plugin.7z
(4.57 KiB) Downloaded 136 times
mark.sellwood
Posts: 101
Joined: Tuesday 04 March 2014 10:33
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Surrey, UK
Contact:

Re: Python Plugin: Samsung TV

Post by mark.sellwood »

Hello Pawcio,
Great new version, I can turn the TV ON & OFF now, the Volume, Mute, Home, Navigation & OK buttons all work. :D
Log below FYI
2018-11-04 07:19:40.474 Status: Domoticz V4.9700 (c)2012-2018 GizMoCuz
2018-11-04 07:19:40.487 Status: Build Hash: a3a45906, Date: 2018-06-23 15:24:51
2018-11-04 07:19:40.495 Status: Startup Path: /home/pi/domoticz/
2018-11-04 07:19:41.861 Status: PluginSystem: Started, Python version '3.5.3'.
2018-11-04 07:19:41.941 Status: WebServer(HTTP) started on address: :: with port 8080
2018-11-04 07:19:42.030 Status: WebServer(SSL) started on address: :: with port 443
2018-11-04 07:19:42.036 Status: Proxymanager started.
2018-11-04 07:19:42.048 Status: RxQueue: queue worker started...
2018-11-04 07:19:42.048 Status: TCPServer: shared server started...
2018-11-04 07:19:44.049 Status: (TV) Started.
2018-11-04 07:19:44.050 Status: EventSystem: reset all events...
2018-11-04 07:19:44.057 Status: EventSystem: reset all device statuses...
2018-11-04 07:19:44.309 Status: PluginSystem: Entering work loop.
2018-11-04 07:19:44.802 Status: Python EventSystem: Initalizing event module.
2018-11-04 07:19:44.810 Status: EventSystem: Queue thread started...
2018-11-04 07:19:44.810 Status: EventSystem: Started
2018-11-04 07:19:45.628 Status: (TV) Initialized version 1.0.0, author 'Pawcio'
2018-11-04 07:19:45.629 Status: (TV) Entering work loop.
2018-11-04 07:21:55.523 Status: User: Admin initiated a switch command (2/TV - PowerOn/On)
2018-11-04 07:22:07.643 Status: User: Admin initiated a switch command (1/TV - Input/Off)
2018-11-04 07:22:46.332 Error: (TV) close called!!
2018-11-04 07:23:04.484 Status: User: Admin initiated a switch command (1/TV - Input/Off)
2018-11-04 07:23:15.166 Status: User: Admin initiated a switch command (2/TV - PowerOn/On)
2018-11-04 07:23:20.459 Status: User: Admin initiated a switch command (2/TV - PowerOn/On)
2018-11-04 07:23:26.363 Error: (TV) close called!!
2018-11-04 07:23:29.564 Status: User: Admin initiated a switch command (2/TV - PowerOn/On)
2018-11-04 07:23:39.076 (TV) 72 63 30 73 4d 6c 59 55 6b 41 47 6d 6d 35 4f 50 70 47 32 48 rc0sMlYUkAGmm5OPpG2H
2018-11-04 07:23:39.076 (TV) 61 47 57 6b 3d 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. .. aGWk=....
2018-11-04 07:23:39.076 (TV) Pushing 'onMessageCallback' on to queue
2018-11-04 07:23:39.076 (TV) Processing 'onMessageCallback' message
2018-11-04 07:23:39.077 (TV) Calling message handler 'onMessage'.
2018-11-04 07:23:39.077 (TV) onMessage called with Data: 'b'HTTP/1.1 101 Switching Protocols\r\nUpgrade: websocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=\r\n\r\n''
2018-11-04 07:23:39.079 (TV) Pushing 'WriteDirective' on to queue
2018-11-04 07:23:39.080 (TV) Processing 'WriteDirective' message
2018-11-04 07:23:39.080 (TV) Sending 134 bytes of data
2018-11-04 07:23:39.081 (TV) Pushing 'ReadEvent' on to queue
2018-11-04 07:23:39.081 (TV) 81 fe 00 7e 12 34 56 78 69 16 3b 1d 66 5c 39 1c 30 0e 74 15 ��.~.4Vxi.;.f\9.0.t.
2018-11-04 07:23:39.081 (TV) 61 1a 24 1d 7f 5b 22 1d 3c 57 39 16 66 46 39 14 30 18 74 08 a.$.[".<W9.fF9.0.t.
2018-11-04 07:23:39.081 (TV) 73 46 37 15 61 16 6c 03 30 77 3b 1c 30 0e 74 3b 7e 5d 35 13 sF7.a.l.0w;.0.t;~]5.
2018-11-04 07:23:39.081 (TV) 30 18 74 3c 73 40 37 37 74 77 3b 1c 30 0e 74 33 57 6d 09 35 0.t<s@77tw;.0.t3Wm.5
2018-11-04 07:23:39.082 (TV) 47 60 13 5a 3e 16 19 08 66 5d 39 16 30 0e 74 1e 73 58 25 1d G`.Z>...f]9.0.t.sX%.
2018-11-04 07:23:39.082 (TV) 30 18 74 2c 6b 44 33 37 74 66 33 15 7d 40 33 5a 28 16 05 1d 0.t,kD37tf3.}@3Z(...
2018-11-04 07:23:39.082 (TV) 7c 50 04 1d 7f 5b 22 1d 59 51 2f 5a 6f 49 .. .. .. .. .. .. |P..[".YQ/ZoI
2018-11-04 07:23:39.082 (TV) Processing 'ReadEvent' message
2018-11-04 07:23:39.083 (TV) Received 253 bytes of data
2018-11-04 07:23:39.083 (TV) 81 7e 00 f9 7b 22 65 76 65 6e 74 22 3a 22 6d 73 2e 63 68 61 �~.�{"event":"ms.cha
2018-11-04 07:23:39.083 (TV) 6e 6e 65 6c 2e 63 6f 6e 6e 65 63 74 22 2c 22 64 61 74 61 22 nnel.connect","data"
2018-11-04 07:23:39.083 (TV) 3a 7b 22 69 64 22 3a 22 38 63 62 35 30 34 62 30 2d 65 30 30 :{"id":"8cb504b0-e00
2018-11-04 07:23:39.083 (TV) 32 2d 31 31 65 38 2d 61 65 38 32 2d 34 31 33 32 36 37 63 38 2-11e8-ae82-413267c8
2018-11-04 07:23:39.083 (TV) 66 34 62 64 22 2c 22 63 6c 69 65 6e 74 73 22 3a 5b 7b 22 69 f4bd","clients":[{"i
2018-11-04 07:23:39.084 (TV) 64 22 3a 22 38 63 62 35 30 34 62 30 2d 65 30 30 32 2d 31 31 d":"8cb504b0-e002-11
2018-11-04 07:23:39.084 (TV) 65 38 2d 61 65 38 32 2d 34 31 33 32 36 37 63 38 66 34 62 64 e8-ae82-413267c8f4bd
2018-11-04 07:23:39.084 (TV) 22 2c 22 63 6f 6e 6e 65 63 74 54 69 6d 65 22 3a 31 35 34 31 ","connectTime":1541
2018-11-04 07:23:39.084 (TV) 33 31 36 32 31 39 30 30 34 2c 22 61 74 74 72 69 62 75 74 65 316219004,"attribute
2018-11-04 07:23:39.084 (TV) 73 22 3a 7b 22 6e 61 6d 65 22 3a 22 64 33 4e 77 63 6d 39 34 s":{"name":"d3Nwcm94
2018-11-04 07:23:39.084 (TV) 65 51 3d 3d 22 7d 2c 22 64 65 76 69 63 65 4e 61 6d 65 22 3a eQ=="},"deviceName":
2018-11-04 07:23:39.085 (TV) 22 64 33 4e 77 63 6d 39 34 65 51 3d 3d 22 2c 22 69 73 48 6f "d3Nwcm94eQ==","isHo
2018-11-04 07:23:39.085 (TV) 73 74 22 3a 66 61 6c 73 65 7d 5d 7d 7d .. .. .. .. .. .. .. st":false}]}}
2018-11-04 07:23:39.085 (TV) Pushing 'onMessageCallback' on to queue
2018-11-04 07:23:39.085 (TV) Processing 'onMessageCallback' message
2018-11-04 07:23:39.085 (TV) Calling message handler 'onMessage'.
2018-11-04 07:23:39.086 (TV) onMessage called with Data: 'b'\x81~\x00\xf9{"event":"ms.channel.connect","data":{"id":"8cb504b0-e002-11e8-ae82-413267c8f4bd","clients":[{"id":"8cb504b0-e002-11e8-ae82-413267c8f4bd","connectTime":1541316219004,"attributes":{"name":"d3Nwcm94eQ=="},"deviceName":"d3Nwcm94eQ==","isHost":false}]}}''
2018-11-04 07:23:43.043 (TV) Pushing 'ReadEvent' on to queue
2018-11-04 07:23:43.046 (TV) Processing 'ReadEvent' message
2018-11-04 07:23:43.046 (TV) Received 73 bytes of data
2018-11-04 07:23:43.046 (TV) 81 47 7b 22 65 76 65 6e 74 22 3a 22 65 64 2e 65 64 65 6e 54 �G{"event":"ed.edenT
2018-11-04 07:23:43.046 (TV) 56 2e 75 70 64 61 74 65 22 2c 22 64 61 74 61 22 3a 7b 22 75 V.update","data":{"u
2018-11-04 07:23:43.047 (TV) 70 64 61 74 65 5f 74 79 70 65 22 3a 22 65 64 2e 65 64 65 6e pdate_type":"ed.eden
2018-11-04 07:23:43.047 (TV) 41 70 70 2e 75 70 64 61 74 65 22 7d 7d .. .. .. .. .. .. .. App.update"}}
2018-11-04 07:23:43.047 (TV) Pushing 'onMessageCallback' on to queue
2018-11-04 07:23:43.047 (TV) Processing 'onMessageCallback' message
2018-11-04 07:23:43.047 (TV) Calling message handler 'onMessage'.
2018-11-04 07:23:43.048 (TV) onMessage called with Data: 'b'\x81G{"event":"ed.edenTV.update","data":{"update_type":"ed.edenApp.update"}}''
2018-11-04 07:23:44.082 (TV) Pushing 'ReadEvent' on to queue
2018-11-04 07:23:44.101 (TV) Processing 'ReadEvent' message
2018-11-04 07:23:44.101 (TV) Received 2 bytes of data
2018-11-04 07:23:44.101 (TV) 89 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �.
2018-11-04 07:23:44.101 (TV) Pushing 'onMessageCallback' on to queue
2018-11-04 07:23:44.101 (TV) Processing 'onMessageCallback' message
2018-11-04 07:23:44.102 (TV) Calling message handler 'onMessage'.
2018-11-04 07:23:44.102 (TV) onMessage called with Data: 'b'\x89\x00''
2018-11-04 07:23:44.103 (TV) Pushing 'WriteDirective' on to queue
2018-11-04 07:23:44.103 (TV) Processing 'WriteDirective' message
2018-11-04 07:23:44.103 (TV) Sending 6 bytes of data
2018-11-04 07:23:44.103 (TV) 8a 80 12 34 56 78 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ��.4Vx
2018-11-04 07:23:46.319 (TV) Pushing 'onHeartbeatCallback' on to queue
2018-11-04 07:23:46.359 (TV) Processing 'onHeartbeatCallback' message
2018-11-04 07:23:46.359 (TV) Calling message handler 'onHeartbeat'.
2018-11-04 07:23:49.084 (TV) Pushing 'ReadEvent' on to queue
2018-11-04 07:23:49.116 (TV) Processing 'ReadEvent' message
2018-11-04 07:23:49.116 (TV) Received 2 bytes of data
2018-11-04 07:23:49.116 (TV) 89 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �.
2018-11-04 07:23:49.117 (TV) Pushing 'onMessageCallback' on to queue
2018-11-04 07:23:49.117 (TV) Processing 'onMessageCallback' message
2018-11-04 07:23:49.117 (TV) Calling message handler 'onMessage'.
2018-11-04 07:23:49.117 (TV) onMessage called with Data: 'b'\x89\x00''
2018-11-04 07:23:49.118 (TV) Pushing 'WriteDirective' on to queue
2018-11-04 07:23:49.119 (TV) Processing 'WriteDirective' message
2018-11-04 07:23:49.119 (TV) Sending 6 bytes of data
2018-11-04 07:23:49.119 (TV) 8a 80 12 34 56 78 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ��.4Vx
2018-11-04 07:23:50.023 (TV) Pushing 'onCommandCallback' on to queue
2018-11-04 07:23:50.025 (TV) Processing 'onCommandCallback' message
2018-11-04 07:23:50.026 (TV) Calling message handler 'onCommand'.
2018-11-04 07:23:50.026 (TV) onCommand Off
2018-11-04 07:23:50.028 (TV) Pushing 'WriteDirective' on to queue
2018-11-04 07:23:50.028 (TV) Processing 'WriteDirective' message
2018-11-04 07:23:50.029 (TV) Sending 135 bytes of data
2018-11-04 07:23:50.029 (TV) 81 fe 00 7f 12 34 56 78 69 16 3b 1d 66 5c 39 1c 30 0e 74 15 ��..4Vxi.;.f\9.0.t.
2018-11-04 07:23:50.029 (TV) 61 1a 24 1d 7f 5b 22 1d 3c 57 39 16 66 46 39 14 30 18 74 08 a.$.[".<W9.fF9.0.t.
2018-11-04 07:23:50.029 (TV) 73 46 37 15 61 16 6c 03 30 77 3b 1c 30 0e 74 3b 7e 5d 35 13 sF7.a.l.0w;.0.t;~]5.
2018-11-04 07:23:50.029 (TV) 30 18 74 3c 73 40 37 37 74 77 3b 1c 30 0e 74 33 57 6d 09 28 0.t<s@77tw;.0.t3Wm.(
2018-11-04 07:23:50.030 (TV) 5d 63 13 2a 30 18 74 37 62 40 3f 17 7c 16 6c 5a 74 55 3a 0b ]c.*0.t7b@?.|.lZtU:.
2018-11-04 07:23:50.030 (TV) 77 16 7a 5a 46 4d 26 1d 5d 52 04 1d 7f 5b 22 1d 30 0e 74 2b w.zZFM&.]R..[".0.t+
2018-11-04 07:23:50.030 (TV) 77 5a 32 2a 77 59 39 0c 77 7f 33 01 30 49 2b .. .. .. .. .. wZ2*wY9.w3.0I+
2018-11-04 07:23:50.021 Status: User: Admin initiated a switch command (1/TV - Input/Off)
2018-11-04 07:23:54.086 (TV) Pushing 'ReadEvent' on to queue
2018-11-04 07:23:54.090 (TV) Processing 'ReadEvent' message
2018-11-04 07:23:54.090 (TV) Received 2 bytes of data
2018-11-04 07:23:54.091 (TV) 89 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. .. �.
2018-11-04 07:23:54.091 (TV) Pushing 'onMessageCallback' on to queue
2018-11-04 07:23:54.091 (TV) Processing 'onMessageCallback' message
2018-11-04 07:23:54.091 (TV) Calling message handler 'onMessage'.
2018-11-04 07:23:54.091 (TV) onMessage called with Data: 'b'\x89\x00''
2018-11-04 07:23:54.092 (TV) Pushing 'WriteDirective' on to queue
2018-11-04 07:23:54.093 (TV) Processing 'WriteDirective' message
2018-11-04 07:23:54.093 (TV) Sending 6 bytes of data
2018-11-04 07:23:54.093 (TV) 8a 80 12 34 56 78 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ��.4Vx
3 x Pi, 1 Master, 2 Slaves, 1x Aeotec Z-Stick S2, 4xSP103 PIR, 5xPowerNode 1, 1xSmart Energy Switch Gen5, 4xFGSS101 Smoke Sensor, 2xFGD212, 9xFGS212 , 7xFGS221/2, 1xAD142 , 1xTKB TZ68E , 2xAeotec Multi Sensor, 3 x NodOn CRC-3-1-00.
Pawcio
Posts: 9
Joined: Thursday 18 October 2018 23:02
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by Pawcio »

According to https://www.domoticz.com/wiki/Using_Python_plugins you need at least 3.4
Martin
Posts: 13
Joined: Wednesday 27 January 2016 11:41
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Contact:

Re: Python Plugin: Samsung TV

Post by Martin »

Pawcio nice work,

But, can you help me a little?

When I use the latest download from this tread, I get an Error: (SamsungTV) close called!!
Any idee what the cause is?

Rg

Martin

Raspberry Pi3B
Domoticz: Version: 4.10090
Python 3.5.3
cheshmgir
Posts: 2
Joined: Tuesday 06 November 2018 11:05
Target OS: -
Domoticz version:
Contact:

Re: Python Plugin: Samsung TV

Post by cheshmgir »

yes, you must be updated
Martin
Posts: 13
Joined: Wednesday 27 January 2016 11:41
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Contact:

Re: Python Plugin: Samsung TV

Post by Martin »

Updated OS, latest Domoticz Beta and plugin from 4 nov. But the Error is still there, and there are no switches created.

Version: 4.10178
Build Hash: 13c95bf8
Compile Date: 2018-11-06 13:16:51
dzVents Version: 2.4.7
Python Version: 3.5.3 (default, Sep 27 2018, 17:25:39) [GCC 6.3.0 20170516]

Linux raspberrypi 4.14.71-v7+ #1145 SMP Fri Sep 21 15:38:35 BST 2018 armv7l GNU/Linux'
2018-11-07 16:22:49.236 (SamsungTV) 3d 20 48 54 54 50 2f 31 2e 31 0d 0a 55 70 67 72 61 64 65 3a =.HTTP/1.1..Upgrade:
2018-11-07 16:22:49.236 (SamsungTV) 20 77 65 62 73 6f 63 6b 65 74 0d 0a 43 6f 6e 6e 65 63 74 69 .websocket..Connecti
2018-11-07 16:22:49.236 (SamsungTV) 6f 6e 3a 20 55 70 67 72 61 64 65 0d 0a 4f 72 69 67 69 6e 3a on:.Upgrade..Origin:
2018-11-07 16:22:49.236 (SamsungTV) 20 44 6f 6d 6f 74 69 63 7a 0d 0a 53 65 63 2d 57 65 62 53 6f .Domoticz..Sec-WebSo
2018-11-07 16:22:49.236 (SamsungTV) 63 6b 65 74 2d 4b 65 79 3a 20 78 33 4a 4a 48 4d 62 44 4c 31 cket-Key:.x3JJHMbDL1
2018-11-07 16:22:49.236 (SamsungTV) 45 7a 4c 6b 68 39 47 42 68 58 44 77 3d 3d 0d 0a 53 65 63 2d EzLkh9GBhXDw==..Sec-
2018-11-07 16:22:49.236 (SamsungTV) 57 65 62 53 6f 63 6b 65 74 2d 56 65 72 73 69 6f 6e 3a 20 31 WebSocket-Version:.1
2018-11-07 16:22:49.236 (SamsungTV) 33 0d 0a 48 6f 73 74 3a 20 31 30 2e 30 2e 30 2e 31 37 36 3a 3..Host:.10.0.0.176:
2018-11-07 16:22:49.237 (SamsungTV) 38 30 30 31 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. .. .. 8001....
2018-11-07 16:22:49.238 (SamsungTV) Pushing 'ReadEvent' on to queue
2018-11-07 16:22:49.287 (SamsungTV) Processing 'ReadEvent' message
2018-11-07 16:22:49.287 (SamsungTV) Received 129 bytes of data
2018-11-07 16:22:49.287 (SamsungTV) 48 54 54 50 2f 31 2e 31 20 31 30 31 20 53 77 69 74 63 68 69 HTTP/1.1.101.Switchi
2018-11-07 16:22:49.287 (SamsungTV) 6e 67 20 50 72 6f 74 6f 63 6f 6c 73 0d 0a 55 70 67 72 61 64 ng.Protocols..Upgrad
2018-11-07 16:22:49.287 (SamsungTV) 65 3a 20 57 65 62 53 6f 63 6b 65 74 0d 0a 43 6f 6e 6e 65 63 e:.WebSocket..Connec
2018-11-07 16:22:49.287 (SamsungTV) 74 69 6f 6e 3a 20 55 70 67 72 61 64 65 0d 0a 53 65 63 2d 57 tion:.Upgrade..Sec-W
2018-11-07 16:22:49.287 (SamsungTV) 65 62 53 6f 63 6b 65 74 2d 41 63 63 65 70 74 3a 20 48 53 6d ebSocket-Accept:.HSm
2018-11-07 16:22:49.287 (SamsungTV) 72 63 30 73 4d 6c 59 55 6b 41 47 6d 6d 35 4f 50 70 47 32 48 rc0sMlYUkAGmm5OPpG2H
2018-11-07 16:22:49.287 (SamsungTV) 61 47 57 6b 3d 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. .. aGWk=....
2018-11-07 16:22:49.287 (SamsungTV) Pushing 'onMessageCallback' on to queue
2018-11-07 16:22:49.289 (SamsungTV) Processing 'onMessageCallback' message
2018-11-07 16:22:49.289 (SamsungTV) Calling message handler 'onMessage'.
2018-11-07 16:22:49.289 (SamsungTV) onMessage called with Data: 'b'HTTP/1.1 101 Switching Protocols\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=\r\n\r\n''
2018-11-07 16:22:49.298 (SamsungTV) Pushing 'ReadEvent' on to queue
2018-11-07 16:22:49.342 (SamsungTV) Processing 'ReadEvent' message
2018-11-07 16:22:49.342 (SamsungTV) Received 10 bytes of data
2018-11-07 16:22:49.342 (SamsungTV) 88 08 03 ed 6e 6f 74 61 63 6b .. .. .. .. .. .. .. .. .. .. �..�notack
2018-11-07 16:22:49.342 (SamsungTV) Pushing 'onMessageCallback' on to queue
2018-11-07 16:22:49.342 (SamsungTV) Processing 'onMessageCallback' message
2018-11-07 16:22:49.342 (SamsungTV) Calling message handler 'onMessage'.
2018-11-07 16:22:49.342 (SamsungTV) onMessage called with Data: 'b'\x88\x08\x03\xednotack''
2018-11-07 16:22:49.342 (SamsungTV) Pushing 'WriteDirective' on to queue
2018-11-07 16:22:49.342 (SamsungTV) Pushing 'DisconnectDirective' on to queue
2018-11-07 16:22:49.342 (SamsungTV) Processing 'WriteDirective' message
2018-11-07 16:22:49.343 (SamsungTV) Sending 6 bytes of data
2018-11-07 16:22:49.343 (SamsungTV) 88 80 00 00 00 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ��....
2018-11-07 16:22:49.343 (SamsungTV) Processing 'DisconnectDirective' message
2018-11-07 16:22:49.343 (SamsungTV) Disconnect directive received for '10.0.0.176:8001'.
2018-11-07 16:22:49.343 (SamsungTV) Handling TCP disconnect, socket (10.0.0.176:8001) is connected
2018-11-07 16:22:49.343 (SamsungTV) Queued asyncronous read aborted (10.0.0.176:8001).
2018-11-07 16:22:49.344 (SamsungTV) Pushing 'DisconnectedEvent' on to queue
2018-11-07 16:22:49.393 (SamsungTV) Processing 'DisconnectedEvent' message
2018-11-07 16:22:49.393 (SamsungTV) Disconnect event received for '10.0.0.176:8001'.
2018-11-07 16:22:49.393 (SamsungTV) Pushing 'onDisconnectCallback' on to queue
2018-11-07 16:22:49.393 (SamsungTV) Processing 'onDisconnectCallback' message
2018-11-07 16:22:49.394 (SamsungTV) Calling message handler 'onDisconnect'.
2018-11-07 16:22:49.394 (SamsungTV) Disconnected from: 10.0.0.176:8001
2018-11-07 16:22:49.394 (SamsungTV) Deallocating connection object 'WS' (10.0.0.176:8001).
2018-11-07 16:22:49.342 Error: (SamsungTV) close called!!
2018-11-07 16:22:58.927 (SamsungTV) Pushing 'onHeartbeatCallback' on to queue
2018-11-07 16:22:58.961 (SamsungTV) Processing 'onHeartbeatCallback' message
2018-11-07 16:22:58.961 (SamsungTV) Calling message handler 'onHeartbeat'.
2018-11-07 16:23:08.929 (SamsungTV) Pushing 'onHeartbeatCallback' on to queue
Martin
Posts: 13
Joined: Wednesday 27 January 2016 11:41
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Contact:

Re: Python Plugin: Samsung TV

Post by Martin »

It is fixed now. Had to delete en add the hardware and the switches where created.

Verstuurd vanaf mijn SM-G950F met Tapatalk

Martin
Posts: 13
Joined: Wednesday 27 January 2016 11:41
Target OS: Raspberry Pi / ODroid
Domoticz version: stable
Contact:

Re: Python Plugin: Samsung TV

Post by Martin »

One more cry for help :?

The two devices are created, but the tv does not respond at all. It is a new model and the websocket of the tv must be working. I'm able to do a WOL manually and the tv asked me to agree before.
This is what the log shows when I tried to switch off the tv. (The TV-Input device thinks it's on all the time)
Spoiler: show
2018-11-10 06:50:30.287 (TV) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 06:50:30.304 (TV) Processing 'onHeartbeatCallback' message
2018-11-10 06:50:30.304 (TV) Calling message handler 'onHeartbeat'.
2018-11-10 06:50:35.147 (TV) Pushing 'onCommandCallback' on to queue
2018-11-10 06:50:35.162 (TV) Processing 'onCommandCallback' message
2018-11-10 06:50:35.163 (TV) Calling message handler 'onCommand'.
2018-11-10 06:50:35.163 (TV) onCommand Off
2018-11-10 06:50:35.163 (TV) Pushing 'ProtocolDirective' on to queue
2018-11-10 06:50:35.163 (TV) Pushing 'ConnectDirective' on to queue
2018-11-10 06:50:35.163 (TV) Processing 'ProtocolDirective' message
2018-11-10 06:50:35.163 (TV) Protocol set to: 'NONE'.
2018-11-10 06:50:35.163 (TV) Processing 'ConnectDirective' message
2018-11-10 06:50:35.163 (TV) Transport set to: 'TCP/IP', 10.0.0.176:8001.
2018-11-10 06:50:35.164 (TV) Connect directive received, action initiated successfully.
2018-11-10 06:50:35.165 (TV) Pushing 'onConnectCallback' on to queue
2018-11-10 06:50:35.214 (TV) Processing 'onConnectCallback' message
2018-11-10 06:50:35.214 (TV) Calling message handler 'onConnect'.
2018-11-10 06:50:35.214 (TV) Connected successfully to: 10.0.0.176
2018-11-10 06:50:35.214 (TV) Pushing 'WriteDirective' on to queue
2018-11-10 06:50:35.214 (TV) Processing 'WriteDirective' message
2018-11-10 06:50:35.214 (TV) Sending 228 bytes of data
2018-11-10 06:50:35.214 (TV) 47 45 54 20 2f 61 70 69 2f 76 32 2f 63 68 61 6e 6e 65 6c 73 GET./api/v2/channels
2018-11-10 06:50:35.214 (TV) 2f 73 61 6d 73 75 6e 67 2e 72 65 6d 6f 74 65 2e 63 6f 6e 74 /samsung.remote.cont
2018-11-10 06:50:35.215 (TV) 72 6f 6c 3f 6e 61 6d 65 3d 64 33 4e 77 63 6d 39 34 65 51 3d rol?name=d3Nwcm94eQ=
2018-11-10 06:50:35.215 (TV) 3d 20 48 54 54 50 2f 31 2e 31 0d 0a 55 70 67 72 61 64 65 3a =.HTTP/1.1..Upgrade:
2018-11-10 06:50:35.215 (TV) 20 77 65 62 73 6f 63 6b 65 74 0d 0a 43 6f 6e 6e 65 63 74 69 .websocket..Connecti
2018-11-10 06:50:35.215 (TV) 6f 6e 3a 20 55 70 67 72 61 64 65 0d 0a 4f 72 69 67 69 6e 3a on:.Upgrade..Origin:
2018-11-10 06:50:35.215 (TV) 20 44 6f 6d 6f 74 69 63 7a 0d 0a 53 65 63 2d 57 65 62 53 6f .Domoticz..Sec-WebSo
2018-11-10 06:50:35.215 (TV) 63 6b 65 74 2d 4b 65 79 3a 20 78 33 4a 4a 48 4d 62 44 4c 31 cket-Key:.x3JJHMbDL1
2018-11-10 06:50:35.215 (TV) 45 7a 4c 6b 68 39 47 42 68 58 44 77 3d 3d 0d 0a 53 65 63 2d EzLkh9GBhXDw==..Sec-
2018-11-10 06:50:35.215 (TV) 57 65 62 53 6f 63 6b 65 74 2d 56 65 72 73 69 6f 6e 3a 20 31 WebSocket-Version:.1
2018-11-10 06:50:35.215 (TV) 33 0d 0a 48 6f 73 74 3a 20 31 30 2e 30 2e 30 2e 31 37 36 3a 3..Host:.10.0.0.176:
2018-11-10 06:50:35.215 (TV) 38 30 30 31 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. .. .. 8001....
2018-11-10 06:50:35.216 (TV) Pushing 'ReadEvent' on to queue
2018-11-10 06:50:35.265 (TV) Processing 'ReadEvent' message
2018-11-10 06:50:35.265 (TV) Received 129 bytes of data
2018-11-10 06:50:35.266 (TV) 48 54 54 50 2f 31 2e 31 20 31 30 31 20 53 77 69 74 63 68 69 HTTP/1.1.101.Switchi
2018-11-10 06:50:35.266 (TV) 6e 67 20 50 72 6f 74 6f 63 6f 6c 73 0d 0a 55 70 67 72 61 64 ng.Protocols..Upgrad
2018-11-10 06:50:35.266 (TV) 65 3a 20 57 65 62 53 6f 63 6b 65 74 0d 0a 43 6f 6e 6e 65 63 e:.WebSocket..Connec
2018-11-10 06:50:35.266 (TV) 74 69 6f 6e 3a 20 55 70 67 72 61 64 65 0d 0a 53 65 63 2d 57 tion:.Upgrade..Sec-W
2018-11-10 06:50:35.266 (TV) 65 62 53 6f 63 6b 65 74 2d 41 63 63 65 70 74 3a 20 48 53 6d ebSocket-Accept:.HSm
2018-11-10 06:50:35.266 (TV) 72 63 30 73 4d 6c 59 55 6b 41 47 6d 6d 35 4f 50 70 47 32 48 rc0sMlYUkAGmm5OPpG2H
2018-11-10 06:50:35.266 (TV) 61 47 57 6b 3d 0d 0a 0d 0a .. .. .. .. .. .. .. .. .. .. .. aGWk=....
2018-11-10 06:50:35.266 (TV) Pushing 'onMessageCallback' on to queue
2018-11-10 06:50:35.266 (TV) Processing 'onMessageCallback' message
2018-11-10 06:50:35.266 (TV) Calling message handler 'onMessage'.
2018-11-10 06:50:35.266 (TV) onMessage called with Data: 'b'HTTP/1.1 101 Switching Protocols\r\nUpgrade: WebSocket\r\nConnection: Upgrade\r\nSec-WebSocket-Accept: HSmrc0sMlYUkAGmm5OPpG2HaGWk=\r\n\r\n''
2018-11-10 06:50:35.267 (TV) Pushing 'WriteDirective' on to queue
2018-11-10 06:50:35.267 (TV) Processing 'WriteDirective' message
2018-11-10 06:50:35.267 (TV) Sending 135 bytes of data
2018-11-10 06:50:35.267 (TV) 81 fe 00 7f 12 34 56 78 69 16 3b 1d 66 5c 39 1c 30 0e 74 15 ��..4Vxi.;.f\9.0.t.
2018-11-10 06:50:35.267 (TV) 61 1a 24 1d 7f 5b 22 1d 3c 57 39 16 66 46 39 14 30 18 74 08 a.$.[".<W9.fF9.0.t.
2018-11-10 06:50:35.267 (TV) 73 46 37 15 61 16 6c 03 30 77 3b 1c 30 0e 74 3b 7e 5d 35 13 sF7.a.l.0w;.0.t;~]5.
2018-11-10 06:50:35.268 (TV) 30 18 74 3c 73 40 37 37 74 77 3b 1c 30 0e 74 33 57 6d 09 28 0.t<s@77tw;.0.t3Wm.(
2018-11-10 06:50:35.268 (TV) 5d 63 13 2a 30 18 74 37 62 40 3f 17 7c 16 6c 5a 74 55 3a 0b ]c.*0.t7b@?.|.lZtU:.
2018-11-10 06:50:35.268 (TV) 77 16 7a 5a 46 4d 26 1d 5d 52 04 1d 7f 5b 22 1d 30 0e 74 2b w.zZFM&.]R..[".0.t+
2018-11-10 06:50:35.268 (TV) 77 5a 32 2a 77 59 39 0c 77 7f 33 01 30 49 2b .. .. .. .. .. wZ2*wY9.w3.0I+
2018-11-10 06:50:35.279 (TV) Pushing 'ReadEvent' on to queue
2018-11-10 06:50:35.318 (TV) Processing 'ReadEvent' message
2018-11-10 06:50:35.318 (TV) Received 10 bytes of data
2018-11-10 06:50:35.318 (TV) 88 08 03 ed 6e 6f 74 61 63 6b .. .. .. .. .. .. .. .. .. .. �..�notack
2018-11-10 06:50:35.318 (TV) Pushing 'onMessageCallback' on to queue
2018-11-10 06:50:35.319 (TV) Processing 'onMessageCallback' message
2018-11-10 06:50:35.319 (TV) Calling message handler 'onMessage'.
2018-11-10 06:50:35.319 (TV) onMessage called with Data: 'b'\x88\x08\x03\xednotack''
2018-11-10 06:50:35.319 (TV) Pushing 'WriteDirective' on to queue
2018-11-10 06:50:35.319 (TV) Pushing 'DisconnectDirective' on to queue
2018-11-10 06:50:35.319 (TV) Processing 'WriteDirective' message
2018-11-10 06:50:35.319 (TV) Sending 6 bytes of data
2018-11-10 06:50:35.319 (TV) 88 80 00 00 00 00 .. .. .. .. .. .. .. .. .. .. .. .. .. .. ��....
2018-11-10 06:50:35.320 (TV) Processing 'DisconnectDirective' message
2018-11-10 06:50:35.320 (TV) Disconnect directive received for '10.0.0.176:8001'.
2018-11-10 06:50:35.320 (TV) Handling TCP disconnect, socket (10.0.0.176:8001) is connected
2018-11-10 06:50:35.320 (TV) Queued asyncronous read aborted (10.0.0.176:8001).
2018-11-10 06:50:35.320 (TV) Pushing 'DisconnectedEvent' on to queue
2018-11-10 06:50:35.370 (TV) Processing 'DisconnectedEvent' message
2018-11-10 06:50:35.370 (TV) Disconnect event received for '10.0.0.176:8001'.
2018-11-10 06:50:35.370 (TV) Pushing 'onDisconnectCallback' on to queue
2018-11-10 06:50:35.370 (TV) Processing 'onDisconnectCallback' message
2018-11-10 06:50:35.370 (TV) Calling message handler 'onDisconnect'.
2018-11-10 06:50:35.370 (TV) Disconnected from: 10.0.0.176:8001
2018-11-10 06:50:35.371 (TV) Deallocating connection object 'WS' (10.0.0.176:8001).
2018-11-10 06:50:35.146 Status: User: Admin initiated a switch command (2889/TV - Input/Off)
2018-11-10 06:50:35.319 Error: (TV) close called!!
2018-11-10 06:50:40.289 (TV) Pushing 'onHeartbeatCallback' on to queue
2018-11-10 06:50:40.328 (TV) Processing 'onHeartbeatCallback' message
denman091
Posts: 30
Joined: Monday 31 July 2017 15:22
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.8153
Location: Pijnacker
Contact:

Re: Python Plugin: Samsung TV

Post by denman091 »

Pawcio wrote: Saturday 03 November 2018 23:10 Ok,
it means that samsung has slightly different protocol on different TV models which are communicating over ws.
Version from the Oct 31, waits for the ""ms.channel.connect" json response before keys processing (it wasn't present in the previous one).
Mark, could you turn on debugs and sends me logs? I'll check whats going on.

In the mean time please find the first plugin version with power off functionality added.
I hope it will work this time for you.
Can i use this for a Samsung UE40H6400?
How do i install it?
psychomaniac
Posts: 6
Joined: Saturday 24 November 2018 12:17
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: Python Plugin: Samsung TV

Post by psychomaniac »

Guys,

i've been struggling with this to get it to work. I have a Samsung Q7F 2017 model TV. My Domoticz is running an raspberry pi 3b.

I installed python3.4 and walked through the Wiki to get the connection work to my TV. I want to see if my tv is On and if possible what input it is. But i'm stuck at 2 points. I can't see the plugin in Domoticz. I copied it to the plugins directory /home/volumio/domoticz/plugins (im running volumio on my pi, should work within this image i guess?). Domoticz simply doesn't show the plugin when i want to add the Samsung TV as Hardware. I executed the command: (sudo chmod +x plugin.py) to make it possible to execute, but still after restarting the domoticz service, it doesn't show.

The other problem is checking the connection with the TV. I execute samsungctl -i --host 192.168.0.123 --method websocket, but it give me the following output:

Traceback (most recent call last):
File "/usr/local/bin/samsungctl", line 9, in <module>
load_entry_point('samsungctl==0.7.1', 'console_scripts', 'samsungctl')()
File "/usr/lib/python3.4/samsungctl/__main__.py", line 110, in main
with Remote(config) as remote:
File "/usr/lib/python3.4/samsungctl/remote.py", line 11, in __init__
self.remote = RemoteWebsocket(config)
File "/usr/lib/python3.4/samsungctl/remote_websocket.py", line 17, in __init__
import websocket
File "/usr/lib/python3.4/websocket/__init__.py", line 23, in <module>
from ._app import WebSocketApp
File "/usr/lib/python3.4/websocket/_app.py", line 36, in <module>
from ._core import WebSocket, getdefaulttimeout
File "/usr/lib/python3.4/websocket/_core.py", line 34, in <module>
from ._handshake import *
File "/usr/lib/python3.4/websocket/_handshake.py", line 40, in <module>
if six.PY34:
AttributeError: 'module' object has no attribute 'PY34'

not sure what this means. Would some help me to solve these 2 problems?
zak45
Posts: 952
Joined: Sunday 22 January 2017 11:37
Target OS: Windows
Domoticz version: V2024.4
Contact:

Re: Python Plugin: Samsung TV

Post by zak45 »

psychomaniac wrote: Saturday 24 November 2018 12:23 if six.PY34:
AttributeError: 'module' object has no attribute 'PY34'

not sure what this means. Would some help me to solve these 2 problems?
Looks like problem come from your six module; try to see if update exist.
psychomaniac
Posts: 6
Joined: Saturday 24 November 2018 12:17
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: Python Plugin: Samsung TV

Post by psychomaniac »

I will try that, I tried to install but I think I didn't try to upgrade... Not sure but will check it. Any tips regarding versions of any kind?
psychomaniac
Posts: 6
Joined: Saturday 24 November 2018 12:17
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: Python Plugin: Samsung TV

Post by psychomaniac »

zak45 wrote: Saturday 24 November 2018 17:22
psychomaniac wrote: Saturday 24 November 2018 12:23 if six.PY34:
AttributeError: 'module' object has no attribute 'PY34'

not sure what this means. Would some help me to solve these 2 problems?
Looks like problem come from your six module; try to see if update exist.
I updated six and now the script continues but failed again. Looks like websocket isn't upgraded. So i tried that but that also fails... not sure how to update websocket in a proper way
Spoiler: show
volumio@volumio:/$ sudo pip3 install websocket
Downloading/unpacking websocket
Downloading websocket-0.2.1.tar.gz (195kB): 195kB downloaded
Running setup.py (path:/tmp/pip-build-6xmhq2q8/websocket/setup.py) egg_info for package websocket

Downloading/unpacking gevent (from websocket)
Downloading gevent-1.3.7.tar.gz (4.6MB): 4.6MB downloaded
Running setup.py (path:/tmp/pip-build-6xmhq2q8/gevent/setup.py) egg_info for package gevent
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip-build-6xmhq2q8/gevent/setup.py", line 418, in <module>
run_setup(EXT_MODULES, run_make=_BUILDING)
File "/tmp/pip-build-6xmhq2q8/gevent/setup.py", line 402, in run_setup
"signal_os_incompat = gevent.monkey:_subscribe_signal_os",
File "/usr/lib/python3.4/distutils/core.py", line 108, in setup
_setup_distribution = dist = klass(attrs)
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 262, in __init__
self.fetch_build_eggs(attrs['setup_requires'])
File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs
replace_conflicting=True,
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 603, in resolve
requirements = list(requirements)[::-1]
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2721, in parse_requirements
"version spec")
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2697, in scan_list
raise ValueError(msg, line, "at", line[p:])
ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'")
Complete output from command python setup.py egg_info:
Traceback (most recent call last):

File "<string>", line 17, in <module>

File "/tmp/pip-build-6xmhq2q8/gevent/setup.py", line 418, in <module>

run_setup(EXT_MODULES, run_make=_BUILDING)

File "/tmp/pip-build-6xmhq2q8/gevent/setup.py", line 402, in run_setup

"signal_os_incompat = gevent.monkey:_subscribe_signal_os",

File "/usr/lib/python3.4/distutils/core.py", line 108, in setup

_setup_distribution = dist = klass(attrs)

File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 262, in __init__

self.fetch_build_eggs(attrs['setup_requires'])

File "/usr/lib/python3/dist-packages/setuptools/dist.py", line 287, in fetch_build_eggs

replace_conflicting=True,

File "/usr/lib/python3/dist-packages/pkg_resources.py", line 603, in resolve

requirements = list(requirements)[::-1]

File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2721, in parse_requirements

"version spec")

File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2697, in scan_list

raise ValueError(msg, line, "at", line[p:])

ValueError: ("Expected ',' or end-of-list in", "cffi >= 1.11.5 ; sys_platform == 'win32' and platform_python_implementation == 'CPython'", 'at', " ; sys_platform == 'win32' and platform_python_implementation == 'CPython'")

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-6xmhq2q8/gevent
Storing debug log for failure in /root/.pip/pip.log
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest