Giter VIP home page Giter VIP logo

seven-dots's Introduction

Piloting a seven-segment board with gestures

Small video demo (with the ux as of 20/02/2024 - it will change): https://1drv.ms/a/s!AjMgPYDiHw6gqslRsRapyz2YUNRxWA?e=cCj1WB

Installation quick guide on raspberry pi 4 (4 Go)

Prerequisite

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

Kind remember

  • To activate VNC, ssh to your raspi and launch sudo raspi-config > 3. Interface Option > 2 VNC, Yes, Enter

Installation of the application on the Raspi

  1. Activate Serial com: sudo raspi-config > 3. Interfaces > Serial > No to console on serial / yes to serial interface > save > reboot

  2. Clone this repo or your own fork if you plan to adapt it (cf section To code remotely)

  3. Check that picamera2 is installed with sudo apt install -y python3-picamera2

  4. 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

  5. activate environment : source .venv/bin/activate

  6. install requirements : pip install -r requirements.txt

  7. launch calling bash start.sh! Stop with ctrl-C.

  8. Don't forget to call bash stop.sh if you want to set dark mode before moving the physical display

Starting it when booting rapsi (and set dark mode when shutting down)

In repository folder

  1. Adapt sevendots.service and start.sh to your path

  2. sudo cp ./sevendots.service /etc/systemd/system/

  3. sudo systemctl enable sevendots.service

To code remotely and push things back to github

  1. 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]

  2. Use vscode live share

  3. add (manualy) the private key to push on github, with chmod 600

  4. set git name and email

git config --global user.name "Your Name"
git config --global user.email "[email protected]"

Testing serial

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')

Troubleshooting

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

Special thanks

seven-dots's People

Contributors

edouard-gv avatar

Watchers

 avatar  avatar

seven-dots's Issues

L'après-midi demander comment ça va

Similaire au matin : demander qui on est, puis demander si on a bien dormi si on n'a pas l'info du jour, puis demander si on a passé une bonne journée si l'on n'a pas l'info du jour.
Si on a tout déjà pour l'habitant, passer directement à l'écran <a définir>.

Ne demander qui on est que s'il manque une des infos quotidiennes pour l'un des habitants.

Le matin demande comment ça va

Le matin, sur sur open palm, écrire salut pendant une seconde puis :
Si encore quelqu'un n'a pas donné son humeur, demande qui on est (menu) sinon passage écran météo
Si on n'a pas enregistré l'info pour la personne et le jour, demande si on a bien dormi (réponse thumbs up/down /!\ cas d'exception du thumbs down qui ne fait pas back, sinon continue écran météo
A chaque fois,

  • closed fist revient à l'écran bye via confirmation
  • open palm fait un back/echap (attention si on vient d'un open palm genre le premier écran).

Le matin, quand on dit bonjour, donne la météo

Le matin, sur sur open palm, écrire salut pendant une seconde puis afficher l'écran météo
Écran météo : donne
la diff aux normales saisonnières
s'il risque de pleuvoir
s'il y aura du soleil

repasse en hello sur un open_palm (si autre chose qu'open palm entre temps)

Menu système : éteindre, mettre à jour github

Sur écran blanc, sur iloveyou, proposer un menu avec deux choix : shutdown, maj git), qu'on choisi sur finger up (choix 1) ou victory (choix 2), puis demande de confirmation avec thumb up.
Ici, Thumb down fait back et donc retour au menu.
Dans le menu, thumb down fait back à l'écran blanc.

En mode écran blanc, réduire les FPS

Par exemple, mettre un délai d'une seconde entre chaque tentative de reconnaissance.
Conséquence ux : il faudra au max une seconde dans la posture pour déclencher l'action.
Objectif : éviter que le Raspi tourne à 100% de cpu tout le temps.

Amélioration du workflow

Il semblerait :

  • qu'on ne puisse pas revenir sur le blank screen à partir du menu système (le closed_fist n'escape pas).
  • qu'on ne puisse sortir de hello + countdown, sans passer par +1 (ou +2). Si on suite le point suivant, on devrait sortir du hello+countdown après 5 sec d'inactivité.

Ensuite :
Sur le hello (sans countdown), le bye s'afficherait automatiquement au bout de 5 secondes d'inactivité.
On remplacerait le escape dans le countdown par open_palm, pour éviter de sortir par accident quand on essaye d'incrémenter le compteur.
L'open-palm deviendrait donc le escape par défaut, sauf sur écran blanc ou il continuerait de faire passer en hello.

Créer un geste pour éteindre le Raspi

Sur statut écran blanc
Sur action iloveyou
Demander OFF ?
Puis si thumb up, afficher écran noir et éteindre l'os (shutdown now).
Sinon revenir écran blanc

Mettre en veille

Si au bout de 10 minutes après la dernière action l'écran n'est pas blanc, passer en blanc, quelque soit l'action sauf countdown

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.