Cannot create socket HM485d: Can't open server port at 2000: Address already in

Begonnen von Arno.Kahle, 18 Januar 2017, 22:51:20

Vorheriges Thema - Nächstes Thema

Thorsten Pferdekaemper

Zitat von: Arno.Kahle am 20 Januar 2017, 14:05:09
nachdem ich in den Init-Scripten im rc2.d das Startscript für ser2net deaktiviert habe, started fhem jetzt mit dem RS485 Bus durch.
Ok, Du hättest auch einfach einen wirklich freien Port nehmen können.

ZitatEine Kommunikation zu dem HMW-IO-12-Sw7-DR scheint aber trotzdem noch nicht zu funktionieren. Ein autocreate liefert mir auch keinen Eintrag, wie im Wiki beschrieben, dass man wenigstens erstmal mit Betätigung eines Eingangsschalters einen Eintrag generiert.
Wie hast Du das ganze genau angeschlossen?

ZitatDie Lampe am Device blinkt nur beim Einschalten.
Daraufhin habe ich das Device einmal gemäß dem Eintrag im Wiki von Hand eingetragen,
Dass das funktioniert ist sehr unwahrscheinlich. Wo steht denn das im Wiki?

Lösche das Device mal wieder. Setze dann im RS485_Bus sowohl verbose als auch HM485d_verbose auf 5 und starte den Daemon neu. (Oder gleich FHEM.) Dann drücke mal auf eine Taste am 12/7 (also eine Taste, die an einem der Eingänge angeschlossen ist). Ich hätte dann gerne das Log.

Zitat
Ich denke, vielleicht ist das jetzt dann auch besser als neues Thema geeignet?
Nee, lass mal "mein 12/7 redet nicht mit mir" gibt es schon ein paar Mal. Es kam auch schon vor, dass die Dinger einfach kaputt sind.

Gruß,
   Thorsten
FUIP

Thorsten Pferdekaemper

Noch was: Woher weißt Du, dass die Adresse des Geräts 0000BA81 ist?
Gruß,
   Thorsten
FUIP

Arno.Kahle

Hi Thorsten,

ok, ok ... natürlich
McMurphy hatte vorher schon auf Port 3000 probiert, der prompt auch von ser2net belegt war....
Hab beides jetzt laufen mit HM485d auf 2020.

Der Anschluss ist provisorisch mit 40 cm paarweise verdrilltem und geschirmten Kommunikationskabel. Der Schirm liegt am 12/7 auf Masse. Abschluss direkt an den Klemmen jeweils mit 150 Ohm.

list RS485_Bus:

[codeInternals:
   DEF        localhost:2020
   DeviceName localhost:2020
   FD         17
   HM485d_CommandLine ./FHEM/lib/HM485/HM485d/HM485d.pl --hmwId 00000001 --serialNumber SGW0123456 --device /dev/ttyAMA0 --localPort 2020 --verbose 5
   HM485d_PID  2677
   HM485d_STATE started
   InterfaceType HMW-SOFT-GW
   NAME       RS485_Bus
   NR         117
   PARTIAL
   ProtokolVersion 01
   STATE      opened
   SerialNumber SGW0123456
   TYPE       HM485_LAN
   Version    0.2.2
   hmwId      00000001
   msgCounter 65
   Readings:
     2017-01-20 22:06:35   state           opened
   Keepalive:
     ok         1
     retry      0
Attributes:
   HM485d_bind 1
   HM485d_device /dev/ttyAMA0
   HM485d_logVerbose 5
   hmwId      00000001
   room       HM485 ]


Logfile fhem.log und mit grep 485 gefiltert rs485.log im Anhang.

Ich hatte dazu den HM485d erstmal restarted und dann musste ich erst durchs Haus laufen, habe mit der Drahtbrücke an Masse mehrere Kontakte kurz geerdet...
und zurück bis ich stoppen konnte..
Nach dem kurzen Überfliegen, glaub ich, kann man was raus lesen..
Bin auf Deine Antwort gespannt.

Hey, herzlichen Dank und viele Grüße
Arno

Arno.Kahle

Hab noch weiter gemacht und da der autocreate nicht lief doch die Eintragungen von Hand aufgesetzt und angepasst:

list:

Internals:
   DEF        00014EA9
   FailedConfigReads 0
   IODev      RS485_Bus
   NAME       IO12_7MEQ1769873
   NR         120
   STATE      ACK
   TYPE       HM485
   Readings:
     2017-01-21 00:06:27   configStatus    READING
     2017-01-21 00:05:34   state           ACK
Attributes:
   IODev      RS485_Bus
   room       HM485
   verbose    5


In der Anlage ist dann noch einmal der "485" gefilterte Log.

Was fehlt FHEM noch?

Gruß
Arno

Thorsten Pferdekaemper

