Für alle, die gerne in der Freizeit knobeln - ein Rätsel
Problem:
- Auslesen von 1-wire Sensoren über smarthome.py liefert stets "0"
Setup:
- RasPi, Stretch mit owserver
- PC, Stretch mit smarthome.py
Klappt:
- Zugriff über Browser von jedem PC im LAN auf den owserver
- z.B.: http://192.168.0.163:2121/ liefert die Liste der angeschlossenen Sensoren
- z.B.: http://192.168.0.163:2121/28.FFF7F7241703 liefert die Werte des entsprechenden Temperatursensors
- z.B.: http://192.168.0.163:2121/28.FFF7F7241703/temperature liefert den Temperaturwert
- weiterhin klappt über smarthome.py alles was KNX betrifft - Lesen, Schreiben, Logiken etc. bis in die smartVISU hinein keinerlei Probleme
Symptome:
- smarthome.py- d liefert keine Fehler
- Verbindung zum owserver scheint zu klappen:
INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66
- folgende Ausgabe hat vermutlich keine weitere Bedeutung:
DEBUG Main Item 1ws: no type specified. -- item.py:__init__:242
- telnet kann mit ls alle Sensoren aus der ~/items/xyz.conf auflisten
- laut telnet haben alle 1-wire Sensoren den Wert 0, z.B.:
- die Sensorwerte lassen sich mit telnet überschreiben und sind danach entsprechend in der smartVISU zu sehen
- in der Datei ~/plugins/onewire/__init__.py in der Funktion def _request kommt der Skript niemals über die socket.timeout exception hinaus, was zwar keinen Fehler produziert, diesen vielleicht aber etwas eingrenzt:
- Erhöhen des Wertes self._sock.settimeout(2) in der Datei ~/plugins/onewire/__init__.py hat zu keinem Erfolg geführt
Das war es auch schon, weiter bin ich noch nicht gekommen. Hat jemand eine Idee, wie ich dieses Plugin zum Laufen bekomme? Es folgen noch ein paar Infos, die evtl. von Bedeutung sind.
relevanter Ausschnitt aus plugin.conf:
relevanter Ausschnitt aus ~/items/xyz.conf:
gesamte Log
- KNX ist aktiviert, Logik ist aus, Visu ist an, CLI ist an
- die Markierungen (Fett) sind von mir gesetzt
LG
Andreas
Problem:
- Auslesen von 1-wire Sensoren über smarthome.py liefert stets "0"
Setup:
- RasPi, Stretch mit owserver
- PC, Stretch mit smarthome.py
Klappt:
- Zugriff über Browser von jedem PC im LAN auf den owserver
- z.B.: http://192.168.0.163:2121/ liefert die Liste der angeschlossenen Sensoren
- z.B.: http://192.168.0.163:2121/28.FFF7F7241703 liefert die Werte des entsprechenden Temperatursensors
- z.B.: http://192.168.0.163:2121/28.FFF7F7241703/temperature liefert den Temperaturwert
- weiterhin klappt über smarthome.py alles was KNX betrifft - Lesen, Schreiben, Logiken etc. bis in die smartVISU hinein keinerlei Probleme
Symptome:
- smarthome.py- d liefert keine Fehler
- Verbindung zum owserver scheint zu klappen:
INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66
- folgende Ausgabe hat vermutlich keine weitere Bedeutung:
DEBUG Main Item 1ws: no type specified. -- item.py:__init__:242
- telnet kann mit ls alle Sensoren aus der ~/items/xyz.conf auflisten
- laut telnet haben alle 1-wire Sensoren den Wert 0, z.B.:
Code:
> ls 1ws Items: ====== 1ws 1ws.tempBBX = 0
- in der Datei ~/plugins/onewire/__init__.py in der Funktion def _request kommt der Skript niemals über die socket.timeout exception hinaus, was zwar keinen Fehler produziert, diesen vielleicht aber etwas eingrenzt:
Code:
try: header = self._sock.recv(24) except socket.timeout: self.close() self._lock.release() raise owex("error receiving header: timeout")
Das war es auch schon, weiter bin ich noch nicht gekommen. Hat jemand eine Idee, wie ich dieses Plugin zum Laufen bekomme? Es folgen noch ein paar Infos, die evtl. von Bedeutung sind.
relevanter Ausschnitt aus plugin.conf:
Code:
[knx] class_name = KNX class_path = plugins.knx host = 192.168.0.163 port = 6720 [ow] class_name = OneWire class_path = plugins.onewire host = 192.168.0.163 port = 2121
Code:
[1ws] [[tempBBX]] name = randomName01 type = num ow_addr = 28.FFF7F7241703 # could be T, T9, T10, T11, T12 ow_sensor = T9
- KNX ist aktiviert, Logik ist aus, Visu ist an, CLI ist an
- die Markierungen (Fett) sind von mir gesetzt
Code:
$ /usr/local/smarthome/bin/smarthome.py -d 2018-01-21 21:54:01,275 INFO Main Start SmartHome.py 1.0-45-g02cf972 -- smarthome.py:__init__:231 2018-01-21 21:54:01,275 DEBUG Main Python 3.5.3 -- smarthome.py:__init__:232 2018-01-21 21:54:01,275 INFO Main Init Scheduler -- scheduler.py:__init__:86 2018-01-21 21:54:01,276 DEBUG Scheduler creating 5 workers -- scheduler.py:run:93 2018-01-21 21:54:01,276 INFO Main Init Plugins -- smarthome.py:start:274 2018-01-21 21:54:01,277 DEBUG Main Plugin: knx -- plugin.py:__init__:43 2018-01-21 21:54:01,280 DEBUG Main Plugin: ow -- plugin.py:__init__:43 2018-01-21 21:54:01,287 DEBUG Main Plugin: visu -- plugin.py:__init__:43 2018-01-21 21:54:01,289 DEBUG Main Plugin: cli -- plugin.py:__init__:43 2018-01-21 21:54:01,290 INFO Main Init Items -- smarthome.py:start:280 2018-01-21 21:54:01,291 DEBUG Main Item env.core: no type specified. -- item.py:__init__:242 2018-01-21 21:54:01,293 DEBUG Main Item env.location: no type specified. -- item.py:__init__:242 2018-01-21 21:54:01,293 DEBUG Main Item env.system: no type specified. -- item.py:__init__:242 2018-01-21 21:54:01,293 DEBUG Main Item env: no type specified. -- item.py:__init__:242 2018-01-21 21:54:01,294 DEBUG Main KNX: pwm_1 listen on 0/0/1 -- __init__.py:parse_item:235 2018-01-21 21:54:01,294 DEBUG Main KNX: pwm_1 listen on and init with 0/0/1 -- __init__.py:parse_item:244 2018-01-21 21:54:01,294 DEBUG Main KNX: pwm_1 reply to 0/0/1 -- __init__.py:parse_item:267 2018-01-21 21:54:01,294 DEBUG Main KNX: pwm_2 listen on 0/0/2 -- __init__.py:parse_item:235 2018-01-21 21:54:01,294 DEBUG Main KNX: pwm_2 listen on and init with 0/0/2 -- __init__.py:parse_item:244 2018-01-21 21:54:01,294 DEBUG Main KNX: pwm_2 reply to 0/0/2 -- __init__.py:parse_item:267 2018-01-21 21:54:01,294 DEBUG Main Item melder: no type specified. -- item.py:__init__:242 2018-01-21 21:54:01,295 DEBUG Main KNX: meldungen.light reply to 0/0/6 -- __init__.py:parse_item:267 2018-01-21 21:54:01,295 DEBUG Main KNX: meldungen.LED1 reply to 0/0/1 -- __init__.py:parse_item:267 2018-01-21 21:54:01,295 WARNING Main KNX: meldungen.LED1 knx_reply (0/0/1) already defined for pwm_1 -- __init__.py:parse_item:271 2018-01-21 21:54:01,295 DEBUG Main KNX: meldungen.LED2 reply to 0/0/2 -- __init__.py:parse_item:267 2018-01-21 21:54:01,295 WARNING Main KNX: meldungen.LED2 knx_reply (0/0/2) already defined for pwm_2 -- __init__.py:parse_item:271 2018-01-21 21:54:01,296 DEBUG Main Item meldungen: no type specified. -- item.py:__init__:242 2018-01-21 21:54:01,296 DEBUG Main Item 1ws: no type specified. -- item.py:__init__:242 2018-01-21 21:54:01,296 INFO Main Start Plugins -- plugin.py:start:65 2018-01-21 21:54:01,297 DEBUG ow 1w-disc next time: 2018-01-21 21:54:03+01:00 -- scheduler.py:_next_time:289 2018-01-21 21:54:01,298 INFO Main Start Logics -- logic.py:__init__:33 2018-01-21 21:54:01,298 DEBUG Main Reading Logics from /usr/local/smarthome/lib/env/logic_conf -- logic.py:_read_logics:64 2018-01-21 21:54:01,300 DEBUG Main Reading Logics from /usr/local/smarthome/etc/logic.conf -- logic.py:_read_logics:64 2018-01-21 21:54:01,302 DEBUG Main Logic: env_init -- logic.py:__init__:44 2018-01-21 21:54:01,303 DEBUG Main Logic: env_stat -- logic.py:__init__:44 2018-01-21 21:54:01,304 DEBUG Main env_stat next time: 2018-01-21 21:54:11+01:00 -- scheduler.py:_next_time:289 2018-01-21 21:54:01,304 DEBUG Main Logic: TestLight -- logic.py:__init__:44 2018-01-21 21:54:01,304 WARNING Main TestLight: No filename specified => ignoring. -- logic.py:generate_bytecode:123 2018-01-21 21:54:01,304 DEBUG Main Logic: env_loc -- logic.py:__init__:44 2018-01-21 21:54:01,789 [B]DEBUG Connections KNX: connected to 192.168.0.163:6720[/B] -- connection.py:connect:386 2018-01-21 21:54:01,790 DEBUG Connections KNX: enable group monitor -- __init__.py:handle_connect:117 2018-01-21 21:54:01,790 DEBUG Connections KNX: init read -- __init__.py:handle_connect:123 2018-01-21 21:54:01,792 [B]INFO[/B] [B]Connections[/B] [B]1-Wire: connected to 192.168.0.163:2121[/B] -- __init__.py:connect:66 2018-01-21 21:54:02,396 DEBUG Main knx: 1.1.4 set 0/0/1 to False -- __init__.py:parse_telegram:190 2018-01-21 21:54:02,413 DEBUG Main knx: 1.1.2 set 0/0/2 to False -- __init__.py:parse_telegram:190 2018-01-21 21:54:02,434 DEBUG Main knx: 1.1.6 set 0/0/2 to True -- __init__.py:parse_telegram:190 2018-01-21 21:54:02,434 DEBUG Main Item melder.melder2 = True via KNX 1.1.6 0/0/2 -- item.py:__update:363 2018-01-21 21:54:03,784 [B]DEBUG Scheduler 1w-disc next time[/B]: 2018-01-21 22:04:03+01:00 -- scheduler.py:_next_time:289 2018-01-21 21:54:03,794 [B]DEBUG Connections WebSocket: binding to 0.0.0.0:2424 (TCP)[/B] -- connection.py:connect:161 2018-01-21 21:54:03,794 [B]DEBUG Connections CLI: binding to 0.0.0.0:2323 (TCP) [/B]-- connection.py:connect:161 2018-01-21 21:54:05,213 DEBUG Main knx: 1.1.6 set 0/0/2 to False -- __init__.py:parse_telegram:190 2018-01-21 21:54:05,214 DEBUG Main Item melder.melder2 = False via KNX 1.1.6 0/0/2 -- item.py:__update:363 2018-01-21 21:54:06,789 DEBUG env_init Item env.core.version = 1.0-45-g02cf972 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,792 DEBUG env_loc Item env.location.sunrise = 2018-01-22 08:08:27.708878+01:00 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,801 DEBUG sh.gc Garbage collector: collected 0 objects. -- smarthome.py:_garbage_collection:498 2018-01-21 21:54:06,801 DEBUG env_init Item env.core.start = 2018-01-21 21:54:06.801438+01:00 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,804 DEBUG env_loc Item env.location.sunset = 2018-01-22 16:51:36.639875+01:00 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,812 DEBUG sh.gc Object references: 11441 -- smarthome.py:_maintenance:490 2018-01-21 21:54:06,812 DEBUG env_init Item env.system.name = debianCat via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,816 DEBUG env_loc Item env.location.moonrise = 2018-01-22 10:38:26.412149+01:00 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,819 DEBUG env_loc Item env.location.moonset = 2018-01-22 22:42:13.184553+01:00 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,821 DEBUG env_loc Item env.location.moonphase = 1 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,821 DEBUG env_init Item env.system.start = 2018-01-21 09:17:13.821597+01:00 via Logic None None -- item.py:__update:363 2018-01-21 21:54:06,824 DEBUG env_loc Item env.location.night = True via Logic None None -- item.py:__update:363 2018-01-21 21:54:07,291 DEBUG Scheduler sh.gc next time: 2018-01-22 02:04:00+01:00 -- scheduler.py:_next_time:289 2018-01-21 21:54:07,300 DEBUG Scheduler env_loc next time: 2018-01-21 22:24:07+01:00 -- scheduler.py:_next_time:289 2018-01-21 21:54:11,314 DEBUG env_stat Item env.core.threads = 8 via Logic None None -- item.py:__update:363 2018-01-21 21:54:11,315 DEBUG env_stat Item env.core.memory = 20062208 via Logic None None -- item.py:__update:363 2018-01-21 21:54:11,315 DEBUG env_stat Item env.system.load = 0.24 via Logic None None -- item.py:__update:363 2018-01-21 21:54:11,316 DEBUG env_stat Item env.location.moonlight = 20 via Logic None None -- item.py:__update:363 2018-01-21 21:54:11,807 DEBUG Scheduler env_stat next time: 2018-01-21 21:59:11+01:00 -- scheduler.py:_next_time:289 2018-01-21 21:54:12,313 INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66 2018-01-21 21:54:22,328 INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66 2018-01-21 21:54:23,752 DEBUG Main WebSocket: incoming connection from 192.168.0.191:46522 to 0.0.0.0:2424 -- connection.py:accept:188 2018-01-21 21:54:23,755 DEBUG Main 192.168.0.191:46522 sent '{"cmd":"proto","ver":4}' -- __init__.py:json_parse:270 2018-01-21 21:54:23,755 [B]WARNING Main WebSocket: protocol mismatch[/B]. Update SmartHome.py -- __init__.py:json_parse:352 2018-01-21 21:54:23,763 DEBUG Main 192.168.0.191:46522 sent '{"cmd":"identity","sw":"smartVISU","ver":"v2.8","browser":"Firefox","bver":"52"}' -- __init__.py:json_parse:270 2018-01-21 21:54:23,768 DEBUG Main 192.168.0.191:46522 sent '{"cmd":"monitor","items":["meldungen.light","meldungen.LED1","meldungen.LED2","1ws.tempBBX"]}' -- __init__.py:json_parse:270 2018-01-21 21:54:32,343 INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66 2018-01-21 21:54:42,357 INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66 2018-01-21 21:54:52,372 INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66 2018-01-21 21:55:02,386 INFO Connections 1-Wire: connected to 192.168.0.163:2121 -- __init__.py:connect:66 ... hier geht es nun immer so weiter mit Connections 1-Wire ... ^C 2018-01-21 21:55:03,585 INFO Main Number of Threads: 8 -- smarthome.py:stop:348 2018-01-21 21:55:03,585 INFO Main Stop Plugins -- plugin.py:stop:70 2018-01-21 21:55:03,585 DEBUG Main WebSocketHandler: closing socket 192.168.0.191:46522 -- connection.py:close:303 2018-01-21 21:55:03,585 DEBUG Main KNX: closing socket 192.168.0.163:6720 -- connection.py:close:303 2018-01-21 21:55:04,384 INFO Main SmartHome.py stopped -- smarthome.py:stop:372
Andreas
Kommentar