Go Down

Topic: Coffee pot (Read 1 time) previous topic - next topic


We've tryed to make a coffee pot controled by arduinio and the ethernet shield. We've made a python script and an arduino program.Something does'nt work but we do not know what !!! Could you help us ?
This is the python's script:
Code: [Select]
import socket
print "~ Client WebCafé ~"
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(("", 80))
q = 0
while q != 3:

    print "- Commande cafetière -"
    print "(1) Allumer la cefetière"
    print "(2) Eteindre la cafetière"
    print "(3) Quitte le programme."
    q = int(raw_input())
    if q == 1:
        print "Allumage de la cafetière ..."
    if q == 2:
        print "Extinction de la cafetière ..."
print "a+ !"

And here is the arduino program:
Code: [Select]
#include <SPI.h>
#include <Ethernet.h>

const int relais=13; //declaration constante de broche. Pour le test, on la met sur la 13 qi contient nativement une led

/* Détails technique de la connexion ethernet */
byte mac[] = {
  0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = {
  192,168,1,55 };
byte gateway[] = {
  192,168,1, 1 };

// Attachement d'un objet "server" sur le port 1337
EthernetServer server(80);

void setup()
  // Configuration de la ethernet shield et du server
  Ethernet.begin(mac, ip, gateway);
  Serial.print("server is at ");
  pinMode(relais, OUTPUT); //met la broche en sortie
  digitalWrite(relais, LOW); // ecrire le relais comme NO

void loop()
  EthernetClient client = server.available();
  if (client && client.connected())
      Serial.println("nouveau client connecté");
       char c = client.read();
    if (client.available() > 0)
        case '1': // turn on the coffe pot
        digitalWrite(relais, HIGH);
        Serial.println("coffe pot is now working")
        case '2': // shut down the coffe pot
        digitalWrite(relais, LOW);

Excuse me for mistakes, I am french but I prefer post this in english.


The code you posted does something. You want it to do something. What either of those somethings is only you know.
The art of getting good answers lies in asking good questions.


s'il vous plaît donner plus de détails
For whom does the clock pulse? It pulses for you!


Every thing is on this website http://somecafe.perso.sfr.fr/ but it's in french. We execute the python script on a distant client witch send 1 or 2. The Arduino ( server ) switch the 13 pin on if 1 and off if 2 !!!
PS: I'm a Coauthor


2. The Arduino ( server ) switch the 13 pin on if 1 and off if 2 !!!

Using pin 13 could conflict with the ethernet shield operation.
Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Go Up