I was trying the instructions currently in the README:
docker run -device=/dev/ttyUSB0 -p 8000:8000 joesantos/laserweb:latest
Everything works great, but when I try to connect to the laser, the drop-down looks empty. Went debugging, and the reason is as follows:
lw.comm-server enumerates the devices using serialport.list() here: https://github.com/LaserWeb/lw.comm-server/blob/75aa7f1ece5947acb4d209642d4ad44b093cdc6d/server.js#L227
list() returns nothing in Linux.
serialport.list() API documentation indicates that it will call the cpp bindings
- The bindings code for Linux calls under the hood the command
udevadm info -e.
- The release container doesn't has the
udevadm command installed. So the call fails and returns nothing.
Fix:
Install the package udev in the release container.
$ git diff
diff --git a/Dockerfile.release b/Dockerfile.release
index 1bd1df4..137d08d 100644
--- a/Dockerfile.release
+++ b/Dockerfile.release
@@ -16,6 +16,8 @@ FROM node:10-alpine
ENV ENV="production"
ENV NODE_ENV="production"
+RUN apk add --no-cache udev
+
WORKDIR /app
COPY --from=base /app ./
I will send a PR with this. Mentioning @iamajoe who worked on this for validation.
I was trying the instructions currently in the README:
Everything works great, but when I try to connect to the laser, the drop-down looks empty. Went debugging, and the reason is as follows:
lw.comm-serverenumerates the devices using serialport.list() here: https://github.com/LaserWeb/lw.comm-server/blob/75aa7f1ece5947acb4d209642d4ad44b093cdc6d/server.js#L227list()returns nothing in Linux.serialport.list()API documentation indicates that it will call the cpp bindingsudevadm info -e.udevadmcommand installed. So the call fails and returns nothing.Fix:
Install the package udev in the release container.
I will send a PR with this. Mentioning @iamajoe who worked on this for validation.