Piradio: Difference between revisions

From Futuragora Wiki
(4 intermediate revisions by the same user not shown)
Line 6: Line 6:


Contém dados climatéricos e outras informações.
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===
===Plano 333===
Line 13: Line 19:
===Venus Radio===
===Venus Radio===


[[Venus Chat Bot]] emitido pela 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===
<pre>
#/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   
</pre>
 
===Emissão da Venus Radio===
<pre>
#/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
</pre>
 
===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.


[[Category:Projectos_Futuragora]]
[[Category:Projectos_Futuragora]]
[[Category:Opensenses]]
[[Category:Opensenses]]

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

#/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 


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