raspberry emeteur 433 mhz


14 posts
by moijerem » Thu Jan 17, 2013 3:53 pm
bonsoir voila jai conecter un emeteur sur mon raspberry sur le gpio 11

j ai programer un arduino avec ceci
Code: Select all
/*
433.92Mhz Recepter on Pin 2
Relais1 on Pin 7
Relais2 on Pin 8
Relais3 on Pin 9
Relais4 on Pin 10
Relais5 on Pin 11
Relais6 on Pin 12
Relais7 on Pin 13
Relais8 on Pin 6
*/

int remotereceiver = 2;
int relais1 = 7;
int relais2 = 8;
int relais3 = 9;
int relais4 = 10;
int relais5 = 11;
int relais6 = 12;
int relais7 = 13;
int relais8 = 6;
String message;

//Setting things up
void setup() {

// initialize serial communication at 9600 bits per second:
Serial.begin(9600);

// Remote Receiver are on Input mode / Leds on Ouput
pinMode(remotereceiver, INPUT);
pinMode(relais1, OUTPUT);
pinMode(relais2, OUTPUT);
pinMode(relais3, OUTPUT);
pinMode(relais4, OUTPUT);
pinMode(relais5, OUTPUT);
pinMode(relais6, OUTPUT);
pinMode(relais7, OUTPUT);
pinMode(relais8, OUTPUT);
}


