Python library and examples for controlling the Lumitec Poco Digital Lighting Control Module using a CAN bus proprietary protocol. This repository provides a cross-platform reference implementation for third-party integration and testing.
-
OS: Linux (tested with Ubuntu 24.04)
Windows should be capable, but not tested.
-
Python 3.7+ (tested with Python 3.8+)
-
CAN Hardware and Driver
- Any CAN hardware and driver supported by python-can. See list: https://python-can.readthedocs.io/en/stable/interfaces.html
- We recommend SocketCAN on Linux. (tested with PEAK PCAN-USB)
-
Find the CAN interface:
# Show kernel messages. (Ctrl-C to quit) sudo dmesg -wNow plug-in the CAN adapter and look for a new line to appear like this:
[...] peak_usb 1-2.3:1.0 can0: attached to PCAN-USB channel 0 (device 0x000000FF)This shows the driver has added the
can0interface. You may seecan1,can2, etc. If you don't see a can interface, you may need to load the driver for your hardware. See troubleshooting section below. -
Configure CAN interface (250 kbps baud):
sudo ip link set can0 type can bitrate 250000 sudo ip link set can0 up
-
Verify interface:
# Show can0 link status, should say "UP". ip link show can0 # Monitor some CAN traffic, should see some frames. Ctrl-C to exit. candump can0
TODO. (See Windows section of: https://python-can.readthedocs.io/en/stable/installation.html)
git clone https://github.com/lumiteclighting/poco_can_py.git
cd poco_can_pyThis script should install the necessary requirements into a python virtual environment and run a launcher GUI to demonstrate the examples.
./start_example.shYou may need to load kernel modules:
sudo modprobe can
sudo modprobe can_raw
# For USB-serial CAN adapters, you may need slcan
sudo modprobe slcan If you are using the python virtual environment, activate it by running the included script:
source sourceme.shOtherwise, install python-can:
pip install python-canRun with sudo or add user to netdev group:
sudo usermod -a -G netdev $USER
# Log out and back in- Bring up CAN interface. See steps above for SocketCan.
- Check bitrate matches (250 kbps for NMEA2000)
- Verify CAN termination (120Ω at both ends)
- Check cable connections (CAN-H, CAN-L, GND)
- Use
candump can0to verify CAN interface works
The protocol is defined here:
TODO: add link to protocol document
This is a reference implementation for third-party integration. For issues or suggestions:
- Open a GitHub issue or Pull-Request on this repository
- For professional support, contact [email protected]
Reference implementation provided for third-party integration with Lumitec Poco devices. This example code is in the public domain.