Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. PeterVoronov

    NEWS

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    P
    • Profile
    • Following 0
    • Followers 0
    • Topics 3
    • Posts 16
    • Best 1
    • Groups 1

    PeterVoronov

    @PeterVoronov

    Starter

    1
    Reputation
    4
    Profile views
    16
    Posts
    0
    Followers
    0
    Following
    Joined Last Online

    PeterVoronov Follow
    Starter

    Best posts made by PeterVoronov

    • vscode и wsl: работа с кодом и отладка адаптера

      Всем привет.
      Хочу поделиться полученными знаниями.
      Сразу спасибо Илье Кирову за наводку.
      Далее - за основу брал этот топик - Adapter debuggen mit VSCode.

      Итак - идея - в wsl поставить линукс, в него иоброкер, но среду разработки и отладки использовать родную виндовую - vscode.

      Теперь опишу по порядку:

      • Ставим wsl на Windows 10. Важно - ставим wsl 2, ибо рекомендуется vscode, да и некоторые фичи, как я понимаю именно версии 2 - необходимы.

      • В процессе - ставите нужный дистрибутив линукса. Я брал Дебиан, но не важно.

      • Теперь важно - необходимо доработать дистрибутив напильником - а именно нам надо настроить wsl.conf.

        • Оттуда нам важно как минимум:
          options = "metadata,umask=22,fmask=11"
          
          но и остальное не помешает.
          Напомню, надо делать от рута.
          По умолчанию
          sudo su -
          
          для вашего пользователя работает.
        • Далее - апдейтим пакеты, и ставим node & iobroker.
        • Что сделал дальше, для удобства - добавляем вашего основного пользователя в группу iobroker:
          sudo usermod -a -G iobroker имя_пользователя
          
        • Сделал автостарт ssh и iobrokera, плюс маппинг портов в ссш, брокер, и на будущее - в отладку.
          • Для этого создал файл start_ssh_mapports.ps1
            wsl.exe -u root /etc/init.d/ssh start       
            wsl.exe -u root /etc/init.d/iobroker.sh start
            $wsl_ip = (wsl hostname -I).trim()        
            Write-Host "WSL Machine IP: ""$wsl_ip"""         
            netsh interface portproxy add v4tov4 listenport=22 connectport=22 connectaddress=$wsl_ip         
            netsh interface portproxy add v4tov4 listenport=8081 connectport=8081 connectaddress=$wsl_ip         
            netsh interface portproxy add v4tov4 listenport=9929 connectport=9929 connectaddress=$wsl_ip       
            
          • И добавил его "Планировщик заданий", условием старта после моего логина.
        • Теперь ssh и iobroker вам доступны по вашим сетевым интерфейсам в винде. Я использую 127.0.0.0:22 http://127.0.0.1:8081/ соответственно.
      • Теперь устанавливаем vscode.

        • Запускаем - и устанавливаем в нем ms-vscode-remote.remote-wsl, можно прямо по ссылке, или локально через View -> Extensions
        • Теперь коннектимся к своему wsl через Подключаем wsl.
        • Там выбираем New Windows using Distro, см. Выбираем дистрибутив, и потом - ваш дистрибутив. В этот момент в вашу домашнем каталоге в линуксе будут сделаны нужные настройки.
      • Вы уже готовы работать со кодом в wsl.

      • Но пока не готовы к отладке. Так как отладка ходит по "дереву" иоброкера, то я сразу решил кодить в самой инсталляции брокера, т.е. в /opt/iobroker/node_modules.

        • Для этого поставил через интерфейс иоброкера нужный адаптер.
        • Потом под своим пользователем удалил его папку (предварительно остановив брокер), и , с гита, стащил код, находясь прямо в node_modules:
          git clone ...
          
        • Дополнительно настроим sudoers, то есть /etc/sudoers/имя_вашего_пользователя
          имя_вашего_пользователя ALL = (root) NOPASSWD: /bin/su - iobroker
          имя_вашего_пользователя ALL = (iobroker) NOPASSWD: ALL
          
        • Теперь в консоли линукса (опять же через vscode - справа, внизу, закладка Terminal
          cd /opt/iobroker/
          node --inspect-brk --inspect=0.0.0.0:9229 node_modules/ваш_модуль/main.js --force --logs
          
        • Можно начинать удаленно отлаживать, но для этого надо сделать еще кое-что - настроить подключение к удаленной отладке в vscode:
          • Идем в Run -> Add Configuration, делаем файл такого вида:
            {        
                // Use IntelliSense to learn about possible attributes.        
                // Hover to view descriptions of existing attributes.        
                // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387        
                "version": "0.2.0",        
                        {        
                         "type":   "node",        
                         "request":   "attach",        
                         "name":   "Attach to the process",        
                         "address":   "127.0.0.1",        
                         "port":   9229         
                    }        
                ]        
            }
            
        • Теперь мы готовы стартануть отладку:
          Attach to remote debug
      • Собственно все.

      Оригинал лежит здесь.

      posted in ioBroker разработка
      P
      PeterVoronov

    Latest posts made by PeterVoronov

    • RE: Neato Botvac adapter - further development

      @mcm57
      Excuse me, but I'm outside Germany, and can speak only English, except my local languages ...
      I will not push on other to speak only English, but, it can influence my understanding of the details ...

      posted in ioBroker general
      P
      PeterVoronov
    • RE: Neato Botvac adapter - further development

      @csp I made a pull request to fix this exact issue.

      I don't know how fast it will be applied ...

      You can try to install it from my fork - https://github.com/PeterVoronov/ioBroker.botvac/tree/patch-1

      In Adapter tab you have to enble expert mode, select custom install and select install from url
      34941345-1a28-436c-bff3-492a223206be-image.png

      posted in ioBroker general
      P
      PeterVoronov
    • RE: Neato Botvac adapter - further development

      @csp If you have time for it - please try start 1.0.4 version with debug log.
      Other option - you can share via PM your credentials - and I will try to find a time to look for the solution.

      posted in ioBroker general
      P
      PeterVoronov
    • RE: Neato Botvac adapter - further development

      @csp
      Unfortunatelly I can't do a lot, mostly nothing.

      • I'm not an author of the adapter
      • Currently I have newsest js-controller installed, but adapter at least started for me. I can't check more, then start of adapter.
      • And, unfortunately, I have no any Neato device now(it's died year ago). So, I can't check the further steps ...
        e96e15d9-a555-499f-a724-c249f0e4fc5f-image.png
        d789339d-5243-477a-96c8-fbfb4b934100-image.png
        ac369a9a-90fe-429b-83c9-6add8fdb2ca0-image.png .
      posted in ioBroker general
      P
      PeterVoronov
    • RE: Neato Botvac adapter - further development

      @csp
      May be it has sence to downgrade the node version? To v16, i.e. version 7 of docker image ?

      posted in ioBroker general
      P
      PeterVoronov
    • RE: Neato Botvac adapter - further development

      @csp
      I have the same version of node - 18.17.1.
      As I have no more botvac devices, I can only check the starting adapter and login to the api.
      For me it's working. But when I made migration to node 18th, I wiped the node_modules directory fully.
      I will not recommend to follow my way, as it required some additional understanding and manual work.
      You can try at least to follow the recommendations from error log - execute "npm install --production" in adapter directory manually.

      posted in ioBroker general
      P
      PeterVoronov
    • RE: Neato Botvac adapter - further development

      Hi @danielmayer .

      Unfortunately my botvac broke a few years ago ... Currently I can't check the plugin.
      At least - it can't find any robots, as it not logged in the Neato system.
      That's why currently I have no possibility to help ....

      But I have no any issues with login of plugin...
      Only "no robots" message ...

      posted in ioBroker general
      P
      PeterVoronov
    • RE: Neato Botvac adapter 1.0.0.0 kein login möglich

      @maveric2005
      Hi
      You can use this instruction

      posted in ioBroker Allgemein
      P
      PeterVoronov
    • RE: vscode и wsl: работа с кодом и отладка адаптера

      @petervoronov Чуть исправил некоторые неточности и убрал лишний блок в конфигурации отладки

      posted in ioBroker разработка
      P
      PeterVoronov
    • RE: Neato Botvac adapter - further development

      Пользователь @bourton88 написал в Neato Botvac adapter - further development:

      @petervoronov
      Ohh thats cool. Thanks!!

      I stopped the Adapter just for an hour and it works 🙂

      I have another assumption because unfortunately i changed two things. I stopped the adapter AND i recognized that the clock-time from the running ioBroker instance was not set to the correct time. So i changed that as well.

      Maybe there is an Sync-Problem with the Neato-Server when the time doesn´t fit?

      It the code for connection I not saw the time-sync recs or functions...
      But by my understanding, it is some limitation on the cloud for the connections in the same time from one account...

      posted in ioBroker general
      P
      PeterVoronov
    Community
    Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
    The ioBroker Community 2014-2023
    logo