Piradio: Difference between revisions
No edit summary |
|||
Line 62: | Line 62: | ||
#while True: # Run forever │# GPIO.output(11, GPIO.HIGH) # Turn on | #while True: # Run forever │# GPIO.output(11, GPIO.HIGH) # Turn on | ||
</pre> | </pre> | ||
==Volume== | |||
amixer sset PCM,0 90% | |||
Revision as of 00:49, 4 December 2019
PIRADIO
Este dispositivo identificado por pi3 ou piradio é o raspberry que controla as emissões de radio da Futuragora.
Boletim informativo
Contém dados climatéricos e outras informações.
O mp3 é gerado no servidor e depois é recolhido a cada minuto 59 do servidor.
A rotina de sacar o ficheiro corre nos seguintes termos:
A emissão é a cada meia hora, com os dados actualizados.
Plano 333
Emissão regular a cada 3 horas do plano 333.
Venus Radio
Venus Chat Bot emitido pela radio. Através da caixa de input é possível fazer a venus emitir a resposta ou emitir um texto predefinido.
Antes de emitir deve ser usada a venusaudio que emite o audio pela pagina de internet.
Codigo
Emissão do Boletim
#/bin/bash │ wget -O /home/pi/fabeacon.mp3 https://futuragora.pt/beacon/fabeacon.mp3 │python /home/pi/on.py │ #sleep 1 │mpg321 /home/pi/333-jing1.mp3 │ mpg321 /home/pi/fabeacon.mp3 │mpg321 /home/pi/333-jing1.mp3 │ #sleep 1 │ python /home/pi/off.py
Emissão da Venus Radio
#/bin/bash │ wget -O /home/pi/333.mp3 https://futuragora.pt/futurai/333/333.mp3 │python /home/pi/on.py │ #sleep 1 │mpg321 /home/pi/333-b1.mp3 │ mpg321 /home/pi/venus.mp3 │mpg321 /home/pi/333-b1.mp3 │ #sleep 1 │ python /home/pi/off.py
Controle do Rpi para emitir
On
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library from time import sleep # Import the sleep function from the time module GPIO.setwarnings(False) # Ignore warning for now GPIO.setmode(GPIO.BOARD) # Use physical pin numbering GPIO.setup(11, GPIO.OUT, initial=GPIO.HIGH) # Set pin 8 to be an output pin and set initial value to low (off) #while True: # Run forever │# GPIO.output(11, GPIO.HIGH) # Turn on
Off
import RPi.GPIO as GPIO # Import Raspberry Pi GPIO library from time import sleep # Import the sleep function from the time module GPIO.setwarnings(False) # Ignore warning for now GPIO.setmode(GPIO.BOARD) # Use physical pin numbering GPIO.setup(11, GPIO.OUT, initial=GPIO.HIGH) # Set pin 8 to be an output pin and set initial value to low (off) #while True: # Run forever │# GPIO.output(11, GPIO.HIGH) # Turn on
Volume
amixer sset PCM,0 90%
Em desenvolvimento: "news on demand" e respostas da vénus pela banda do cidadão através de reconhecimento de voz.