zigbee2mqtt icon indicating copy to clipboard operation
zigbee2mqtt copied to clipboard

Zigbee2MQTT port for Windows

Open mcsSolutions opened this issue 8 years ago • 13 comments

I recognize that there are instructions for use of Windows to program the sniffer, but is there a port of zigbee2mqtt that runs on Windows?

mcsSolutions avatar Dec 02 '18 22:12 mcsSolutions

@mcsSolutions Zigbee2MQTT runs on Windows without any problems. You may install NodeJS, Zigbee2MQTT and all depended packages.

ptvoinfo avatar Dec 03 '18 03:12 ptvoinfo

All the install instructions I have seen are based upon a Linux install. Things like sudo does not work from the Windows command prompt. Seems like the Wiki should have a Windows install to parallel the Linux one. Just as it does for the Windows flash of the USB dongle.

mcsSolutions avatar Dec 03 '18 05:12 mcsSolutions

I second the request for Windows installation instructions on the Wiki.

Elliott32224 avatar Dec 05 '18 03:12 Elliott32224

I gave it a shot at trying to install on Windows using as best I could the pattern defined for Linux. First issue is the CC2531 device identification. It shows in Windows Device Manager as an "Other Device" "TI CC2531 USB CDC". I assume then that configuration.yaml will use this text rather than the "ttyACM0". I suspect this will not be correct and zigbee2mqtt will expect something like "COM5", but no device driver for Windows has been installed for this device.

A fresh install of node.js resulted in version 10.14.1 and npm 6.4.1. This should be good as it is a higher version than what is installed on Linux.

/opt/ folder does not exist on Windows so to make it as close as possible I did the git clone into C:\opt\zigbee2mqtt. I already had git installed, but I suspect if I did not then this would be a prerequisite part of the instructions.

I installed from an administrator account so chown equivalent is not needed

After npm install and npm start the expected issue with the port showed up with the following in the command window: Error while starting zigbee-shepherd, attempting to fix ... PM failed to start Opening TI CC2531 USB CDC: File not found,

So it seems the essential problem with the Windows install is the method to identify the USB Dongle in configuration.yaml.

mcsSolutions avatar Dec 05 '18 07:12 mcsSolutions

You may find the port number in the devices manager. The corresponding option in "configuration.yaml" looks like:

serial:
  port: \\.\COM15

If Windows didn't assign the port number to TI CC2531 USB CDC then you need to install the driver.

ptvoinfo avatar Dec 05 '18 08:12 ptvoinfo

It shows up in Device Manager as an Other Device because there is no driver installed that makes the USB device look like a serial port. Is there a place to get such a driver?

mcsSolutions avatar Dec 05 '18 09:12 mcsSolutions

I've installed this driver with Z-Stack. You may try the following file: http://www.ti.com/general/docs/lit/getliterature.tsp?baseLiteratureNumber=swrc088&fileType=zip driver\usb_cdc_driver_cc2531.inf Right click -> Install

If the direct link will not work:

  1. Go to http://www.ti.com/product/CC2531/toolssoftware
  2. Select "Tools and software" tab
  3. Scroll down to "CC USB Firmware Library and Examples (Rev. C)" and download it.

ptvoinfo avatar Dec 05 '18 09:12 ptvoinfo

Able to install the driver via Control Panel and now have a COM15 port. Issue now is privledges to access port. I opened command prompt with right-click on cmd.exe, run as administrator. Logged into administer account on Win 7 Ultimate. cd c:/opt/zigbee2mqtt npm start Receive Error: Opening COM15: Access denied

Is there a way to run npm directly so it has the elevated privileges to access the port?

mcsSolutions avatar Dec 05 '18 10:12 mcsSolutions

Turns out that a PC restart cleared up the access denied message. Success was then achieved. ptvo, thanks for all the pointers.

I documented my steps at https://forums.homeseer.com/forum/lighting-primary-technology-plug-ins/lighting-primary-technology-discussion/mcsmqtt-michael-mcsharry/1264779-zigbee2mqtt-on-windows. It would be nice if this or similar information was available for others via the Wiki.

mcsSolutions avatar Dec 06 '18 20:12 mcsSolutions

I'd like to second those thanks to @ptvoinfo and @mcsSolutions.

I got it working on Windows 10 quite easily thanks to all the tips here. Had to install node.js and git but I didn't have to install any special drivers, or even reboot - worked straight up.

Now I had somewhere I can experiment with new device pairing etc without disrupting my operational Pi setup, Pro tip: when purchasing the CC2531 get 2 of them - one for prod and one for dev.

clockbrain avatar Dec 06 '18 22:12 clockbrain

Also, if you have Hyper-V on your Windows system, you may install and use a docker container. I've tried it too, but installing NodeJS is more easy :).

ptvoinfo avatar Dec 07 '18 04:12 ptvoinfo

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Feb 05 '19 14:02 stale[bot]

So, I have been trying to implement zigbee2mqtt on Windows 10, since I am having issues (won't start) on RPi3, which are being discussed elsewhere. I could not get it started. The feedback in the command window indicated "Error: Cannot find module 'semver'," which I do not see in the log file. The log file is attached. Any help would be appreciated. 2019-08-26T17_08_32_806Z-debug.pdf Thanks.

Elliott32224 avatar Aug 26 '19 21:08 Elliott32224