HomeBrewWired - Diskussion zum Tutorial

Begonnen von Thorsten Pferdekaemper, 01 Dezember 2016, 22:03:19

Vorheriges Thema - Nächstes Thema

loetmeister

Hi,

damit müsste die Adresse 0x00000010 (dezimal 16) sein. Sollte eigentlich kein Problem sein, außer es gibt schon ein Gerät mit der Adresse?
Steht was im FHEM log?

EEPROM löschen ginge per ISP. Sonst mal temporär in HBWired.cpp, factoryReset() zulassen den kompletten Bereich, inkl. der letzen 4 byte - da steht die eigene Adresse - zu löschen: "i <= E2END - 4" in "i <= E2END" ändern... Sketch neu aufspielen und mit dem Config Taster ein Reset machen.

void HBWDevice::factoryReset() {
  // writes FF into EEPROM, without upper 4 Bytes
  for(uint16_t i = 0; i <= E2END - 4; i++) {
    writeEEPROM(i, 0xFF, false);
  };


Gruß,
Thomas

Thorsten Pferdekaemper

Hi,
in der Arduino-Umgebung gibt es ein Beispielprogramm "eeprom_clear". Allerdings schreibt das Nullen ins EEPROM. Das muss auf 255 geändert werden, dann kann man damit auch das EEPROM wieder auf "leer" setzen.
Gruß,
   Thorsten
FUIP

Fhemmichl

Hi,

@Thomas: Es gab noch kein Gerät mit der Adresse aber im Fhemlog ist auch nichts erschienen.
@Thorsten: Das mit dem eeprom_clear hatte ich schon getestet allerdings mit 0.
   Als ich es jetzt mit 255 zurückgesetzt habe, hat es nach dem neu drauf laden auch wieder funktioniert.

Vielen Dank euch beiden.

Gruß
Michael

Thorsten Pferdekaemper

Zitat von: Fhemmichl am 01 April 2019, 20:26:17
@Thomas: Es gab noch kein Gerät mit der Adresse aber im Fhemlog ist auch nichts erschienen.
Adressen bis einschließlich 255 (000000FF) werden kommentarlos ignoriert, da diese für die Zentrale(n) reserviert sind.
Gruß,
   Thorsten
FUIP

a_quadrat

Hallo Thorsten,

danke für dein Tutorial, sehr anschaulich beschrieben und nachvollziehbar. Ich habe es jetzt bis Folge 7 durchgearbeitet und es funktioniert alles soweit gut. Ich habe nur ein Problem, dass das Gerät nach dem 1. oder 2. RAW Befehl auf "RESPONSE TIMOUT"  geht. Aber die Befehle werden weiterhin ohne Problem ausgeführt. Ich habe mal den Arduino mit dem HBW_LC_Bl_4 Sketch geflasht und es ist das gleiche Verhalten zu beobachten. Die Relais schalten ohne Probleme, aber das Gerät steht auf "RESPONSE TIMOUT".
Woran kann das liegen?

VG Andreas

Thorsten Pferdekaemper

Hi,
steht irgendwas im FHEM-Log? Wenn nicht, dann mal den log-Level für HM485 (also am besten für das HM485_LAN-Device) hochsetzen und nochmal probieren. ...und dann mal im Log nachsehen.
Gruß,
   Thorsten
FUIP

a_quadrat

ich habe den Loglevel auf 5 gesetzt und es kommt folgendes:

2019.06.24 14:23:59 5: HM_485: HM485_LAN_Write TX: 33
2019.06.24 14:23:59 5: SW: fd02214b
2019.06.24 14:23:59 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 33 Cmd: 97
2019.06.24 14:23:59 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (33) 00 AliveStatus: 00
2019.06.24 14:24:19 5: HM_485: HM485_LAN_Write TX: 34
2019.06.24 14:24:19 5: SW: fd02224b
2019.06.24 14:24:19 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 34 Cmd: 97
2019.06.24 14:24:19 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (34) 00 AliveStatus: 00
2019.06.24 14:24:39 5: HM_485: HM485_LAN_Write TX: 35
2019.06.24 14:24:39 5: SW: fd02234b
2019.06.24 14:24:39 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 35 Cmd: 97
2019.06.24 14:24:39 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (35) 00 AliveStatus: 00
2019.06.24 14:24:59 5: HM_485: HM485_LAN_Write TX: 36
2019.06.24 14:24:59 5: SW: fd02244b
2019.06.24 14:24:59 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 36 Cmd: 97
2019.06.24 14:24:59 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (36) 00 AliveStatus: 00
2019.06.24 14:25:04 5: HM_485: HM485_LAN_Write TX: 37
2019.06.24 14:25:04 5: HM_485: HM485_LAN_SendQueueNextItem: QID: 00000020
2019.06.24 14:25:04 5: SW: fd0f2553c8420000171e00000001780000
2019.06.24 14:25:04 4: HM_485: HM_485: TX: (37) I[3](0,F,B)(1E) 00000001 -> 42000017 [5] 78(x) 0000
2019.06.24 14:25:05 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 37 Cmd: 97
2019.06.24 14:25:05 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (37) 3439 AliveStatus: 34
2019.06.24 14:25:05 5: HM_485: HM485_LAN_DispatchNack: Start
2019.06.24 14:25:05 5: HM_485: HM485_LAN_DispatchNack: Message: �%aB
2019.06.24 14:25:05 5: HM_485: dispatch �\003%a\001B\000\000\027
2019.06.24 14:25:05 5: HM_485: HM485_Parse: MsgId: 37
2019.06.24 14:25:05 5: HM_485: HM485_QueueStepFailed Request ID: 37
2019.06.24 14:25:05 3: HBW_LC_Bl_4_HBW7296279: RESPONSE TIMEOUT for 42000017
2019.06.24 14:25:05 5: HM_485: HM485_LAN_CheckResendQueueItems: QID: 00000020
2019.06.24 14:25:05 5: HM_485: HM485_LAN_CheckResendQueueItems: DispatchNack
2019.06.24 14:25:05 5: HM_485: HM485_LAN_DispatchNack: Start

Thorsten Pferdekaemper

Hi,
das sieht auf den ersten Blick tatsächlich etwas seltsam aus. Was hast Du denn für ein Interface? D.h. was ist das HM485_LAN physikalisch?
Gruß,
   Thorsten
FUIP

a_quadrat

Hi,

einen Standard USB 2.0 to TTL RS485 Serial Converter, von Ali.
Den habe ich auch an meinem Hauptserver und er funktioniert mit Homematic Geräten gut. Hast du eine Empfehlung für mich?

VG Andreas

Thorsten Pferdekaemper

Hi,
ok, das sieht prinzipiell mal gut aus. Also wenn ich das richtig verstehe, dann hast Du sozusagen Dein Hauptsystem mit "echten" HMW-Geräten und ein Entwicklungssystem mit dem HBW-Teil. Hast Du schon einmal versucht, ein "echtes" HMW-Gerät an das Entwicklungssystem zu hängen?
Könntest Du außerdem auch nochmal den Sketch aus dem Tutorial auf den Arduino laden und damit ein Level-5-Log zeigen?
...außerdem wäre ein Log vom Daemon interessant.
Gruß,
   Thorsten
FUIP

a_quadrat

Ja, das ist richtig. Ich habe kein HMW Gerät mehr rumliegen - muss ich erst ausbauen und zurücksetzen. Ich packe heute Nachmittag nochmal den Sketch aus dem Tutorial drauf und schaue mal im Daemon Log.

VG Andreas

a_quadrat

Hi,

so sieht der Log Auszug mit dem Tutorial Sketch aus:

2019.06.25 16:56:33 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 14 Cmd: 97
2019.06.25 16:56:33 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (14) 00 AliveStatus: 00
2019.06.25 16:56:53 5: HM_485: HM485_LAN_Write TX: 15
2019.06.25 16:56:53 5: SW: fd020f4b
2019.06.25 16:56:53 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 15 Cmd: 97
2019.06.25 16:56:53 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (15) 00 AliveStatus: 00
2019.06.25 16:57:13 5: HM_485: HM485_LAN_Write TX: 16
2019.06.25 16:57:13 5: SW: fd02104b
2019.06.25 16:57:13 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 16 Cmd: 97
2019.06.25 16:57:13 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (16) 00 AliveStatus: 00
2019.06.25 16:57:33 5: HM_485: HM485_LAN_Write TX: 17
2019.06.25 16:57:33 5: SW: fd02114b
2019.06.25 16:57:33 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 17 Cmd: 97
2019.06.25 16:57:33 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (17) 00 AliveStatus: 00
2019.06.25 16:57:57 5: HM_485: HM485_LAN_Write TX: 18
2019.06.25 16:57:57 5: SW: fd02124b
2019.06.25 16:57:57 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 18 Cmd: 97
2019.06.25 16:57:57 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (18) 00 AliveStatus: 00
2019.06.25 16:58:09 5: HM_485: HM485_LAN_Write TX: 19
2019.06.25 16:58:09 5: HM_485: HM485_LAN_SendQueueNextItem: QID: 00000009
2019.06.25 16:58:09 5: SW: fd0f1353c84200001718000000017300c8
2019.06.25 16:58:09 4: HM_485: HM_485: TX: (19) I[0](0,F,B)(18) 00000001 -> 42000017 [5] 73(s) 00C8
2019.06.25 16:58:10 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 19 Cmd: 97
2019.06.25 16:58:10 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (19) 3439 AliveStatus: 34
2019.06.25 16:58:10 5: HM_485: HM485_LAN_DispatchNack: Start
2019.06.25 16:58:10 5: HM_485: HM485_LAN_DispatchNack: Message: �aB
2019.06.25 16:58:10 5: HM_485: dispatch �\003\023a\001B\000\000\027
2019.06.25 16:58:10 5: HM_485: HM485_Parse: MsgId: 19
2019.06.25 16:58:10 5: HM_485: HM485_QueueStepFailed Request ID: 19
2019.06.25 16:58:10 3: HBW_TUTORIAL_HBW7296279: RESPONSE TIMEOUT for 42000017
2019.06.25 16:58:10 5: HM_485: HM485_LAN_CheckResendQueueItems: QID: 00000009
2019.06.25 16:58:10 5: HM_485: HM485_LAN_CheckResendQueueItems: DispatchNack
2019.06.25 16:58:10 5: HM_485: HM485_LAN_DispatchNack: Start
2019.06.25 16:58:30 5: HM_485: HM485_LAN_Write TX: 20
2019.06.25 16:58:30 5: SW: fd02144b
2019.06.25 16:58:30 5: HM_485: HM485_LAN_parseIncommingCommand: MsgId: 20 Cmd: 97
2019.06.25 16:58:30 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (20) 00 AliveStatus: 00


Im Deamon Log gibt es dazu keine Einträge.

Ich habe mir noch ein HMW Device bestellt.

VG Andreas

Thorsten Pferdekaemper

Hi,
was mich momentan wundert ist vor Allem diese Zeile:

2019.06.25 16:58:10 5: HM_485: HM485_LAN_parseIncommingCommand: Alive: (19) 3439 AliveStatus: 34

Normalerweise sollte da nur 00 oder 01 ankommen, aber nicht 3439 oder sowas.
Wahrscheinlich hast Du das Logging vom Daemon nicht eingeschaltet. Könntest Du mal folgendes versuchen:
1. Das Loglevel für den HM485_LAN und HM485 wieder auf was normales stellen.
2. Für den HM485_LAN: attr <hm485_lan> HM485d_logVerbose 5
3. set <hm485_lan> restart

...und dann mal nachsehen, was so alles im Log landet.

Gruß,
   Thorsten
FUIP

a_quadrat

Hi,

habe ich gemacht und sieht folgendermaßen aus. Ist was auffällig?

2019.06.26 09:36:27.981 0: HM485d: Server stopped ...
2019.06.26 09:36:27 3: HM_485: HM485d with PID 16573 was terminated.
2019.06.26 09:36:28 3: HM_485: Start HM485d with command line: ./FHEM/lib/HM485/HM485d/HM485d.pl --hmwId 00000001 --serialNumber SGW0123456 --device /dev/ttyUSB0 --localPort 2000 --verbose 5
2019.06.26 09:36:28 3: HM_485: HM485d was started with PID: 27178
2019.06.26 09:36:28 3: HM_485: Connect to HM485d delayed for 5 seconds
2019.06.26 09:36:29.439 3: HM485d: port 2000 opened
2019.06.26 09:36:29.439 3: HM485d: server waiting for client connection on port 2000
2019.06.26 09:36:29.440 3: Opening SERIAL device /dev/ttyUSB0
2019.06.26 09:36:29.588 3: SERIAL device opened
2019.06.26 09:36:29.593 3: HM485d: SERIALbaudrate=19200, databits=8, parity=even, stopbits=1, handshake=none
2019.06.26 09:36:29.595 2: HM485d: SERIAL connected to device /dev/ttyUSB0
2019.06.26 09:36:29.595 1: HM485d: Server started ...
2019.06.26 09:36:33 3: Opening HM_485 device localhost:2000
2019.06.26 09:36:33 3: HM_485: connected to device localhost:2000
2019.06.26 09:36:33 3: HM_485 device opened
2019.06.26 09:36:33.303 4: Connection accepted from HM485d_127.0.0.1_54218
2019.06.26 09:36:33.304 4: HM485d: Tx: H00,01,HMW-SOFT-GW,0.2.2,SGW0123456

2019.06.26 09:36:33 3: HM_485: Lan Device Information
2019.06.26 09:36:33 3: HM_485: Protocol-Version: 01
2019.06.26 09:36:33 3: HM_485: Interface-Type: HMW-SOFT-GW
2019.06.26 09:36:33 3: HM_485: Firmware-Version: 0.2.2
2019.06.26 09:36:33 3: HM_485: Serial-Number: SGW0123456
2019.06.26 09:36:33 3: HM_485: Initialize the interface
2019.06.26 09:36:33.311 4: HM485d: Rx: FD3E30312C303030300D0A
2019.06.26 09:36:53.320 4: HM485d: Rx: FD02024B
2019.06.26 09:36:53.322 4: HM485d: Tx: FD03026100
2019.06.26 09:37:13.332 4: HM485d: Rx: FD02034B
2019.06.26 09:37:13.333 4: HM485d: Tx: FD03036100
2019.06.26 09:37:33.340 4: HM485d: Rx: FD02044B
2019.06.26 09:37:33.341 4: HM485d: Tx: FD03046100
2019.06.26 09:37:53.352 4: HM485d: Rx: FD02054B
2019.06.26 09:37:55.105 4: HM485d: Tx: FD03056100
2019.06.26 09:38:15.112 4: HM485d: Rx: FD02064B
2019.06.26 09:38:15.113 4: HM485d: Tx: FD03066100



VG Andreas

Thorsten Pferdekaemper

Hi,
das sind nur Keepalive-Messages, also da wird weder was zum Device gesendet noch kommt was vom Device.
Kannst Du mal so ein Log machen während Du ein Kommando zum Device schickst?
Gruß,
   Thorsten
FUIP