[ gelöst ] 6 fach Taster HM-PB-6-WM55 und 4 fach Aktor HM-LC-SW4-DR

Begonnen von UweUwe, 29 März 2020, 19:58:08

Vorheriges Thema - Nächstes Thema

Otto123

Wenn Du die ganze Zeile verwendest, gehört echo dazu:
echo "4000:raw:0:/dev/ttyAMA0:115200 NONE 1STOPBIT 8DATABITS HANGUP_WHEN_DONE" >> /etc/ser2net.conf

Das ist meine Art zu beschreiben was man tun muss, aber das funktioniert nur im "ganzen Satz"
echo "string" >>Datei
Hängt eine Zeile an eine existierende Datei an.

Dein Fragment meiner Zeile ist in sich sinnlos :)

Ich weiß nicht wie jetzt Deine ser2net.conf aussieht. Sinnlose Zeilen würde ich dort nicht lassen.
Meine für den hmuart sieht so aus:
#
# This is the configuration file for ser2net.  It has the following format:
#  <TCP port>:<state>:<timeout>:<device>:<options>
#     TCP port
#            Name   or  number of the TCP/IP port to accept con-
#            nections from for this device.  A port number may
#            be of the form [host,]port, such as 127.0.0.1,2000
#            or localhost,2000.  If this is specified, it will
#            only bind to the IP address specified. Otherwise
#            it will bind to all the ports on the machine.
#
#     state  Either raw or rawlp or telnet or off.  off disables
#            the  port  from  accepting  connections.  It can be
#            turned on later from the control port.  raw enables
#            the port and  transfers  all data as-is between the
#            port  and  the long.  rawlp  enables  the port  and
#            transfers  all input data to device, device is open
#            without  any  termios  setting.  It  allow  to  use
#            /dev/lpX  devices  and  printers connected to them.
#            telnet enables the port and runs the telnet  proto-
#            col  on the port to set up telnet parameters.  This
#            is most useful for using telnet.
#
#     timeout
#            The time (in seconds) before the port will be  dis-
#            connected  if  there  is no activity on it.  A zero
#            value disables this funciton.
#
#     device The  name  of  the  device   to  connect  to.  This
#            must be in the form of /dev/<device>.
#
#     options
#            Sets  operational  parameters  for the serial port.
#            Options 300, 1200, 2400, 4800, 9600, 19200, 38400,
#            57600, 115200 set the various baud rates.  EVEN,
#            ODD, NONE set the parity.  1STOPBIT, 2STOPBITS set
#            the number of stop bits.  7DATABITS, 8DATABITS set
#            the number of data bits.  [-]XONXOFF turns on (-
#            off) XON/XOFF support.  [-]RTSCTS turns on (- off)
#            hardware flow control, [-]LOCAL turns off (- on)
#            monitoring of the modem lines, and
#            [-]HANGUP_WHEN_DONE turns on (- off) lowering the
#            modem control lines when the connextion is done.
#            NOBREAK disables automatic setting of the break
#            setting of the serial port.
#            The "remctl" option allow remote control (ala RFC
#            2217) of serial-port configuration.  A banner name
#            may also be specified, that banner will be printed
#            for the line.  If no banner is given, then no
#            banner is printed.
#
# or...

#  BANNER:<banner name>:banner
#    This will create a banner, if the banner name is given in the
#    options of a line, that banner will be printed.  This takes the
#    standard "C" \x characters (\r is carraige return, \n is newline,
#    etc.).  It also accepts \d, which prints the device name, \p,
#    which prints the TCP port number, and \s which prints the serial
#    parameters (eg 9600N81).  Banners can span lines if the last
#    character on a line is '\'.  Note that you *must* use \r\n to
#    start a new line.
#
# Note that the same device can be listed multiple times under different
# ports, this allows the same serial port to have both telnet and raw
# protocols.

# The original config file shipped with the upstream sources can be
# found in /usr/share/doc/ser2net/examples

BANNER:banner:\r\nser2net port \p device \d [\s] (Debian GNU/Linux)\r\n\r\n