void loop() {

//This delay scrolls the message so if the message was received too early it correctly synchronize
delay(20);

//Recording 24 times the digital of the DATA pins before showing it
for(int code = 1; code <=24 ; code++)
{
//This delay is the same as on the Rpi code for synchronisation purpose.
delay(10);
message = message + digitalRead(remotereceiver);
}

//Relais1 ON message
if (message == "111111110011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais1,HIGH);
//Relais2 ON message
if (message == "011111110011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais2,HIGH);
//Relais3 ON message
if (message == "001111110011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais3,HIGH);
//Relais4 ON message
if (message == "000111110011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais4,HIGH);
//Relais5 ON message
if (message == "000011110011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais5,HIGH);
//Relais6 ON message
if (message == "000001110011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais6,HIGH);
//Relais7 ON message
if (message == "000000110011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais7,HIGH);
//Relais8 ON message
if (message == "000000010011010011010011")
{
Serial.println("And Rpi said let's there be light!");
digitalWrite(relais8,HIGH);}

//Relais1 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais1,LOW);
//Relais2 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais2,LOW);
//Relais3 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais3,LOW);
//Relais4 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais4,LOW);
//Relais5 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais5,LOW);
//Relais6 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais6,LOW);
//Relais7 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais7,LOW);
//Relais8 Off message
if (message == "111111111101011111111111")
{
Serial.println("And Rpi send everything to darkness!");
digitalWrite(relais8,LOW);
}

//Show message and reset it
Serial.println(message);
message = "";

}


je souhaite enclencher mais relais depuis une commande ssh de mon rapsberry
comment envoyer les signaux depuis mon raspberry pour enclencher mes relais merci
Posts: 7
Joined: Thu Jan 17, 2013 3:50 pm
by jelopo » Thu Jan 17, 2013 4:25 pm
Bonjour,
Je n'ai pas bien compris ce que tu souhaites :?
Pour piloter les GPIO réfères-toi à cette page RPi Low-level peripherals. Plusieurs langages sont en exemple pour lire/écrire sur les GPIO.

Pour le ssh il faudra que tu lance ta commande comme suit :
Code: Select all
ssh user@Raspberry_pi /chemin/progrmamme

A+
Posts: 266
Joined: Wed Oct 17, 2012 7:53 pm
by moijerem » Thu Jan 17, 2013 4:48 pm
je souhaite emetre un code avec mon emeteur 433 mhz relier a mon raspberry
celui si par exemple 111111111101011111111111

j ai essayer cette commande
pi@raspberrypi ~ $ cd /var/www/hcc/
pi@raspberrypi /var/www/hcc $ ./radioEmission 0 111111111101011111111111

0 corespont au port gpio relier a l emeteur et 111111111101011111111111 et le code que j ai enregistre dans mon programme arduino
Posts: 7
Joined: Thu Jan 17, 2013 3:50 pm
by Yaug » Thu Jan 17, 2013 5:05 pm
Salut,

Si cela peut t'aider, tu trouveras un bon tuto pour communiquer à 433 mhz ICI
Il y a notamment une partie sur l'encodage de l'onde, qui peut sans doute t'aider.
Organisateur d'aPiro : http://forum.raspfr.org/viewtopic.php?id=6
Domotique DIY : http://ydle.fr
Communauté française : http://forum.raspfr.org/
RaspberryGeek / http://manuel-esteban.com
User avatar
Posts: 126
Joined: Thu Jan 03, 2013 1:52 pm
Location: France, Moselle
by moijerem » Thu Jan 17, 2013 5:12 pm
deja merci pour le lien mais je suis sur ce site depuis 2 semaine et je n y parvient toujour pas c pour cela que je me tournée vers vous
Posts: 7
Joined: Thu Jan 17, 2013 3:50 pm
by moijerem » Fri Jan 18, 2013 7:24 pm
bonsoir comment emetre depuis la raspberry l un de c 3 code ?


Decimal: 7590929 (24Bit) Binary: 011100111101010000010001 Tri-State: F1011FF00F0F PulseLength: 365 microseconds Protocol: 1
Raw data: 11348,308,1132,1012,404,1012,404,1016,408,308,1144,308,1140,1012,408,1012,404,932,412,1008,408,308,1148,1004,412,308,1144,1008,412,304,1148,308,1144,308,1144,304,1144,308,1152,1000,412,304,1148,308,1144,304,1144,1008,412,

Decimal: 7590932 (24Bit) Binary: 011100111101010000010100 Tri-State: F1011FF00FF0 PulseLength: 364 microseconds Protocol: 1
Raw data: 11292,344,1112,1072,388,1076,388,1072,388,340,1120,340,1116,1068,392,1072,388,1072,396,1068,392,336,1120,1068,396,336,1120,1064,396,336,1120,336,1124,336,1120,52,124,88,52,188,24,12,96,68,16,28,12,32,136,

Decimal: 7590930 (24Bit) Binary: 011100111101010000010010 Tri-State: not applicable PulseLength: 367 microseconds Protocol: 1
Raw data: 11432,300,1148,1056,404,1068,404,1068,404,332,1140,328,1144,1060,408,1072,400,1064,412,1060,412,324,1144,1064,408,328,1144,1060,412,324,1144,328,1144,324,1144,324,1148,320,1148,1060,412,324,1144,324,1152,1056,408,324,1148,


j en et vraiment besoin merci beaucoup
Posts: 7
Joined: Thu Jan 17, 2013 3:50 pm
by moijerem » Sat Jan 19, 2013 3:39 pm
personne ??
Posts: 7
Joined: Thu Jan 17, 2013 3:50 pm
by tobie123 » Sat Jan 19, 2013 3:40 pm
Moi je cherche comment récupérer l'onde envoyer par une sonde meteo ...
Posts: 73
Joined: Mon Jan 07, 2013 10:41 am
by moijerem » Sat Jan 19, 2013 3:46 pm
tres simple a tu un arduino sous la main ?
Posts: 7
Joined: Thu Jan 17, 2013 3:50 pm
by tobie123 » Sat Jan 19, 2013 4:22 pm
Non je n'ai qu'un Rpi...
Posts: 73
Joined: Mon Jan 07, 2013 10:41 am
by moijerem » Sun Jan 20, 2013 4:00 pm
a la je ne peut pas t aider je ne c pas mais personne pour mon probleme
Posts: 7
Joined: Thu Jan 17, 2013 3:50 pm
by miyoyo » Sun Jan 20, 2013 4:26 pm
Mais,tu cherche à faire quoi,au juste?
Posts: 19
Joined: Sun Jan 20, 2013 2:18 pm
by tobie123 » Sun Jan 20, 2013 5:32 pm
Pourquoi avec un arduino tu aurais fait comment?
Posts: 73
Joined: Mon Jan 07, 2013 10:41 am
by tobie123 » Wed Jan 23, 2013 9:08 am
up
Posts: 73
Joined: Mon Jan 07, 2013 10:41 am