Zitat von: Arno.Kahle am 20 Januar 2017, 23:05:04
Abschluss direkt an den Klemmen jeweils mit 150 Ohm.
Kann sein, dass Du damit Deinen 12/7 gekillt hast. Mach den Widerstand raus. Bei HMW darfst Du keinen solchen Busabschluss einbauen. Der so genannte HMW-Busabschluss ist ein Pullup-Pulldown-Widerstandsnetzwerk. Das braucht man aber auch erstmal nicht.
FUIP

Thorsten Pferdekaemper

Hi,
der Tastendruck wird definitiv von FHEM empfangen. Die logs sehen so aus, als ob das Device zwar sendet, und FHEM was empfängt, aber das Device nichts empfängt, wenn FHEM sendet. Außerdem geht da irgendwas schief mit Deinen eigenen define-Versuchen und dem autocreate.
Braucht Deine RS485-Schnittstelle irgendwas spezielles um in den Sendemodus zu gehen? Ich gehe fast davon aus, da das wohl meistens der Fall ist, wenn man was direkt an den RasPi ansteckt. Der Digitus-Stick macht das von selbst.
Ansonsten: Mach mal die Verkabelung wie "vorgeschrieben" und nicht mehr. Also +24V an +24V, GND an GND, die beiden Busleitungen und den Taster nach GND. Ansonsten nichts mit Widerständen, Schirmungen oder sonstigem Kram.
Dann am Besten FHEM mal komplett durchstarten (shutdown restart). Wenn alles wieder da ist und der RS485_Bus alles ok zeigt, die Taste drücken.
Gruß,
   Thorsten
FUIP

Arno.Kahle

Moin Thorsten,

ich werd nicht müde Dir zu danken ..... Du liegst verdammt gut in Deinen Ratschlägen.  8)

Hab umgebaut, nach Deinen Angaben..
fhem.cfg befreit von alten Angaben/Definitionen zum 12/7
Raspi aus- und eingeschaltet
Bus RS485 stop
12/7 eingeschaltet
Bus gestartet und nach einer Weile Taste gedrückt
Das Device HMW_IO ... wurde mit autocreate angelegt.

Die Kommunikation zeigt zwar timeouts, aber wenige im Verhältnis zum gesamten Datenaustausch.. Ist das ein Problem, unschön, bzw. irritierend ist es schon ein wenig.

Der Digitus ist für nachher per DHL angekündigt.

Die Verdrahtung von mir war nach einer allgemeinen Beschreibung (der Norm) für den RS485 Bus.... Bis auf die Schirmung, die bei diesem Kabel halt vorhanden ist.
Macht HM da was abweichendes?

Wie bekomme ich jetzt die einzelnen IO-Kanäle, damit ich schalten und auswerten kann?

Gruß
Arno


Arno.Kahle

Hi Thorsten,

digitus ist da und machts möglich :)