2000:telnet:600:/dev/ttyS0:9600 8DATABITS NONE 1STOPBIT banner
2001:telnet:600:/dev/ttyS1:9600 8DATABITS NONE 1STOPBIT banner
3000:telnet:600:/dev/ttyS0:19200 8DATABITS NONE 1STOPBIT banner
3001:telnet:600:/dev/ttyS1:19200 8DATABITS NONE 1STOPBIT banner
4000:raw:0:/dev/ttyAMA0:115200 NONE 1STOPBIT 8DATABITS HANGUP_WHEN_DONE

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

UweUwe

Hallo Otto, es lässt mich nicht ruhen.
Hab jetzt einen weiteren Raspberry modifiziert mit HMUart, neuestem Linux , ser2net Installation, Telnet Installation. Habe deine ser2net config exakt eingefügt.
Telnet bleibt jetzt hier stehen, wie gewünscht:

pi@mymachine:~ $ telnet 192.168.20.48 4000
Trying 192.168.20.48...
Connected to 192.168.20.48.
Escape character is '^]'.
Ist ja schon mal ein Erfolg.

UweUwe

Hallo,

Die überprüfung der Schnittstelle auf dem "Nur-Funker" mit ls -l /dev/ttyAMA0 bringt.

pi@raspberrypi:~ $ ls -l /dev/ttyAMA0
crw--w---- 1 root tty 204, 64 Apr 11 20:38 /dev/ttyAMA0


Ich gehe davon aus, dass ich jetzt die die Definition des CUL-Heizraum entfernen muss, aber wie konfiguriere ich jetzt den HMUart in FHEM? Hab keine Doku gefunden..

Otto123

Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

UweUwe

Hallo Otto123,

den HMUart hab ich in FHEM definiert:
Internals:
   CNT        1
   Clients    :CUL_HM:
   DEF        uart://192.168.20.48:4000
   DevState   1
   DevType    UART
   DeviceName 192.168.20.48:4000
   FD         4
   FUUID      5e92b209-f33f-1e06-c9ec-2a8385ac56c6d17a
   LastOpen   1586674154.83535
   NAME       WLAN_HzRaum
   NOTIFYDEV  global
   NR         628
   NTFY_ORDER 50-WLAN_HzRaum
   PARTIAL   
   RAWMSG     05000045D080025555556263C101016200
   STATE      opened
   TYPE       HMUARTLGW
   XmitOpen   0
   model      HM-MOD-UART
   owner_CCU  VCCU
   Helper:
     AckPending:
       1:
         cmd        00
         dst        0
         frame      FD00030001009E03
         resend     2
         time       1586674155.83699
     LastSendLen:
       3
     Log:
       IDs:
   MatchList:
     1:CUL_HM   ^A......................
   READINGS:
     2020-04-12 08:35:31   D-type          HM-MOD-UART
     2020-04-12 08:49:15   cond            init
     2020-04-12 08:35:31   loadLvl         suspended
     2020-04-12 08:49:14   state           opened
   helper:
Attributes:
   DbLogExclude .*
   alias      Raspberry im Heizraum als "Funker"
   hmId       555555
   room       Heizraum,Homematic
