Announcement

Collapse
No announcement yet.

Zigbee2MQTT on Windows

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Zigbee2MQTT on Windows

    I have been communicating with ptvo on https://github.com/Koenkk/zigbee2mqt...ment-444345329 for a Windows port of zigbee2mqtt. I have had success. A few pieces of information are needed to make the port.

    1. Need to install driver for CC2531. It is available at http://www.ti.com/general/docs/lit/g...8&fileType=zip . Unzip to someplace on the computer. Plug the USB dongle into available USB port. It should show up as an "Other Device" TI CC2531 USB CDC. Right click on this device and select option to install driver. Browse to "\driver" subfolder of the unzip. Device should now show up under Ports (COM & LPT) as a COMXX where XX was 15 in my case.

    Restart the computer to remove access dependencies.

    Note that I was using a bluetooth mouse on W7 and when this driver was installed it made the mouse non-operational. I had to uninstall/remove the driver for the CC2531 before the mouse was operational.

    2. Install node.js from https://nodejs.org/en/download/. I used the Windows Installer (.msi).

    3. Create folder to place zigbee2MQTT. I used C:\opt\zigbee2mqtt, but likely can be anywhere. The remaining instructions use this location.

    4. Open command window as administrator (Windows search for "cmd", right click, run as administrator)

    5. Clone zigbee2MQTT from git repository from command window. (git clone https://github.com/Koenkk/zigbee2mqtt.git C;\opt\zigbee2mqtt). If git is not yet installed on Windows then it can be from https://git-scm.com/download/win . It likely is possible to just download the zip and expand it into a Windows folder, but I did not try this approach.

    6. Edit the C:\opt\zigbee2mqtt\data\configuration.yaml. One line to provide the MQTT broker IP address. One line for the USB Dongle port (e.g. COM15). You can also change the base topic from zigbee2mqtt if you desire. I have a different topic for each computer where I have the USB Dongle installed.

    7. Navigate to the install folder (CD C:\opt\zigbee2mqtt) in Command Window

    7a. (added after initial post). Install zigbee2mqtt dependencies. From command prompt run "npm install"

    8. Run zigbee2mqtt from Command Window (npm start). Feedback will be in the Command Window. You should also observe the MQTT LWT message being online on your MQTT client, such as mcsMQTT. If it does not work then it is possible that there is feedback telling you reset the USB dongle using the button nearest the USB connector. With the case I provided installed it is possible with a small non-metalic probde angled to the button. One can also drill a hole in the top of the case above the button. If the case is removed then the plastic latch may break. I provided a flexible top should the case latch break. One could also use tape as another alternative.

    9. To run on windows startup I followed the following process. While it may not be the most elegant it does work:
    9a. Install PM2 from Command Window (npm install pm2 -g)
    9b. Create batch file that will be used to start the js application. I called it z.bat with one line contents or "pm2 start c:\opt\zigbee2mqtt\index.js"
    9c. Create shortcut to the bat file (right click, create shortcut)
    9d. Copy/Paste shortcut into Windows startup folder. In my case it was at C:\Users\Dell\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup for user Dell
    9e. Restart computer
    9f. Observe the node process in Windows Task Manager or observe the LWT MQTT message on a MQTT client.

    #2
    Originally posted by Michael McSharry View Post
    I have been communicating with ptvo on https://github.com/Koenkk/zigbee2mqt...ment-444345329 for a Windows port of zigbee2mqtt. I have had success. A few pieces of information are needed to make the port.....
    Michael:
    Thanks for doing this.
    Elliott

    "Living with technology means living in a [constant] state of flux." S. Higgenbotham, 2023
    "Reboot and rejoice!" F. Pishotta, 1989

    Comment


      #3
      Fell at the first hurdle; Click image for larger version

Name:	Inf.PNG
Views:	6201
Size:	93.0 KB
ID:	1268203

      Comment


        #4
        With thanks to Mr Google and a little knowledge I now have a signed driver. If anybody else has the same problem give me a shout.

        Comment


          #5
          I'm working through the instructions.

          In 6 how should the com port appear in the configuration file? I currently have;
          serial:
          # Location of CC2531 USB sniffer
          port: /dev/ttyACM0

          My com port is 6

          Comment


            #6
            Here is my configuation.yaml file that I used for testing on Windows. In your case it would be COM6 rather than COM15

            # Home Assistant integration (MQTT discovery)
            homeassistant: false

            # allow new devices to join
            permit_join: true

            # MQTT settings
            mqtt:
            # MQTT base topic for zigbee2mqtt MQTT messages
            base_topic: zigbeeWindows
            # MQTT server URL
            server: 'mqtt://192.168.0.30'
            # MQTT server authentication, uncomment if required:
            # user: my_user
            # password: my_password

            # Serial settings
            serial:
            # Location of CC2531 USB sniffer
            #port: /dev/ttyACM0
            #port: TI CC2531 USB CDC
            port: COM15

            Comment


              #7
              Superstar - thank you.

              Comment


                #8
                I am beginning to think this is more complex than I thought!
                Click image for larger version

Name:	js.PNG
Views:	6399
Size:	22.9 KB
ID:	1268429

                Comment


                  #9
                  my install on Windows has semver.cmd and semver.js at C:\opt\zigbee2mqtt\node_modules. I have not used node.js before so don't really know the process to debug based upon the error reported. Another idea is the PATH as I see you are using P rather than C. Another idea is to ask on the github link I posted at the top or start your own issue on that forum.

                  Using Windows puts you on the road least traveled.

                  Comment


                    #10
                    Thanks for the reply. I will play when I have time. I may have to download again as I don't have that directory!!

                    Comment


                      #11
                      I ran into the same issue as IanIreland on Windows Server 2012 r2.

                      I came across this thread (https://github.com/coreybutler/nvm-w...ment-340249164), so I tried the following:



                      1. Installed nodejs LTS 10.15.0 x64
                      2. Installed Git (x64)
                      3. Created new registry dword32 for 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name 'LongPathsEnabled' -Value 1
                      4. Rebooted PC
                      5. Opened a cmd & cd to c:\zigbee2mqtt
                      6.Run command: npm i semver
                      Some bits about node_modules flashed past, eventually semver was installed.
                      The node_modules folder was then available inside c:\zigbee2mqtt

                      7.Run command: npm start
                      Zigbee looked like it started but spat out errors about resetting USB.
                      I'm waiting for my ebay order of the CC USB, so I can't test any further past this point.

                      This is my first time playing with any of the node.js etc stuff, so I don't have any idea of what I'm doing. Seems promising so far!
                      Normally I wouldn't register to a forum just to post a reply, but I know how frustrating it is to find a forum thread with no answer to the problem you're having!

                      Good luck all

                      Comment


                        #12
                        Originally posted by IanIreland View Post
                        With thanks to Mr Google and a little knowledge I now have a signed driver. If anybody else has the same problem give me a shout.
                        I ran into the same problem... Giving you shout :-)
                        RJ_Make On YouTube

                        Comment


                          #13
                          I added a 7a step to the instructions I posted at the top of this thread. I suspect it will help the problem Ian had, but not certain. I also sent Ian an email about the signed driver. Hopefully is listening in.

                          Comment


                            #14
                            I'm dead in the water, without a signed driver. Windows 10 will NOT allow an un-signed driver installation anymore. It appears they have removed every method of disabling the driver signing verification system.

                            Ian PM'd me his driver, but it would not install for me. Has the same un-signed error as the original.
                            RJ_Make On YouTube

                            Comment


                              #15
                              The zigbee2mqtt thread referenced in the first post has subsequent discussion including success by clockbrain. Perhaps you could engage in that discussion to get some help. Using a RPi for special purpose interfaces is also not a bad idea as most of the emerging HA world seems to be Linux based.

                              Comment

                              Working...
                              X