Internals:
   CFGFN
   DEF        00014EA9
   FW_VERSION 3.06
   FailedConfigReads 0
   IODev      RS485_Bus
   MODEL      HMW_IO_12_Sw7_DR
   NAME       HMW_IO_12_Sw7_DR_MEQ1769873
   NR         117
   STATE      ACK
   TYPE       HM485
   channel_01 HMW_IO_12_Sw7_DR_MEQ1769873_01
   channel_02 HMW_IO_12_Sw7_DR_MEQ1769873_02
   channel_03 HMW_IO_12_Sw7_DR_MEQ1769873_03
   channel_04 HMW_IO_12_Sw7_DR_MEQ1769873_04
   channel_05 HMW_IO_12_Sw7_DR_MEQ1769873_05
   channel_06 HMW_IO_12_Sw7_DR_MEQ1769873_06
   channel_07 HMW_IO_12_Sw7_DR_MEQ1769873_07
   channel_08 HMW_IO_12_Sw7_DR_MEQ1769873_08
   channel_09 HMW_IO_12_Sw7_DR_MEQ1769873_09
   channel_10 HMW_IO_12_Sw7_DR_MEQ1769873_10
   channel_11 HMW_IO_12_Sw7_DR_MEQ1769873_11
   channel_12 HMW_IO_12_Sw7_DR_MEQ1769873_12
   channel_13 HMW_IO_12_Sw7_DR_MEQ1769873_13
   channel_14 HMW_IO_12_Sw7_DR_MEQ1769873_14
   channel_15 HMW_IO_12_Sw7_DR_MEQ1769873_15
   channel_16 HMW_IO_12_Sw7_DR_MEQ1769873_16
   channel_17 HMW_IO_12_Sw7_DR_MEQ1769873_17
   channel_18 HMW_IO_12_Sw7_DR_MEQ1769873_18
   channel_19 HMW_IO_12_Sw7_DR_MEQ1769873_19
   Readings:
     2017-01-21 15:19:50   R-central_address 00000001
     2017-01-21 15:19:50   R-logging_time  2.00
     2017-01-21 15:19:49   configStatus    OK
     2017-01-21 15:19:46   press_long      43
     2017-01-21 15:28:53   state           ACK
   Cache:
     Linkparams:
       Actuator:
         address_start 857
         address_step 6
         channel_param channel
         channels   01 02 03 04 05 06 07 08 09 10 11 12
         count      27
         peer_param actuator
         type       link
         Parameter:
           Actuator:
             hidden     1
             operations none
             Logical:
               type       address
             physical:
               HASH(0x32a34c0)
               HASH(0x32a3598)
           Channel:
             hidden     1
             operations none
             Logical:
               default    255
               max        255
               min        0
               type       integer
             Physical:
               interface  eeprom
               size       1
               type       integer
               Address:
                 index      0
       Sensor:
         address_start 45
         address_step 28
         channel_param channel
         channels   13 14 15 16 17 18 19
         count      29
         peer_param sensor
         type       link
         Parameter:
           Channel:
             hidden     1
             operations none
             Logical:
               default    255
               max        255
               min        0
               type       integer
             Physical:
               interface  eeprom
               size       1
               type       integer
               Address:
                 index      5
           Long_action_type:
             Logical:
               type       option
               option:
                 HASH(0x32c9b58)
                 HASH(0x32c9ba0)
             Physical:
               interface  eeprom
               size       0.1
               type       integer
               Address:
                 index      17
           Long_jt_off:
             Logical:
               type       option
               option:
                 HASH(0x32c9df8)
                 HASH(0x32c9e58)
                 HASH(0x32c9ea0)
                 HASH(0x32c9ee8)
                 HASH(0x32c9f30)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      26.9
           Long_jt_offdelay:
             Logical:
               type       option
               option:
                 HASH(0x32cba80)
                 HASH(0x32cbac8)
                 HASH(0x32cbb10)
                 HASH(0x32cbb58)
                 HASH(0x32cbbb8)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      26.6
           Long_jt_on:
             Logical:
               type       option
               option:
                 HASH(0x32cbe70)
                 HASH(0x32cbeb8)
                 HASH(0x32cbf00)
                 HASH(0x32cbf60)
                 HASH(0x32cbfa8)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      26.3
           Long_jt_ondelay:
             Logical:
               type       option
               option:
                 HASH(0x32cc260)
                 HASH(0x32cc2a8)
                 HASH(0x32cc308)
                 HASH(0x32cc350)
                 HASH(0x32cc398)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      26
           Long_multiexecute:
             Logical:
               default    1
               type       boolean
             Physical:
               interface  eeprom
               size       0.1
               type       integer
               Address:
                 index      17.2
           Long_off_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    16383000
               max        982980
               min        0
               type       float
               unit       s
               Special_value:
                 id         not_used
                 value      16383000
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      24
           Long_off_time_mode:
             Logical:
               type       option
               option:
                 HASH(0x32cd870)
                 HASH(0x32cd8b8)
             Physical:
               interface  eeprom
               size       0.1
               type       integer
               Address:
                 index      17.6
           Long_offdelay_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    0
               max        982980
               min        0
               type       float
               unit       s
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      22
           Long_on_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    16383000
               max        982980
               min        0
               type       float
               unit       s
               Special_value:
                 id         not_used
                 value      16383000
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      20
           Long_on_time_mode:
             Logical:
               type       option
               option:
                 HASH(0x32cfb88)
                 HASH(0x32cfbd0)
             Physical:
               interface  eeprom
               size       0.1
               type       integer
               Address:
                 index      17.7
           Long_ondelay_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    0
               max        982980
               min        0
               type       float
               unit       s
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      18
           Long_toggle_use:
             Conversion:
               type       option_integer
               Value_map:
                 1:
                   device_value 3
                   from_device 1
                   parameter_value 0
                   to_device  1
                 2:
                   device_value 2
                   from_device 1
                   parameter_value 1
                   to_device  1
                 3:
                   device_value 0
                   from_device 1
                   parameter_value 2
                   to_device  1
             Logical:
               type       option
               option:
                 HASH(0x32d00b0)
                 HASH(0x32d0110)
                 HASH(0x32d0158)
             Physical:
               interface  eeprom
               size       0.2
               type       integer
               Address:
                 index      17.4
           Sensor:
             hidden     1
             operations none
             Logical:
               type       address
             physical:
               HASH(0x32d0458)
               HASH(0x32d0530)
           Short_action_type:
             Logical:
               type       option
               option:
                 HASH(0x32d06b0)
                 HASH(0x32d06f8)
             Physical:
               interface  eeprom
               size       0.1
               type       integer
               Address:
                 index      6
           Short_jt_off:
             Logical:
               type       option
               option:
                 HASH(0x32d0950)
                 HASH(0x32d09b0)
                 HASH(0x32d09f8)
                 HASH(0x32d0a40)
                 HASH(0x32d1278)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      15.9
           Short_jt_offdelay:
             Logical:
               type       option
               option:
                 HASH(0x32d1530)
                 HASH(0x32d1578)
                 HASH(0x32d15c0)
                 HASH(0x32d1608)
                 HASH(0x32d1668)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      15.6
           Short_jt_on:
             Logical:
               type       option
               option:
                 HASH(0x32d1920)
                 HASH(0x32d1968)
                 HASH(0x32d19b0)
                 HASH(0x32d1a10)
                 HASH(0x32d1a58)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      15.3
           Short_jt_ondelay:
             Logical:
               type       option
               option:
                 HASH(0x32d1d10)
                 HASH(0x32d1d58)
                 HASH(0x32d1db8)
                 HASH(0x32d1e00)
                 HASH(0x32d1e48)
             Physical:
               endian     little
               interface  eeprom
               read_size  2
               size       0.3
               type       integer
               Address:
                 index      15
           Short_off_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    16383000
               max        982980
               min        0
               type       float
               unit       s
               Special_value:
                 id         not_used
                 value      16383000
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      13
           Short_off_time_mode:
             Logical:
               type       option
               option:
                 HASH(0x32d4170)
                 HASH(0x32d41b8)
             Physical:
               interface  eeprom
               size       0.1
               type       integer
               Address:
                 index      6.6
           Short_offdelay_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    0
               max        982980
               min        0
               type       float
               unit       s
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      11
           Short_on_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    16383000
               max        982980
               min        0
               type       float
               unit       s
               Special_value:
                 id         not_used
                 value      16383000
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      9
           Short_on_time_mode:
             Logical:
               type       option
               option:
                 HASH(0x32d5460)
                 HASH(0x32d54a8)
             Physical:
               interface  eeprom
               size       0.1
               type       integer
               Address:
                 index      6.7
           Short_ondelay_time:
             Conversion:
               1:
                 factors    0.1,1,60,1000
                 type       float_configtime
                 value_size 1.6
               2:
                 type       integer_integer_map
                 Value_map:
                   device_value 49152
                   mask       49152
                   parameter_value 65535
             Logical:
               default    0
               max        982980
               min        0
               type       float
               unit       s
             Physical:
               endian     little
               interface  eeprom
               size       2
               type       integer
               Address:
                 index      7
           Short_toggle_use:
             Conversion:
               type       option_integer
               Value_map:
                 1:
                   device_value 3
                   from_device 1
                   parameter_value 0
                   to_device  1
                 2:
                   device_value 2
                   from_device 1
                   parameter_value 1
                   to_device  1
                 3:
                   device_value 0
                   from_device 1
                   parameter_value 2
                   to_device  1
             Logical:
               type       option
               option:
                 HASH(0x32d5988)
                 HASH(0x32d59e8)
                 HASH(0x32d5a30)
             Physical:
               interface  eeprom
               size       0.2
               type       integer
               Address:
                 index      6.4
           Ui_hint:
             Logical:
               default
               type       string
               use_default_on_failure 1
             Physical:
               id         ui_hint
               interface  store
               save_on_change 1
               type       string
     Peers:
       Sensors:
         0:
           Sensor:
             channel    255
