diff --git a/code/qudio.py b/code/qudio.py index f54161c..140fc97 100644 --- a/code/qudio.py +++ b/code/qudio.py @@ -15,8 +15,8 @@ logging.info('Initializing') # Configuration MUSIC_BASE_DIRECTORY = "mnt/NAS/" -SOUND_SCANNING = "mnt/INTERNAL/sounds/scanning.mp3" -SOUND_SCAN_FAIL = "mnt/INTERNAL/sounds/fail-05.mp3" +SOUND_SCANNING = "mnt/INTERNAL/qudio/sounds/scanning.mp3" +SOUND_SCAN_FAIL = "mnt/INTERNAL/qudio/sounds/fail-05.mp3" QR_SCANNER_TIMEOUT = 4 # photo sensor on PIN 5 diff --git a/code/sounds/armstrong.mp3 b/code/sounds/armstrong.mp3 new file mode 100644 index 0000000..fa349f5 Binary files /dev/null and b/code/sounds/armstrong.mp3 differ diff --git a/code/test/control.py b/code/test/control.py new file mode 100644 index 0000000..95462b0 --- /dev/null +++ b/code/test/control.py @@ -0,0 +1,40 @@ +from socketIO_client import SocketIO, LoggingNamespace +import threading +import time + +is_playing = False # for toggling play/pause (stores the current status from the pushState events) +socketIO = SocketIO('localhost', 3000) + +def play_callback(channel): + global is_playing + if is_playing: + logging.info("PAUSE") + socketIO.emit('pause') + else: + logging.info("PLAY") + socketIO.emit('play') + +def events_thread(): + socketIO.wait() + +try: + socketIO.on('pushState', on_pushState) + + socketIO.emit('replaceAndPlay', {'service':'mpd','uri':'mnt/INTERNAL/qudio/sounds/armstrong.mp3'}) + + time.sleep(3.5) + + t1 = threading.Thread(target=play_callback) + t1.start() + t1.join() + + time.sleep(3) + + t1 = threading.Thread(target=play_callback) + t1.start() + t1.join() + + +# Exit when Ctrl-C is pressed +except KeyboardInterrupt: + logging.info('Shutdown') diff --git a/documentation/qudio/index.html b/documentation/qudio/index.html index 30b7e79..1abae66 100644 --- a/documentation/qudio/index.html +++ b/documentation/qudio/index.html @@ -144,7 +144,7 @@ h2, h3, h4 {
  • TCRT5000 reflective sensor module
  • The ultra-cheap USB webcam that can be found on ebay, aliexpress and the like (just sort for price). Some versions come with a small cable reel. This fits perfectly in the holder at the bottom of the case.
  • USB A to micro USB adapter that connects the webcam to the Raspberry Pi's micro USB port
  • -
  • 30-pin Apple dock adapter to micro USB and 3.5 mm audio
  • +
  • 30-pin Apple dock adapter to micro USB and 3.5 mm audio. Search for '30-pin micro-usb adapter audio'.
  • White LED (preferably diffused) for illumination of the QR cards with a proper resistor
  • 3 push buttons with 12 mm caps
  • Jumper cables: 6x 10 cm M-F or F-F for the buttons, 5x 10 cm F-F for the audio module, 5x 20 cm F-F for the sensor and the LED
  • diff --git a/notes.md b/notes.md index bba6098..4287355 100644 --- a/notes.md +++ b/notes.md @@ -15,6 +15,58 @@ ## Ersteinrichtung +Zien: +* volumio installiert +* Externe Stromversorgung +* Assistent durchlaufen, WLAN verbunden, heruntergefahren +* SD-Karte in Laptop + * touch ssh + * mkdir /volumio_data2/dyn/data/INTERNAL/qudio + * copy qudio.py + sounds + test nach /volumio_data2/dyn/data/INTERNAL/qudio + * interne Musik auch nach /INTERNAL +* Neustart + Rescan +* ssh volumio@qudio.local +* Activate software mixer +* sudo apt-get update +* sudo apt-get install fswebcam zbar-tools +* lsusb && ls /dev/video* +* fswebcam -r 320x240 -d /dev/video0 -v /data/backgrounds/webcam-test.jpg + * http://192.168.178.31/backgrounds/webcam-test.jpg +* zbarcam --quiet --nodisplay --raw -Sdisable -Sqrcode.enable --prescale=320x240 /dev/video0 +* uname -a && cat /etc/os-release + +## Python 3.6 minimum + https://www.scivision.co/compile-install-python-beta-raspberry-pi/ + sudo apt-get install libffi-dev libbz2-dev liblzma-dev libsqlite3-dev libncurses5-dev libgdbm-dev zlib1g-dev libreadline-dev libssl-dev tk-dev build-essential libncursesw5-dev libc6-dev openssl git + + https://gist.github.com/dschep/24aa61672a2092246eaca2824400d37f | https://gist.github.com/SeppPenner/6a5a30ebc8f79936fa136c524417761d + cd ~ + wget https://www.python.org/ftp/python/3.7.2/Python-3.7.2.tar.xz + tar xf Python-3.7.2.tar.xz + cd Python-3.7.2 + ./configure + make + sudo make altinstall --> Problem mit OpenSSL + python3.7 --> quit() + + + sudo easy_install-3.6 -U pip # https://stackoverflow.com/a/34580922/3761783 --> OpenSSL fehlt! + sudo pip3.7 install --upgrade pip + sudo pip3.7 install socketio-client + sudo pip3.7 install RPi.GPIO + python3.7 test.py + + + + + +hat nicht funktioniert: +* apt-get install python3 python3-pip # https://github.com/edmw/volumio-diy/blob/master/README.md#install-volumio-hid +* sudo easy_install3 pip +* pip3 install socketIO-client +* pip3 install aiohttp + +---------------------------------------- * volumio installiert * Ausgabe über "Generic I2S DAC" * Netzlaufwerk verbinden