Piradio: Difference between revisions

From Futuragora Wiki
No edit summary
Line 24: Line 24:


==Codigo==
==Codigo==
===Emissão do Boletim===
<pre>
<pre>
#/bin/bash                                                                                                                  │
#/bin/bash                                                                                                                  │
Line 32: Line 34:
python /home/pi/off.py     
python /home/pi/off.py     
</pre>
</pre>
===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====
<pre>
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
</pre>
====Off====
<pre>
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
</pre>


Em desenvolvimento: "news on demand" e respostas da vénus pela banda do cidadão através de reconhecimento de voz.
Em desenvolvimento: "news on demand" e respostas da vénus pela banda do cidadão através de reconhecimento de voz.

Revision as of 13:56, 13 September 2019

PIRADIO

Este dispositivo identificado por pi3 é o raspberry que controla as emissões de radio.

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

  1. /bin/bash │

wget -O /home/pi/333.mp3 https://futuragora.pt/futurai/333/333.mp3 │python /home/pi/on.py │

  1. sleep 1 │mpg321 /home/pi/333-b1.mp3 │

mpg321 /home/pi/venus.mp3 │mpg321 /home/pi/333-b1.mp3 │

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


Em desenvolvimento: "news on demand" e respostas da vénus pela banda do cidadão através de reconhecimento de voz.