Small video demo (with the ux as of 20/02/2024 - it will change): https://1drv.ms/a/s!AjMgPYDiHw6gqslRsRapyz2YUNRxWA?e=cCj1WB
When creating the raspberry image with Raspberry Imager
- Choose Bookworm 64 bits to have cv2 and all the good things right
- If you want to test the display with alfazeta java 8 app, Choose OS / Other / Pi OS Lite (32-bit) prefere Bullsey over to have jdk 8 and test the board. And for this, user name should be
pi
. But you wont be able to launch the project which need more modern stuff for cv2 etc. - In Settings make sure ssh is enabled, choose your regional settings, choose your wifi
- To activate VNC, ssh to your raspi and launch
sudo raspi-config
> 3. Interface Option > 2 VNC, Yes, Enter
-
Activate Serial com:
sudo raspi-config
> 3. Interfaces > Serial > No to console on serial / yes to serial interface > save > reboot -
Clone this repo or your own fork if you plan to adapt it (cf section To code remotely)
-
Check that picamera2 is installed with
sudo apt install -y python3-picamera2
-
Create environment in the local repo directory, without forgetting to add
--system-site-packages
option to access to picamera2:cd <repo>; python3 -m venv .venv --system-site-packages
-
activate environment :
source .venv/bin/activate
-
install requirements :
pip install -r requirements.txt
-
launch calling
bash start.sh
! Stop with ctrl-C. -
Don't forget to call
bash stop.sh
if you want to set dark mode before moving the physical display
In repository folder
-
Adapt
sevendots.service
andstart.sh
to your path -
sudo cp ./sevendots.service /etc/systemd/system/
-
sudo systemctl enable sevendots.service
-
If you have not yet configured ssh connection with public keys, add the public key to accept connections from vscode from your main computer. For this, execute on your main computer:
ssh-copy-id -i ~/.ssh/<keyfile>.pub [email protected]
-
Use vscode live share
-
add (manualy) the private key to push on github, with chmod 600
-
set git name and email
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
import serial
ser = serial.Serial(port='/dev/serial0', baudrate=57600)
# should answer True
ser.isOpen()
# should print Serial<id=0x........, open=True>(port='/dev/serial0', baudrate=57600, bytesize=8, parity='N', stopbits=1, timeout=None, xonxoff=False, rtscts=False, dsrdtr=False)
print(ser)
# should answer 32 and print "-" everywhere
ser.write(bytes([0x80, 0x83, 0x00]+[0b1]*28+[0x8F]))
# print all segments once on first line than "0123456789ABCDEF -?':" on the other lines
ser.write(b'\x80\x83\x00\x01\x02\x04\x08\x10\x20\x40\x7e\x30\x6d\x79\x33\x5b\x5f\x70\x7f\x7b\x77\x1f\x4e\x3d\x4f\x47\x00\x01\x64\x02\x09\x8F')
If when instantiating ser, you have FileNotFoundError: [Errno 2] No such file or directory: '/dev/serial0'
, be sure to have activated Serial in raspi-config (No to console on serial / yes to serial interface, cf 1.)
You can also try to access to the serial port with stty, for example:
stty -F /dev/serial0 speed 57600 cs8 -cstopb -parenb -echo
echo -en '\x80\x83\x00\x01\x02\x04\x08\x10\x20\x40\x7e\x30\x6d\x79\x33\x5b\x5f\x70\x7f\x7b\x77\x1f\x4e\x3d\x4f\x47\x00\x01\x64\x02\x09\x8F' > /dev/serial0
- To AlphaZeta for making this device
- To Ksawery Kirklewski for making this pretty and explaining how to do it
- To the nice people from the parisian maker shop LetMeKnow