Attributes:
   IODev      RS485_Bus
   firmwareVersion 3.06
   model      HMW_IO_12_Sw7_DR
   room       HM485
   serialNr   MEQ1769873


Zunächst hab ich crc Fehler gehabt. Nachdem ich meine 150 Ohm als Abschlusswiderstand auf die Klemmen von 12/7 geklemmt hab, war alles gut und alles quasi sofort da. Ein Eingang reagiert leider nicht, vielleicht hat der was abbekommen. Ich resette mal, sonst komme ich auch ohne aus.

Also Zusammenfassung:

Leute, keine conrad Aufsteckkarter für RS485 verwenden, sondern wirklich nur die Empfehlung aus den Wiki Digitus.

Vielen Dank noch einmal und Grüße aus Hannover




Thorsten Pferdekaemper

Zitat von: Arno.Kahle am 21 Januar 2017, 15:40:00Nachdem ich meine 150 Ohm als Abschlusswiderstand auf die Klemmen von 12/7 geklemmt hab, war alles gut
Hi,
auch wenn das geklappt hat rate ich davon dringend ab! Vielleicht eher den so genannten Abschlusswiderstand von eq3 einbauen. Siehe auch meine kleine Abhandlung hier:
https://forum.fhem.de/index.php/topic,65493.0.html
Gruß,
   Thorsten
FUIP