und in meiner VCCU in der IOlist ergänzt:Internals:
   CUL_1_MSGCNT 65
   CUL_1_RAWMSG A0D4B80025555555FE73401017E00::-23.5:CUL_1
   CUL_1_RSSI -23.5
   CUL_1_TIME 2020-04-12 08:48:10
   DEF        555555
   FUUID      5c65ca1c-f33f-1e06-22c3-7eb38b7ca5a3a0d2
   IODev      CUL_1
   LASTInputDev CUL_1
   MSGCNT     66
   NAME       VCCU
   NOTIFYDEV  global
   NR         404
   NTFY_ORDER 50-VCCU
   STATE      myHmUART:ok,CUL_1:ok,WLAN_HzRaum:init
   TYPE       CUL_HM
   assignedIOs CUL_1,WLAN_HzRaum,myHmUART
   channel_01 Rauchmelder_Team
   channel_02 VCCU_Btn2
   channel_03 VCCU_Sirene
   channel_04 VCCU_Alarm
   channel_05 VCCU_Motion
   channel_06 VCCU_Btn6
   channel_07 VCCU_Btn7
   channel_08 VCCU_Btn8
   channel_09 VCCU_Btn9
   channel_0A VCCU_Btn10
   lastMsg    No:4B - t:02 s:555555 d:5FE734 01017E00
   myHmUART_MSGCNT 1
   myHmUART_RAWMSG 0500003BCA943F121059000000070000000000
   myHmUART_RSSI -59
   myHmUART_TIME 2020-04-12 08:41:09
   protLastRcv 2020-04-12 08:48:10
   protRcv    52 last_at:2020-04-12 08:48:10
   protRcvB   4 last_at:2020-04-12 08:40:39
   rssi_at_CUL_1 cnt:64 min:-23.5 max:-23.5 avg:-23.5 lst:-23.5
   READINGS:
     2020-04-12 08:48:10   CommandAccepted yes
     2020-04-12 08:50:47   IOopen          2
     2020-04-12 08:50:47   state           myHmUART:ok,CUL_1:ok,WLAN_HzRaum:init
     2020-04-12 08:41:09   unknown_121059  received
     2020-03-29 15:58:41   unknown_324A34  received
     2019-02-19 11:30:49   unknown_3259EC  received
     2019-02-18 18:50:00   unknown_325B35  received
     2020-03-29 15:59:26   unknown_37D481  received
     2020-03-30 18:39:33   unknown_3EBE38  received
     2019-02-22 12:50:40   unknown_54A570  received
     2019-11-05 10:48:18   unknown_5D43AC  received
     2019-11-05 10:47:07   unknown_5D4563  received
     2019-11-04 15:07:07   unknown_5ECBA7  received
     2019-11-04 22:30:29   unknown_5ECBAF  received
     2020-01-08 08:03:16   unknown_5FE731  received
     2019-02-22 15:41:26   unknown_5FE734  received
     2020-01-08 08:10:35   unknown_6263C1  received
     2019-11-05 10:45:34   unknown_690BB9  received
     2020-04-03 10:30:53   unknown_6DAAAD  received
   helper:
     HM_CMDNR   75
     mId        FFF0
     peerFriend peerSens,peerAct
     peerOpt    -:virtual
     regLst     0
     rxType     1
     supp_Pair_Rep 0
     expert:
       def        1
       det        0
       raw        1
       tpl        0
     io:
       nextSend   1586674090.99124
       vccu       VCCU
       ioList:
         myHmUART
         CUL_1
         WLAN_HzRaum
       prefIO:
         myHmUART
     mRssi:
       mNo        4B
       io:
         CUL_1:
           -15.5
           -15.5
     prt:
       bErr       0
       sProc      0
       rspWait:
     q:
       qReqConf   
       qReqStat   
     role:
       dev        1
       vrt        1
     rssi:
       at_CUL_1:
         avg        -23.5
         cnt        64
         lst        -23.5
         max        -23.5
         min        -23.5
     tmpl:
Attributes:
   DbLogExclude .*
   IODev      CUL_1
   IOList     myHmUART,CUL_1,WLAN_HzRaum
   IOgrp      VCCU:myHmUART
   expert     2_full
   model      CCU-FHEM
   room       GERAETE,Homematic
   subType    virtual
   webCmd     virtual:update
Das reading "cond" des HMUart wechselt zwischen "init" und "disconnected". Im Logfile sehe ich, dass der Zugriff nicht erfolgreich ist. 192.168.20.48:4000 reappeared (WLAN_HzRaum)
2020.04.12 08:53:52 1: HMUARTLGW WLAN_HzRaum did not respond for the 1. time, resending
2020.04.12 08:53:55 1: HMUARTLGW WLAN_HzRaum did not respond for the 2. time, resending
2020.04.12 08:53:58 1: HMUARTLGW WLAN_HzRaum did not respond for the 3. time, resending
2020.04.12 08:54:01 1: HMUARTLGW WLAN_HzRaum did not respond after all, reopening
2020.04.12 08:54:01 3: WLAN_HzRaum device closed
2020.04.12 08:54:01 1: 192.168.20.48:4000 reappeared (WLAN_HzRaum)
Der Zugriff mit telnet funktioniert dann verständlicherweise auch nicht (im Gebrauch)..telnet 192.168.20.48 4000
Trying 192.168.20.48...
Connected to 192.168.20.48.
Escape character is '^]'.
Port already in use
Connection closed by foreign host.
Habe den "Funker" bereits mehrfach rebootet und auch FHEM neu gestartet. Den Raspberry habe ich komplett neu aufgebaut (ohne FHEM) aber mit ser2net. Die Konfiguration hab ich von dir übernommen.  Nochmals schöne Ostern.

UweUwe

