Der Container läuft mit root-rechten um auf den USB-Port zuzugreifen:
ls -la /dev/ttyUSB0
crw-rw-rw- 1 root root 188, 0 Nov 6 11:19 /dev/ttyUSB0
leider wird beim start des Containers der Port nicht initialisiert.
kann auch mit dem script nicht gestartet werden:
/var/www/html/usb_init.php
sh: 1: usb-devices: not found
sh: 1: hwinfo: not found
PHP Notice: Undefined variable: USB_Devices in /var/www/html/usb_init.php on line 13
2
PHP Notice: Undefined variable: USB_Regler in /var/www/html/usb_init.php on line 407
PHP Warning: file_get_contents(/sys/firmware/devicetree/base/model): failed to open
stream: No such file or directory in /var/www/html/usb_init.php on line 921
root@takealug-solaranzeige2:/# ls -la /sys/firmware/
total 0
drwxrwxrwt 2 root root 40 Nov 6 20:41 .
dr-xr-xr-x 12 root root 0 Nov 6 20:41 ..
Ein händisches initialisieren des Ports geht danach kann die Serielle am USB mit 2400 Baud angesprochen werden:
stty -F /dev/ttyUSB0 raw speed 2400 cs8 -iexten -echo -echoe -echok -onlcr -hupcl ignbrk time 5
Was stimmt mit meinem Container nicht ???

Docker Json File:
{
"CapAdd" : [],
"CapDrop" : [],
"cmd" : "",
"cpu_priority" : 10,
"enable_publish_all_ports" : false,
"enable_restart_policy" : false,
"enable_service_portal" : null,
"enabled" : false,
"env_variables" : [
{
"key" : "PATH",
"value" : "/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
},
{
"key" : "USER_ID",
"value" : "1041"
},
{
"key" : "GROUP_ID",
"value" : "100"
},
{
"key" : "TIMEZONE",
"value" : "Europe/Berlin"
},
{
"key" : "UPDATE",
"value" : "yes"
},
{
"key" : "MOSQUITTO",
"value" : "yes"
},
{
"key" : "INFLUXDB",
"value" : "yes"
},
{
"key" : "DEBIAN_FRONTEND",
"value" : "noninteractive"
},
{
"key" : "TERM",
"value" : "xterm"
},
{
"key" : "LANGUAGE",
"value" : "en_US.UTF-8"
},
{
"key" : "LANG",
"value" : "en_US.UTF-8"
},
{
"key" : "LC_ALL",
"value" : "en_US.UTF-8"
},
{
"key" : "CLEANUP",
"value" : "/tmp/* /var/tmp/* /var/log/* /var/lib/apt/lists/* /var/lib/{apt,dpkg,cache,log}/ /var/cache/apt/archives /usr/share/doc/ /usr/share/man/ /usr/share/locale/ "
},
{
"key" : "USBDEVICES",
"value" : "/dev/ttyUSB0"
}
],
"exporting" : false,
"id" : "95593e3e9d4659db64dec86c328824c0130f326c1aee91b6c6ce5849f63148b0",
"image" : "takealug/solaranzeige:amd64",
"is_ddsm" : false,
"is_package" : false,
"links" : [],
"memory_limit" : 4805623808,
"name" : "takealug-solaranzeige1",
"network" : [
{
"driver" : "bridge",
"name" : "bridge"
}
],
"network_mode" : "bridge",
"port_bindings" : [
{
"container_port" : 1883,
"host_port" : 1883,
"type" : "tcp"
},
{
"container_port" : 3000,
"host_port" : 3005,
"type" : "tcp"
},
{
"container_port" : 80,
"host_port" : 8089,
"type" : "tcp"
}
],
"privileged" : true,
"shortcut" : {
"enable_shortcut" : false,
"enable_status_page" : false,
"enable_web_page" : false,
"web_page_url" : ""
},
"use_host_network" : false,
"volume_bindings" : [
{
"host_volume_file" : "/docker/solaranzeige/grafana",
"mount_point" : "/var/lib/grafana",
"type" : "rw"
},
{
"host_volume_file" : "/docker/solaranzeige/influxdb",
"mount_point" : "/var/lib/influxdb",
"type" : "rw"
},
{
"host_volume_file" : "/docker/solaranzeige/pvforecast",
"mount_point" : "/pvforecast",
"type" : "rw"
},
{
"host_volume_file" : "/docker/solaranzeige/solaranzeige",
"mount_point" : "/solaranzeige",
"type" : "rw"
},
{
"host_volume_file" : "/docker/solaranzeige/www",
"mount_point" : "/var/www",
"type" : "rw"
}
]
}