Nanoserver support
Summary of Problem
- What are you trying to do? Running zigbee2mqtt on nanoserver
- What happens? Zigbee2mqtt crashes when connection to the zigbee stick
- What should have happened? no crashes.
Thing this topic answers all questions about my problem; https://github.com/Koenkk/zigbee2mqtt/issues/1479
In short: zigbee2mqtt, bases on node.js with serialport does not work on nanoserver, but does work on servercore. Serialport probably uses an api not available on nanoserver. Question is. can serialport be fixed to be used on nanoserver, or what libraries should i sideload on nanoserver to make serialport work?
Versions, Operating System and Hardware
- Node.js v node-v10.15.3-win-x64/node-v11.15.0-win-x64. (tried both)
- Windows 1809
What is nanoserver? What is servercore?
What is nanoserver? What is servercore?
Servercore: https://docs.microsoft.com/nl-nl/windows-server/get-started/getting-started-with-nano-server "This is a base image for Windows Server containers. This image carries the Windows Server Core base OS image." aka Full windows server without GUI
Nano server: https://docs.microsoft.com/nl-nl/windows-server/get-started/getting-started-with-nano-server https://hub.docker.com/_/microsoft-windows-nanoserver Aka nano size version of full server version. It has a lite version of WIN32, with legacy API's removed. Supported APIs: https://msdn.microsoft.com/en-us/library/mt588480(v=vs.85).aspx
We don’t use the uwp apis if that’s what it requires.
We don’t use the uwp apis if that’s what it requires.
Well, for it to work on Nanoserver, it does.
I think there’s some sort of shim you can add or compile in. Visual studio used to do that for windows 10 iot.
Ok loaded Kernel32.dll and setupapi.dll by copying them in "C:\Windows\System32\Forwarders" and added the path to PATH. Got this error now;
<--- Last few GCs --->
[11076:0000018D3E71CB50] 86377 ms: Mark-sweep 1401.5 (1439.3) -> 1398.9 (1431.3) MB, 1787.8 / 0.1 ms (+ 32.8 ms in 113 steps since start of marking, biggest step 12.2 ms, walltime since start of marking 2135 ms) (ave
rage mu = 0.237, current mu = 0.191[11076:0000018D3E71CB50] 88842 ms: Mark-sweep 1403.2 (1431.3) -> 1400.6 (1444.3) MB, 2254.2 / 0.0 ms (average mu = 0.158, current mu = 0.086) allocation failure scavenge might not s
ucceed
<--- JS stacktrace --->
==== JS stack trace =========================================
0: ExitFrame [pc: 0000023EAB7D0481]
Security context: 0x03fb16b1d9f1 <JSObject>
1: debug [0000033DB26EC771] [C:\app\node_modules\cc-znp\node_modules\debug\src\common.js:~67] [pc=0000023EAB7ED49B](this=0x03a7e9604981 <JSGlobal Object>)
2: arguments adaptor frame: 1->0
3: close [000001A812975A69] [C:\app\node_modules\cc-znp\node_modules\@serialport\stream\stream.js:424] [bytecode=000002762F45B589 offset=47](this=0x03ad7aa295...
FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
I don’t know enough about windows to help here. I know for docker alpine and Ubuntu both work really well.
To bad. Thanks for your help. Reason why i have to use Windows docker container is that com device pass-through is not supported to Linux containers on windows. I will use the full server core version for now.
That’s a good reason.