patonz
December 19, 2019, 10:42pm
26
#!/bin/bash
OS_VERSION=$(echo "$BALENA_HOST_OS_VERSION" | cut -d " " -f 2)
echo "OS Version is $OS_VERSION"
mod_dir="ch341_${BALENA_DEVICE_TYPE}_${OS_VERSION}*"
for each in $mod_dir; do
echo Loading module from "$each"
insmod "$each/ch341.ko"
lsmod | grep ch341
rmmod ch341
done
while true; do
sleep 60
done
This come from the repo directly, just i changed the name of the module
edited.
patonz
December 19, 2019, 10:46pm
27
I dont know why will exec the rmmod
in this .sh. Of course will active/disactive the module i think
The while true
is the reason that your npm start
is not occurring, I recommend starting it from the run.sh
script, like: npm start &
patonz
December 19, 2019, 11:41pm
29
Nothing, builded the driver from the manifacturer download. the model of the board is
Elegoo Nano board CH340 USB Driver
and the driver come from here
https://www.elegoo.com/tutorial/Elegoo%20CH340%20Driver%202019.03.06.zip
Tried the 3. version but the make fails, the other one just build fine but Johnny-five cant recognize the board.
nostromo > engine@1.1.1 start /usr/src/app
nostromo > sudo node main.js
nostromo
nostromo starting nostromo...
nostromo 1576798405686 Available Raspi IO
nostromo 1576798406858 Connected Raspi IO
nostromo 1576798407003 Available /dev/ttyUSB0
nostromo 1576798407035 Connected /dev/ttyUSB0
nostromo 1576798417039 Device or Firmware Error A timeout occurred while connecting to the Board.
Ereski
December 20, 2019, 9:00am
33
Hi. Could you try the following CMD
:
CMD modprobe i2c-dev && modprobe ch341 && npm start
Hi @patonz , just wanted to followup quickly to see if you had any luck getting this working. Let us know if that Docker CMD above works, thanks!
patonz
January 2, 2020, 4:02pm
37
Modified the run.sh and moved the “npm start” directly in the file like @CameronDiver said . Seems to work.
BTW from the original post, it changes a lot
the yml
devices:
- "/dev/ttyUSB0:/devttyUSB0"
dockerfile
CMD modprobe i2c-dev && modprobe usbserial && chmod +x run.sh && ./run.sh
in the run.sh file ive just commented the rmmod command. and then added the npm start after the for statement.
All sh files have to be runnable by using the chmod command as suggested before.