Hallo Otto,
die Schnittstelle des HMUart sieht so aus:
pi@raspberrypi:/etc $ ls -l /dev/ttyAMA0
crw--w---- 1 root tty 204, 64 Apr 12 08:19 /dev/ttyAMA0

Otto123

Du musst den Pi (wo die HMUART drauf ist) auch so vorbereiten wie im Wiki:
https://wiki.fhem.de/wiki/Raspberry_Pi#Verwendung_UART_f.C3.BCr_Zusatzmodule
Damit die UART Schnittstelle richtig läuft. Also wenn es kein Pi3 oder 4 ist muss Du zumindest dies tun (Systemkonsole):
# seriell-getty Dienst für ttyAMA0 dauerhaft deaktivieren
systemctl stop serial-getty@ttyAMA0.service
systemctl disable serial-getty@ttyAMA0.service
systemctl mask serial-getty@ttyAMA0.service
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz

UweUwe

Hallo Otto,
hab jetzt den HMUart-RPI und den CUL-RPI am Laufen. Vielen Dank.
Die Folgende Vorgehensweise führte zum Erfolg:
Raspberry mit CUL als Funkbrücke

1. Raspberry mit neuem LINUX incl. Update und Upgrade
2. CUL neu flashen, ein bereits verwendeter CUL funktioniert nicht. (1. Fehler von mir)
2. Ser2net Installation
3. ser2net.conf aktualisieren. Vorsicht , hier ist eine Falle. In der Doku von FHEM-ser2net steht:
2000:raw:0:/dev/ttyACM0:38400 NONE 1STOPBIT 8DATABITS HANGUP_WHEN_DONE.
In der von ser2net vorbereiteten ser2net.conf vorbereiteten Datei stehen ganz am Ende 4 aktive Konfigurationszeilen, die man schnell übersieht. Eine davon definiert 2000: .
Fügt man jetzt als erste Zeile in ser2net.conf die Zeile aus der FHEM-ser2net Doku ein, so wird 2000: doppelt konfiguriert, was zu Problemen führt. Die Lösung ist, dass man
4000:raw:0:/dev/ttyACM0:38400 NONE 1STOPBIT 8DATABITS HANGUP_WHEN_DONE
einfügt. (2. Fehler von mir)
4. Telnet nachinstallieren und testen. Telnet darf sich hier nicht selbst beenden. Falls dies so nicht funktioniert, kann man sofort nochmals von vorne beginnen. (mein 3.Fehler)
5. CUL in FHEM definieren
6. CUL in IOList der VCCU eintragen, falls man eine VCCU hat
7. In der VCCU muss der state so aussehen, dass ist es ok (hab jetzt 5 "Funker")
myHmUART:ok,CUL_1:ok,WLAN_HzRaum:ok,cul_HzRaum:ok,CUL_Veranda:ok
==> geschafft.


Raspberry mit HMUart als Funkbrücke

1. Raspberry mit neuem LINUX incl. Update und Upgrade
2. # seriell-getty Dienst für ttyAMA0 dauerhaft deaktivieren (mein 1.Fehler)
2. Ser2net Installation
3. ser2net.conf aktualisieren. Die "CUL" Falle existiert hier nicht, da in der FHEM-ser2net Doku bereits die einzufügende Zeile auf 4000: steht:
4000:raw:0:/dev/ttyAMA0:115200 NONE 1STOPBIT 8DATABITS HANGUP_WHEN_DONE
4. Telnet nachinstallieren und testen. Telnet darf sich hier nicht selbst beenden. Falls dies so nicht funktioniert, kann man sofort nochmals von vorne beginnen. (mein 2.Fehler)
5. HMUart in FHEM definieren
6. HMUart in IOList der VCCU eintragen, falls man eine VCCU hat
7. In der VCCU muss der state so aussehen, dass ist es ok (hab jetzt 5 "Funker")
myHmUART:ok,CUL_1:ok,WLAN_HzRaum:ok,cul_HzRaum:ok,CUL_Veranda:ok
==> geschafft.

Ist kein Hexenwerk, wie Otto bereits geschrieben hat. Man muss diese Punkte beachten und Otto haben,  ohne Otto geht nichts. Danke nochmals an das Wissen und die Geduld von Otto.

UweUwe

Hallo Otto,

