Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Raspberry 4 an serielle Schnittst. (USB) schr. [gelöst]

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Raspberry 4 an serielle Schnittst. (USB) schr. [gelöst]

    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jr28 @Homoran last edited by

      @homoran

      nein, kein Modbus.
      Ich muss einen String (Hexcode wie z.B.: 24 56 00 21 00 FA 80 0E) einfach an die serielle Schnittstelle schreiben.
      Modbus setzt immer irgendwelche Register vorraus die angesprochen werden.

      Homoran paul53 2 Replies Last reply Reply Quote 0
      • Homoran
        Homoran Global Moderator Administrators @jr28 last edited by

        @jr28 sagte in Raspberry 4 an serielle Schnittstelle (USB) schreiben:

        Modbus setzt immer irgendwelche Register vorraus die angesprochen werden.

        ja

        @jr28 sagte in Raspberry 4 an serielle Schnittstelle (USB) schreiben:

        Ich muss einen String (Hexcode wie z.B.: 24 56 00 21 00 FA 80 0E) einfach an die serielle Schnittstelle schreiben.

        das wäre dann wohl etwas für Skriptprofis.
        Natürlich muss das gehen.

        ich verschiebe es denn mal nach Javascript, oder Blockly??
        Hardware istvdas auf keinen Fall, deswegen ist es schon bis hierher gekommen, damit es jemand findet, der dir helfen kann.

        J 1 Reply Last reply Reply Quote 0
        • J
          jr28 @Homoran last edited by

          @homoran

          ok, danke

          Homoran 1 Reply Last reply Reply Quote 0
          • Homoran
            Homoran Global Moderator Administrators @jr28 last edited by

            @jr28 sagte in Raspberry 4 an serielle Schnittstelle (USB) schreiben:

            @homoran

            ok, danke

            was sprichst du denn?

            @homoran sagte in Raspberry 4 an serielle Schnittstelle (USB) schreiben:

            Javascript, oder Blockly??

            J 1 Reply Last reply Reply Quote 0
            • J
              jr28 @Homoran last edited by

              @homoran

              eher Blockly, alle meine Skripte sind Blockly

              1 Reply Last reply Reply Quote 0
              • paul53
                paul53 @jr28 last edited by paul53

                @jr28 sagte: String (Hexcode wie z.B.: 24 56 00 21 00 FA 80 0E) einfach an die serielle Schnittstelle schreiben.

                Dann schau das NPM-Modul serialport an. Mit Blockly wird das sicherlich nichts.

                1 Reply Last reply Reply Quote 0
                • mickym
                  mickym Most Active last edited by

                  Oder Du nutzt NodeRed. 😉
                  3ecc5dfb-29b1-49ac-9f53-be370c6ff392-image.png

                  J 1 Reply Last reply Reply Quote 1
                  • J
                    jr28 @mickym last edited by

                    @mickym
                    erst einmal Danke, aber nach Installation des Adapters kann ich nirgends einen Zusammenhang zur seriellen Schnittstelle finden. Hilf mir bitte mal auf die Sprünge.

                    mickym 2 Replies Last reply Reply Quote 0
                    • mickym
                      mickym Most Active @jr28 last edited by mickym

                      @jr28 Du musst den Palettenmanager aktivieren in der Adapter -Konfiguration und dort dann die serielle Node installieren.

                      505c74da-7039-4bcf-a852-e69b612c21e7-image.png

                      https://flows.nodered.org/node/node-red-node-serialport

                      Den Paletten-Manager findest Du im Hamburger 😉 Menü (nachdem Du die Option in der Adapterkonfig aktiviert hast und den Adapter neu gestartet hast):

                      db8cdbe9-bee4-4483-a172-1ee4705864ea-image.png

                      Einfach im Palettenmanager bei Installation eingeben und suchen:

                      d235955a-f245-4eff-9372-1065afd4c745-image.png

                      Sind die Nodes installiert, dann tauchen sie unter Installierte Nodes auf:

                      078b199c-8793-457f-9c9c-2869a45f32cb-image.png

                      Sobald Du eine Node dann verwendest musst Du die serielle Schnittstelle konfigurieren:

                      94bcaa06-53c1-49a7-b8f6-a933fff20448-image.png

                      Mit der Lupe sollte ggf. eine serielle Schnittstelle erkannt werden, sonst musst die selbst eintragen.

                      1 Reply Last reply Reply Quote 0
                      • mickym
                        mickym Most Active @jr28 last edited by mickym

                        @jr28 Falls Du noch Hilfe beim Buffer brauchst.

                        Der Buffer wird in NodeRed in dezimaler Schreibweise angegeben.

                        47163b11-5da7-44ca-b8bf-49cebee4d74d-image.png

                        Wenn es Dir nur als HEX String vorliegt, kannst Du noch den Buffer Maker nutzen und die HEX Zahlen als String eingeben:

                        7dfff7db-84e1-4335-8209-2f5efe89ce4a-image.png

                        Die Buffer Nodes installierst Du entsprechend über den Palettenmanager: https://flows.nodered.org/node/node-red-contrib-buffer-parser

                        Im Buffermaker kannst Du dann sagen, dass dieser String als Hexzahlen zu interpretieren sind.

                        8b12a70f-2bea-45c4-95d7-cdf888f7ec58-image.png

                        Diesen Buffer kannst Du dann an die seriell- Out Node schicken.

                        Das Ganze kannst Du mit dem Parser auch wieder Rückkonvertieren:

                        dd77610e-23f6-47f8-a0fa-5466c16fb212-image.png

                        Hier zum Ausprobieren der ganze Flow:

                        [
                           {
                               "id": "212a4c45dadba738",
                               "type": "inject",
                               "z": "578345f4956c7a57",
                               "name": "",
                               "props": [
                                   {
                                       "p": "payload"
                                   }
                               ],
                               "repeat": "",
                               "crontab": "",
                               "once": false,
                               "onceDelay": 0.1,
                               "topic": "",
                               "payload": "24 56 00 21 00 FA 80 0E",
                               "payloadType": "str",
                               "x": 190,
                               "y": 1960,
                               "wires": [
                                   [
                                       "95660c2f05232696",
                                       "2276bccd7217b142"
                                   ]
                               ]
                           },
                           {
                               "id": "f4bbd5071aab0035",
                               "type": "buffer-maker",
                               "z": "578345f4956c7a57",
                               "name": "",
                               "specification": "spec",
                               "specificationType": "ui",
                               "items": [
                                   {
                                       "name": "item1",
                                       "type": "hex",
                                       "length": 16,
                                       "dataType": "msg",
                                       "data": "payload"
                                   }
                               ],
                               "swap1": "",
                               "swap2": "",
                               "swap3": "",
                               "swap1Type": "swap",
                               "swap2Type": "swap",
                               "swap3Type": "swap",
                               "msgProperty": "payload",
                               "msgPropertyType": "str",
                               "x": 650,
                               "y": 1960,
                               "wires": [
                                   [
                                       "201eecd784992630"
                                   ]
                               ]
                           },
                           {
                               "id": "201eecd784992630",
                               "type": "debug",
                               "z": "578345f4956c7a57",
                               "name": "Buffer",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 810,
                               "y": 1960,
                               "wires": []
                           },
                           {
                               "id": "95660c2f05232696",
                               "type": "change",
                               "z": "578345f4956c7a57",
                               "name": "Leerzeichen entfernen",
                               "rules": [
                                   {
                                       "t": "change",
                                       "p": "payload",
                                       "pt": "msg",
                                       "from": " ",
                                       "fromt": "str",
                                       "to": "",
                                       "tot": "str"
                                   }
                               ],
                               "action": "",
                               "property": "",
                               "from": "",
                               "to": "",
                               "reg": false,
                               "x": 440,
                               "y": 1960,
                               "wires": [
                                   [
                                       "f4bbd5071aab0035",
                                       "b33c0f651a8ef906"
                                   ]
                               ]
                           },
                           {
                               "id": "2276bccd7217b142",
                               "type": "debug",
                               "z": "578345f4956c7a57",
                               "name": "Input",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 410,
                               "y": 1900,
                               "wires": []
                           },
                           {
                               "id": "b33c0f651a8ef906",
                               "type": "debug",
                               "z": "578345f4956c7a57",
                               "name": "Ohne Leerzeichen",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 690,
                               "y": 1900,
                               "wires": []
                           },
                           {
                               "id": "524839b7b25ee120",
                               "type": "inject",
                               "z": "578345f4956c7a57",
                               "name": "",
                               "props": [
                                   {
                                       "p": "payload"
                                   }
                               ],
                               "repeat": "",
                               "crontab": "",
                               "once": false,
                               "onceDelay": 0.1,
                               "topic": "",
                               "payload": "[36,86,0,33,0,250,128,14]",
                               "payloadType": "bin",
                               "x": 190,
                               "y": 2060,
                               "wires": [
                                   [
                                       "4c202b2105a4e73c",
                                       "e0bcd59141f2803b"
                                   ]
                               ]
                           },
                           {
                               "id": "4c202b2105a4e73c",
                               "type": "debug",
                               "z": "578345f4956c7a57",
                               "name": "direkt Buffer",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 370,
                               "y": 2060,
                               "wires": []
                           },
                           {
                               "id": "e0bcd59141f2803b",
                               "type": "buffer-parser",
                               "z": "578345f4956c7a57",
                               "name": "",
                               "data": "payload",
                               "dataType": "msg",
                               "specification": "spec",
                               "specificationType": "ui",
                               "items": [
                                   {
                                       "type": "hex",
                                       "name": "item1",
                                       "offset": 0,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   },
                                   {
                                       "type": "hex",
                                       "name": "item2",
                                       "offset": 1,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   },
                                   {
                                       "type": "hex",
                                       "name": "item3",
                                       "offset": 2,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   },
                                   {
                                       "type": "hex",
                                       "name": "item4",
                                       "offset": 3,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   },
                                   {
                                       "type": "hex",
                                       "name": "item5",
                                       "offset": 4,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   },
                                   {
                                       "type": "hex",
                                       "name": "item6",
                                       "offset": 5,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   },
                                   {
                                       "type": "hex",
                                       "name": "item7",
                                       "offset": 6,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   },
                                   {
                                       "type": "hex",
                                       "name": "item8",
                                       "offset": 7,
                                       "length": 1,
                                       "offsetbit": 0,
                                       "scale": "1",
                                       "mask": ""
                                   }
                               ],
                               "swap1": "",
                               "swap2": "",
                               "swap3": "",
                               "swap1Type": "swap",
                               "swap2Type": "swap",
                               "swap3Type": "swap",
                               "msgProperty": "payload",
                               "msgPropertyType": "str",
                               "resultType": "value",
                               "resultTypeType": "return",
                               "multipleResult": false,
                               "fanOutMultipleResult": false,
                               "setTopic": true,
                               "outputs": 1,
                               "x": 370,
                               "y": 2100,
                               "wires": [
                                   [
                                       "9f28d1b7fb6e83e6",
                                       "eadeaae5a3348c1e"
                                   ]
                               ]
                           },
                           {
                               "id": "9f28d1b7fb6e83e6",
                               "type": "debug",
                               "z": "578345f4956c7a57",
                               "name": "Rückkonvertierung",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 590,
                               "y": 2100,
                               "wires": []
                           },
                           {
                               "id": "eadeaae5a3348c1e",
                               "type": "change",
                               "z": "578345f4956c7a57",
                               "name": "Array in String",
                               "rules": [
                                   {
                                       "t": "set",
                                       "p": "payload",
                                       "pt": "msg",
                                       "to": "$uppercase($join(payload, \" \"))\t",
                                       "tot": "jsonata"
                                   }
                               ],
                               "action": "",
                               "property": "",
                               "from": "",
                               "to": "",
                               "reg": false,
                               "x": 580,
                               "y": 2160,
                               "wires": [
                                   [
                                       "a26e93b26f8dd8dc"
                                   ]
                               ]
                           },
                           {
                               "id": "a26e93b26f8dd8dc",
                               "type": "debug",
                               "z": "578345f4956c7a57",
                               "name": "Hex String",
                               "active": true,
                               "tosidebar": true,
                               "console": false,
                               "tostatus": false,
                               "complete": "payload",
                               "targetType": "msg",
                               "statusVal": "",
                               "statusType": "auto",
                               "x": 770,
                               "y": 2160,
                               "wires": []
                           }
                        ]
                        

                        J 1 Reply Last reply Reply Quote 0
                        • J
                          jr28 @mickym last edited by

                          @mickym

                          vielen lieben Dank.

                          War etwas holprig am Anfang mit Node-Red, aber jetzt tut alles wie gewünscht.

                          Das HEX baue ich mir jetzt mit Blockly und schreibe es in ein IO-Broker-Objekt.

                          1 Reply Last reply Reply Quote 0
                          • First post
                            Last post

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          848
                          Online

                          31.9k
                          Users

                          80.1k
                          Topics

                          1.3m
                          Posts

                          4
                          15
                          660
                          Loading More Posts
                          • Oldest to Newest
                          • Newest to Oldest
                          • Most Votes
                          Reply
                          • Reply as topic
                          Log in to reply
                          Community
                          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
                          The ioBroker Community 2014-2023
                          logo