Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Entwicklung
    4. Adapter debugging mit VSCode remote ssh

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Adapter debugging mit VSCode remote ssh

    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      ticaki Developer @Asgothian last edited by

      @asgothian

      ah ok bei mir hats auf einem mac auch nicht geklappt, deshalb bin ich remote auf einer vm - da gabs ne video anleitung für 😄

      Asgothian 1 Reply Last reply Reply Quote 0
      • Asgothian
        Asgothian Developer @ticaki last edited by

        Hmm.. ich hab auf dem PI wo mein Produktiv System läuft (zum testen) mal den dev-server als dev-dependency installiert, so wie das auf Github beschrieben ist.

        Die Ausgaben sind aber ähnlich

        ╭─────────────────────────────────────────────────────────────────────╮
        │                                                                     │
        │   dev-server was sucessfully set up in                              │
        │   /opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default.   │
        │                                                                     │
        │   You may now execute one of the following commands                 │
        │                                                                     │
        │   dev-server run default                                            │
        │   dev-server watch default                                          │
        │   dev-server debug default                                          │
        │                                                                     │
        │   to use dev-server.                                                │
        │                                                                     │
        ╰─────────────────────────────────────────────────────────────────────╯
        stormy@stormbroker:/opt/iobroker/node_modules/iobroker.zigbee $ dev-server
        bash: dev-server: command not found
        stormy@stormbroker:/opt/iobroker/node_modules/iobroker.zigbee $ npm run dev-server watch default
        
        > iobroker.zigbee@2.0.3 dev-server
        > dev-server watch default
        
        Using profile name "default"
        Using adapter name "zigbee"
        Install local iobroker.zigbee
        /opt/iobroker/node_modules/iobroker.zigbee> npm pack
        Packed to iobroker.zigbee-2.0.3.tgz
        /opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default> npm install "/opt/iobroker/node_modules/iobroker.zigbee/iobroker.zigbee-2.0.3.tgz"
        
        up to date, audited 475 packages in 2s
        
        65 packages are looking for funding
          run `npm fund` for details
        
        20 vulnerabilities (16 moderate, 4 high)
        
        To address issues that do not require attention, run:
          npm audit fix
        
        To address all issues (including breaking changes), run:
          npm audit fix --force
        
        Run `npm audit` for details.
        /opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default> node --inspect=127.0.0.1:9228 --preserve-symlinks --preserve-symlinks-main node_modules/iobroker.js-controller/controller.js
        Waiting for js-controller to start...
        Waiting for port 26426 to be available...
        Debugger listening on ws://127.0.0.1:9228/8d9ad1ff-b7b6-42d7-a5ca-e48002dafd53
        For help, see: https://nodejs.org/en/docs/inspector
        2025-03-08 21:47:13.303  - info: host.dev-zigbee-stormbroker iobroker.js-controller version 7.0.6 js-controller starting
        2025-03-08 21:47:13.306  - info: host.dev-zigbee-stormbroker Copyright (c) 2014-2024 bluefox, 2014 hobbyquaker
        2025-03-08 21:47:13.307  - info: host.dev-zigbee-stormbroker hostname: dev-zigbee-stormbroker, node: v20.18.2
        2025-03-08 21:47:13.308  - info: host.dev-zigbee-stormbroker ip addresses: 192.168.2.222 192.168.2.43 fda3:8957:951:5a48:55fd:7999:b19e:8ea fe80::a937:f532:3c5b:b02
        2025-03-08 21:47:13.312  - debug: host.dev-zigbee-stormbroker-Server Data File: /opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default/iobroker-data/objects.jsonl
        2025-03-08 21:47:13.331  - debug: host.dev-zigbee-stormbroker-Server  Redis inMem-objects listening on port 9001
        2025-03-08 21:47:13.332  - debug: host.dev-zigbee-stormbroker Redis Objects: Use Redis connection: 127.0.0.1:26426
        2025-03-08 21:47:13.343  - debug: host.dev-zigbee-stormbroker Objects client ready ... initialize now
        2025-03-08 21:47:13.386  - debug: host.dev-zigbee-stormbroker Objects create System PubSub Client
        2025-03-08 21:47:13.397  - debug: host.dev-zigbee-stormbroker Objects client initialize lua scripts
        2025-03-08 21:47:13.404  - debug: host.dev-zigbee-stormbroker Objects connected to redis: 127.0.0.1:26426
        2025-03-08 21:47:13.456  - debug: host.dev-zigbee-stormbroker-Server Data File: /opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default/iobroker-data/states.jsonl
        2025-03-08 21:47:13.459  - debug: host.dev-zigbee-stormbroker-Server  Redis inMem-states listening on port 9000
        2025-03-08 21:47:13.460  - debug: host.dev-zigbee-stormbroker Redis States: Use Redis connection: 127.0.0.1:24426
        2025-03-08 21:47:13.506  - debug: host.dev-zigbee-stormbroker States create System PubSub Client
        2025-03-08 21:47:13.551  - debug: host.dev-zigbee-stormbroker States connected to redis: 127.0.0.1:24426
        2025-03-08 21:47:13.563  - info: host.dev-zigbee-stormbroker connected to Objects and States
        2025-03-08 21:47:13.564  - debug: host.dev-zigbee-stormbroker Could not read notifications.json: /opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default/iobroker-data/notifications.json: ENOENT: no such file or directory, open '/opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default/iobroker-data/notifications.json'
        2025-03-08 21:47:13.579  - info: host.dev-zigbee-stormbroker Node.js version has changed from unknown to 20.18.2
        2025-03-08 21:47:13.591  - info: host.dev-zigbee-stormbroker added notifications configuration of host
        2025-03-08 21:47:13.592  - info: host.dev-zigbee-stormbroker Successfully updated capabilities "cap_net_admin, cap_net_bind_service, cap_net_raw" for /usr/bin/node
        2025-03-08 21:47:13.648  - debug: host.dev-zigbee-stormbroker Plugin sentry Do not initialize Plugin (enabled=false)
        2025-03-08 21:47:13.700  - info: host.dev-zigbee-stormbroker 3 instances found
        2025-03-08 21:47:13.700  - debug: host.dev-zigbee-stormbroker check instance "system.adapter.admin.0" for host "dev-zigbee-stormbroker"
        host.dev-zigbee-stormbroker check instance "system.adapter.admin.0" for host "dev-zigbee-stormbroker"
        2025-03-08 21:47:13.702  - debug: host.dev-zigbee-stormbroker check instance "system.adapter.backitup.0" for host "dev-zigbee-stormbroker"
        host.dev-zigbee-stormbroker check instance "system.adapter.backitup.0" for host "dev-zigbee-stormbroker"
        2025-03-08 21:47:13.703  - debug: host.dev-zigbee-stormbroker check instance "system.adapter.zigbee.0" for host "dev-zigbee-stormbroker"
        host.dev-zigbee-stormbroker check instance "system.adapter.zigbee.0" for host "dev-zigbee-stormbroker"
        2025-03-08 21:47:13.703  - info: host.dev-zigbee-stormbroker starting 2 instances
        Port 26426 is available...
        Waiting for port 24426 to be available...
        Port 24426 is available...
        Running inside /opt/iobroker/node_modules/iobroker.zigbee/.dev-server/default
        Waiting for port 20426 to be available...
        2025-03-08 21:47:13.768  - debug: host.dev-zigbee-stormbroker added notifications configuration of system.adapter.admin.0
        2025-03-08 21:47:13.768  - debug: host.dev-zigbee-stormbroker startInstance admin.0 loglevel=info, compact=false
        2025-03-08 21:47:13.773  - info: host.dev-zigbee-stormbroker instance system.adapter.admin.0 in version "7.6.1" started with pid 2430157
        ================================== > LOG REDIRECT system.adapter.admin.0 => false [system.adapter.admin.0.logging]
        2025-03-08 21:47:14.761  - debug: host.dev-zigbee-stormbroker Incoming Host message getRepository
        2025-03-08 21:47:14.764  - info: host.dev-zigbee-stormbroker Updating repository "beta" under "http://download.iobroker.net/sources-dist-latest.json"
        2025-03-08 21:47:14.861  - debug: host.dev-zigbee-stormbroker Incoming Host message getHostInfo
        2025-03-08 21:47:14.985  - debug: host.dev-zigbee-stormbroker Incoming Host message getHostInfo
        2025-03-08 21:47:15.017  - debug: host.dev-zigbee-stormbroker Incoming Host message getRepository
        2025-03-08 21:47:15.017  - debug: host.dev-zigbee-stormbroker Repository update already running, registered instance "system.adapter.admin.0"
        Port 20426 is available...
        Starting React build
        Waiting for first successful React build...
        /opt/iobroker/node_modules/iobroker.zigbee> npm run watch:parcel
        
        > iobroker.zigbee@2.0.3 watch:parcel
        > parcel admin/src/index.tsx -d admin/build --hmr-port 1235
        sh: 1: parcel: not found
        dev-server watch [profile]
        
        Run ioBroker dev-server and start the adapter in "watch" mode. The adapter will automatically
        restart when its source code changes. You may attach a debugger to the running adapter.
        
        Options:
              --version     Show version number                                                    [boolean]
          -t, --temp        Temporary directory where the dev-server data will be located
                                                                           [string] [default: ".dev-server"]
              --help        Show help                                                              [boolean]
          -n, --noStart     Do not start the adapter itself, only watch for changes and sync them. [boolean]
          -x, --noInstall   Do not build and install the adapter before starting.                  [boolean]
          -w, --doNotWatch  Do not watch the given files or directories for changes (provide paths relative
                            to the adapter base directory.                                          [string]
        
        Error: Exited with 127
            at ChildProcess.<anonymous> (/opt/iobroker/node_modules/iobroker.zigbee/node_modules/@iobroker/dev-server/dist/index.js:1495:44)
            at ChildProcess.emit (node:events:530:35)
            at ChildProcess._handle.onexit (node:internal/child_process:293:12)
        stormy@stormbroker:/opt/iobroker/node_modules/iobroker.zigbee $ 
        
        1 Reply Last reply Reply Quote 0
        • mcm1957
          mcm1957 @Asgothian last edited by

          @asgothian said in Adapter debugging mit VSCode remote ssh:

          @mcm1957 sagte in Adapter debugging mit VSCode remote ssh:

          Also wenn du den Adapetr direkt am MAC starten kannst, dann versuch doch noch mal den dev-server und lass uns wissen welche Fehlermeldungen du bekommst...

          bin gerade dabei - nebenbei - discord ist der allgemeine iobroker discord ? da bin ich auch drauf. Telegram hab ich leider keins.

          Wenn ja können wir die Diskussion nach da verlegen 🙂

          Hmm - ich benutze nur Telegramm. Keine Ahnung was der ganz normale Telegramm Discord ist 🙂 Ich weiß nur dass Telegramm und Discor gegenseitig via Bot synchronisiert werden 🙂

          Genrell sind in Telegramm / Discord mehr Entwickler - insbesondere auch core - unterwegs.

          mcm1957 1 Reply Last reply Reply Quote 0
          • mcm1957
            mcm1957 @mcm1957 last edited by mcm1957

            @mcm1957

            Starting React build

            Uff - du hast da ja noch Schikanen drinnen 🙂

            Ich glaub mit React verträgt dich der dev-sever nicht. Aber zum ganzen Komplex react build kann fast nur Bluefox was sagen.

            Was ich raten würde (zumidnest mal zum testen)

            -) Adapter bauen (npm run build)
            -) dev-server run

            Damit sollte mal der dev-sver laufen und admin auf Port 80xx erreichbar sein.

            -) Adaptercode in vsCode starten:
            Adapterverzeichnis in vsCode öffnen
            Launch "Launch normal" verwenden.

            Launch.json sieht bei mir so aus:

            {
                // Verwendet IntelliSense zum Ermitteln möglicher Attribute.
                // Zeigen Sie auf vorhandene Attribute, um die zugehörigen Beschreibungen anzuzeigen.
                // Weitere Informationen finden Sie unter https://go.microsoft.com/fwlink/?linkid=830387
                "version": "0.2.0",
                "configurations": [
                    {
                        "name": "Launch normal",
                        "program": "${workspaceFolder}/build/main.js",
                        "args": ["--instance", "0", "--force", "--logs", "--debug"],
                        "request": "launch",
                        "stopOnEntry": true,
                        "console": "internalConsole",
                        "outputCapture": "std",
                        "skipFiles": [
                            "<node_internals>/**"
                        ],
                        "type": "node"
                    },
                
                    {
                        "name": "Attach by Process ID",
                        "processId": "${command:PickProcess}",
                        "request": "attach",
                        "skipFiles": [
                            "<node_internals>/**"
                        ],
                        "type": "node"
                    }
                ]
            }
            

            Program Zeile je nach TS / JS und ggF main,js Namen halt anpassen

            mcm1957 1 Reply Last reply Reply Quote 0
            • mcm1957
              mcm1957 @mcm1957 last edited by

              Damit wird mal der Bauvorgang rausgehalten und React sollte da mal in Bezug auf Bau keine Probleme bereiten. (Ob npm run build geht ist dann eine Sache unabhängig vom dev-server)

              mcm1957 1 Reply Last reply Reply Quote 0
              • mcm1957
                mcm1957 @mcm1957 last edited by

                @mcm1957

                Aber wie schon ticaki geschrieben hat, @Apollon77 entwickelt m.W. nach auch auf einem mac. Und Matter hat da sicher alle möglichen Spezialitäten zu bieten. :-).

                Du erreichst ihn auch am besten auf Telegramm / Discord (auchunter @Apollon77)

                Asgothian 1 Reply Last reply Reply Quote 0
                • Asgothian
                  Asgothian Developer @mcm1957 last edited by

                  @mcm1957 Ich hab da mal ein Hallo auf dem Discord rein geschrieben. Kannst du schauen ob das die richtige Stelle ist ?

                  T mcm1957 2 Replies Last reply Reply Quote 0
                  • T
                    ticaki Developer @Asgothian last edited by

                    @asgothian
                    Ja ist der richtige

                    1 Reply Last reply Reply Quote 0
                    • mcm1957
                      mcm1957 @Asgothian last edited by

                      @asgothian

                      Wenn du dort pk.nalon bist dann ists angekommen 🙂

                      1 Reply Last reply Reply Quote 1
                      • OliverIO
                        OliverIO @Asgothian last edited by

                        @asgothian

                        Rufe ich glaube ich habe es auf Discord schon geschrieben.
                        Das Parcel Zeug muss weg, das sind wahrscheinlich Reste vom dev containe
                        Wenn du für den Adapter keinen Build aus, dann entferne diese Seite aus dem Package.json

                        Läuft den der Adapter generell auf Mac?
                        wenn nicht, wird es auf Mac natürlich schwierig, wenn er nicht an die Hardware rankommt

                        Asgothian 1 Reply Last reply Reply Quote 0
                        • Asgothian
                          Asgothian Developer @OliverIO last edited by

                          Allen erst einmal Vielen Dank für die Hilfe. Wir haben die Diskussion auf Discord verlegt. Ist wenn ich das recht verstanden habe einfacher.

                          A.

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          815
                          Online

                          31.7k
                          Users

                          79.8k
                          Topics

                          1.3m
                          Posts

                          4
                          23
                          925
                          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