du hattest mir vor 3 Jahren freundlicherweise (immer sehr hilfbereit) geholfen (dieser Thread) , eine Funkbrücke auf Basis eines RPI2 und ser2net/CUL aufzubauen (HMUARTLGW WLAN_HzRaum)
Leider kann der RPI auf die FlashKarte nicht mehr zugreifen und ich habe kein komplette Sicherung der Flashkarte.
Ganz regelmässig bekomme ich folgende Fehlermeldung, unabhängig , ob der RPI eingeschaltet (Strom)  ist oder nicht:

2023.10.27 12:12:26 3: HMUARTLGW WLAN_HzRaum: connect to http://192.168.20.48:4000 timed out, retrying in 60.00s
1. Frage:  In meiner VCCU sehe ich folgende Information :

assignedIOs CUL_1,CUL_Veranda,WLAN_HzRaum,cul_HzRaum,myHmUARTKann ich den WLAN_HzRaum hier entfernen (wie) und dadurch die Fehlermeldungen erst mal verhindern?

2. Frage:

Im gleichen Zuge habe ich eine weitere Funkbrücke installiert, die auch weiterhin läuft. Hardware ist identisch RPI2 und auch ser2net/Cul sollte identisch sein. ((CUL_Veranda)

Schalte ich die RPI auf der Veranda ein, so bekomme ich folgende Meldung:

2023.10.27 12:00:31 3: CUL_Veranda: Possible commands: ABbCeFGhiKkLlMmNRTtUuVWXxYZ
2023.10.27 12:00:31 1: 192.168.20.68:4000 reappeared (CUL_Veranda)

Für mich stellt sich jetzt die Frage , wie ich die Flashkarte von HMUARTLGW WLAN_HzRaum am effektivsten wiederherstelle.

1. Möglichkeit: Ich habe noch die Anleitung von dir aus dem Jahre 2000 und baue das System auf einer neuen Flashkarte auf.
2. Möglchkeit: Ich kopiere die Flashkarte  CUL_Veranda und modifiziere die Personalisierung von CUL_Veranda zu WLAN_HzRaum (aber was und wie?)
3. Möglichkeit: Gibt es noch einen für mich einfacheren Weg?

3. Frage:
Warum bekomme ich vom CUL_Veranda keine Fehlermeldungen, wenn der RPI ausgeschaltet ist?

Merci, Merci, Merci

P.S. Eine kleine Frage am Rande: Ich erinnere mich an ein von dir erstellte Doku, wie man in der linken Spalte des "FHEM-Servers" ganz unten bei Logfile, Commandref,  REMOTE DOC eigene Zeilen mit wichtigen Kommandos dauerhaft ergänzen kann. Ich finde diese Anleitung weder im Forum, noch auf deiner Homepage. Kannst du mir einen Link schicken?












Otto123

#69
Hallo Uwe,

Du musst WLAN_HzRaum deaktivieren, z.B. mit
attr WLAN_HzRaum dummy 1Die VCCU macht erstmal den Rest.

ZitatSchalte ich die RPI auf der Veranda ein, so bekomme ich folgende Meldung:
Das ist doch lediglich die Meldung, dass der HMUARTLGW wieder da ist. Wenn Du in fehlerfrei ausschalten willst, musst Du das Device in FHEM vorher deaktivieren. Geht auch temporär (nicht Restart fest) mit
set CUL_Veranda closeoder mit dem dummy Attribute wie oben. Dann ist es restart fest.

Den Remote HMUARTLGW machst Du am Besten einfach neu, ist doch nur das System und ser2net oder socat?
https://wiki.fhem.de/wiki/HM-MOD-RPI-PCB_HomeMatic_Funkmodul_f%C3%BCr_Raspberry_Pi

Zitat von: UweUwe am 27 Oktober 2023, 12:32:57Kannst du mir einen Link schicken?
Du meinst sowas?
https://heinz-otto.blogspot.com/2017/08/raspberry-ausschalten-mit-fhem.html

Gruß Otto
Viele Grüße aus Leipzig  ⇉  nächster Stammtisch an der Lindennaundorfer Mühle
RaspberryPi B B+ B2 B3 B3+ ZeroW,HMLAN,HMUART,Homematic,Fritz!Box 7590,WRT3200ACS-OpenWrt,Sonos,VU+,Arduino nano,ESP8266,MQTT,Zigbee,deconz