Teppo Kurki - BT Sensors plugin from Docker

BT Sensors plugin from Docker
12 Replies
Teppo Kurki
Teppo KurkiOP3mo ago
seems like it does not work out of the box, seeing dbus permission denied errors - has somebody already cracked this and has BT sensors working in SK server running in Docker? @naugehyde or maybe @Karl-Erik Gustafsson ?
Karl-Erik Gustafsson
Been running plugin in docker long times and no issues.
Teppo Kurki
Teppo KurkiOP3mo ago
the plugin did not start properly until i added volume mapping /var/run/dbus:/var/run/dbus
Karl-Erik Gustafsson
Was about to ask volume mapping. That is needed there.
Teppo Kurki
Teppo KurkiOP3mo ago
now the plugin starts but server log shows stuff like
May 29 20:30:24 2025-05-29T20:30:24.431Z bt-sensors-plugin-sk Unable to communicate with device 66:E3:9B:44:3B:00 Reason: Cannot read properties of undefined (reading 'keys')
May 29 20:30:24 2025-05-29T20:30:24.433Z bt-sensors-plugin-sk TypeError: Cannot read properties of undefined (reading 'keys') at UNKNOWN.init (/home/node/.signalk/node_modules/bt-sensors-plugin-sk/sensor_classes/UNKNOWN.js:14:54) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async instantiateSensor (/home/node/.signalk/node_modules/bt-sensors-plugin-sk/index.js:131:4) at async /home/node/.signalk/node_modules/bt-sensors-plugin-sk/index.js:337:8
May 29 20:30:24 2025-05-29T20:30:24.435Z bt-sensors-plugin-sk Device at 66:E3:9B:44:3B:00 unavailable. Reason: Cannot read properties of undefined (reading 'keys')
May 29 20:30:24 2025-05-29T20:30:24.431Z bt-sensors-plugin-sk Unable to communicate with device 66:E3:9B:44:3B:00 Reason: Cannot read properties of undefined (reading 'keys')
May 29 20:30:24 2025-05-29T20:30:24.433Z bt-sensors-plugin-sk TypeError: Cannot read properties of undefined (reading 'keys') at UNKNOWN.init (/home/node/.signalk/node_modules/bt-sensors-plugin-sk/sensor_classes/UNKNOWN.js:14:54) at process.processTicksAndRejections (node:internal/process/task_queues:105:5) at async instantiateSensor (/home/node/.signalk/node_modules/bt-sensors-plugin-sk/index.js:131:4) at async /home/node/.signalk/node_modules/bt-sensors-plugin-sk/index.js:337:8
May 29 20:30:24 2025-05-29T20:30:24.435Z bt-sensors-plugin-sk Device at 66:E3:9B:44:3B:00 unavailable. Reason: Cannot read properties of undefined (reading 'keys')
Karl-Erik Gustafsson
Check that you have at least these in place
volumes:
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
privileged: true
cap_add:
- NET_ADMIN
volumes:
- /var/run/dbus/system_bus_socket:/var/run/dbus/system_bus_socket
privileged: true
cap_add:
- NET_ADMIN
Teppo Kurki
Teppo KurkiOP3mo ago
i had mapped /var/run/dbus/ and privileged was there already. adding NET_ADMIN did not change anything, same errors. no sensors show time up for today, i'll get back to this
naugehyde
naugehyde3mo ago
The error occurs when UNKNOWN attempts to read the classMap variable from its constructor which should be set at plug-in load time. Not sure why that might be happening in docker. Not running SK in docker but I'll take a look when I can. In the meantime, @Teppo Kurki can you send the entire log? There may have been an uncaught error earlier
Teppo Kurki
Teppo KurkiOP3mo ago
figured out the error: I am running docker from master, where the js files are under dist but the server reports being 2.13.5, and your hack of choosing between dist and lib is not firing i would much, much prefer exposing server's functionality in an organized manner, via the API, instead of plugins reaching into dist/lib directly...
naugehyde
naugehyde3mo ago
an API would be welcome. alternatively you could expose the functionality in the plugin'sapp parameter.
Karl-Erik Gustafsson
I think dist/lib selection might work but as it is tight to server version and official 2.13.5 has lib and now master has dist but still report version as 2.13.5 therefore selection between dist and lib is not activated. Need manually add sudo ln -s dist lib
Teppo Kurki
Teppo KurkiOP3mo ago
Yep, I just modified the plugin code. Not many people running off master..

Did you find this page helpful?