Show Posts
Pages: 1 ... 4 5 [6]
76  International / Generale / Re: far parlare arduino on: June 05, 2011, 05:30:53 am
grazie, sembra interessante! tu hai avuto modo di provarlo con arduino?
77  International / Generale / far parlare arduino on: June 05, 2011, 02:33:57 am
Salve a tutti, vorrei aggiungere un supporto audio ad arduino, una sorta di sintetizzatore in grado di ripetere delle frasi registrate tipo TTS (text to speech). In rete ho trovato questo shield  http://spikenzielabs.com/SpikenzieLabs/VoiceShield.html che la spark fun ad esempio non commercializza più. Volevo chiedervi un consiglio su altre possibili soluzioni magari a costi contenuti.
grazie!!!!
78  International / Hardware / Re: ArduPower la ciabatta telnetcontrollata on: May 16, 2011, 10:15:25 am
Ciao per l'integrazione in freedom posso fornirti io il plugin. Dovresti solo provarlo sul campo per vedere se funziona.
Mi serve sapere solo questo: i comandi che arduino riceve sono pow+numero linea e on/off corrispondente al comando, giusto?
La connessione avviene tramite socket tcp, vero?
In caso di problemi, c'é un codice di ritorno che può essere intercettato per sapere che l'operazione non é andata a buon fine?
79  International / Hardware / Re: ArduPower la ciabatta telnetcontrollata on: May 15, 2011, 06:00:19 am
Ciao Alberto, un progetto molto interessante!
Vorrei chiederti se vorresti collaborare all'integrazione del tuo prodotto nel nostro software domotico open source.
In pratica dovresti testare sul campo con il tuo il componente software che andrei io stesso a realizzare.
Ho integrato una relay board della progettihwsw di cui si possono trovare i dettagli a questo link http://code.google.com/p/freedomotic/wiki/ProgettiHwSwEthernetBoard

Da quanto ho capito dovrebbe essere semplice adattare il tutto al tuo ArduPower.
Fammi sapere e ti interessa e se hai bisogno di ulteriori delucidazioni
Grazie
80  Topics / Home Automation and Networked Objects / Re: Insteon, Z-Wave and Apps on: May 04, 2011, 07:44:46 am
Hi! We are working on an open source domotic project to control objects using different tecnologies.
Here there is the forum topic http://arduino.cc/forum/index.php/topic,58844.0.html
Community is open to all contribute!!
81  International / Generale / Re: Info kit di avvio on: May 02, 2011, 07:31:20 am
Ciao, io personalmente ho comprato da ethermania ed ho contatti diretti con il titolare: sono molto gentili e rapidi nelle consegne.
Inoltre sono molto competenti anche dal punto di vista tecnico.
Ho realizzato un piccolo progetto con un loro shield e mi hanno assistito con molte spiegazioni tecniche, pubblicando poi il tutto sul loro blog.
82  Topics / Home Automation and Networked Objects / Re: Arduino + Ethernet Shield + X10 =\ Home Automation on: April 29, 2011, 03:24:51 pm
Hi! Very interesting your project!
Have you thought about a software to control all functions?
83  Using Arduino / Programming Questions / Re: problem reading a string from ethernet shield on: April 19, 2011, 09:12:30 am
Thanks PaulS!! You're a genius!!

I solved moving outStream.close() after reading from inStream:

 inStream.close();
 outStream.close();
 socket.close();
84  Using Arduino / Programming Questions / Re: problem reading a string from ethernet shield on: April 19, 2011, 08:36:42 am
This is the complete code for my function sending a message to arduino ethernet shield. It is part of a domotic project more complex

Code:
public class ETHArduinoBoard extends Actuator {

    Properties protocol = new Properties(); //defines the protocol using a hashmap
    Socket socket = null;
    DataOutputStream outStream = null;
    BufferedReader inStream = null;
    String response = null;

    public ETHArduinoBoard() {
        super("ETH Arduino Board");
        //fillProtocolData();
        //connect(); //connects to eth device
        start(); //starts the plugin
    }


  private void connect(Command c) {
      try {
            socket = new Socket(c.getProperty("socket-host"), new Integer(c.getProperty("socket-port")));
            BufferedOutputStream buffOut = new BufferedOutputStream (socket.getOutputStream ());
            outStream = new DataOutputStream (buffOut);
          } catch (UnknownHostException e) {
            System.err.println("Unable to connect to host '" + configuration.getProperty("socket-host") + "' on port " + configuration.getProperty("socket-port"));
        } catch (IOException e) {
            System.err.println("Couldn't get I/O for "
                    + "the connection to " + c.getProperty("socket-host") + "' on port " + c.getProperty("socket-port"));

        }
//        BufferedReader stdIn = new BufferedReader(new InputStreamReader(System.in));
    }


    @Override
   public void onCommand(Command c) throws IOException, UnableToExecuteException {
      ElectricDevice dev = getDevice(c);
      connect(c); // called here to interact with arduino
      String message = createMessage(c);
      try {
            outStream.writeBytes(message);
            outStream.flush();
            outStream.close();
            //in = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            //String response = in.readLine();
            //System.out.println("Device answer:"+response+"\n");
            //in.close();
            //socket.close();
          } catch (Exception ex) {
            System.err.println("Unable to write " + message + " " + socket.toString()
                    + ". Maybe the device is not connected.");
        }
      try {
            inStream = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            System.out.print("Received string: '");

            while (!inStream.ready()) {}
            System.out.println(inStream.readLine()); // Read one line and output it

            System.out.print("'\n");
            inStream.close();
          } catch(Exception e) {
                     //System.out.print("It didn't work!\n");
                     System.out.print(e);
               }
      socket.close();

     }

   // create message to send to Arduino
   public String createMessage(Command c) {
     String message=null;
        message="GET /" + c.getProperty("code") + " HTTP 1.0\r\n\r\n";
        return(message);
       }

    private ElectricDevice getDevice(Command c) {
        //getting a safe reference to the targer object if exist
        ElectricDevice dev = null;
        try {
            dev = c.getTargetObject(ElectricDevice.class);
        } catch (NoObjectFoundException ex) {
            System.err.println("Undefined target object '" + c.getProperty("object") + "' in command '" + c.getName() + "'");
        } catch (ClassCastException classEx) {
            System.err.println("Attempt to handle an '" + c.getProperty("object") + "' as an 'ElectricDevice' -> " + classEx.getLocalizedMessage());
        }
        return dev;
    }


    /*
     * used only to update the state of the object in Freedom
     */
    protected void setTargetObjectBehavior(Command c) {
        ElectricDevice dev = getDevice(c);

        //getting the behavior to apply
        String state = c.getBehavior();

        try {
            if (state.equalsIgnoreCase("on")) {
                dev.switchOn(c.getProperties());
            }
            if (state.equalsIgnoreCase("off")) {
                dev.switchOff(c.getProperties());
            }
            if (state.equalsIgnoreCase("dim")) {
                Light light = (Light) dev;
                light.dim(c.getProperties());
            }
        } catch (Exception e) {
            System.err.println("Unable to change behavior");
        }
    }

    public void onDataAvailable(String data) {
        //do nothing
    }

    public boolean canExecute(Command c) {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
85  Using Arduino / Programming Questions / Re: problem reading a string from ethernet shield on: April 19, 2011, 05:25:24 am
I receive this exception

java.net.SocketException: socket is fclose

But I close the socket after reading Arduino reply.
Can you help me?
86  International / Generale / Re: funzione split() in arduino on: April 18, 2011, 04:11:47 pm
grazie, la proverò presto
87  Using Arduino / Programming Questions / Re: problem reading a string from ethernet shield on: April 18, 2011, 04:05:56 pm
Thanks,I'll try to print exception message.
But if I connect to Arduino by web browser I receive the correct string. All works!!
88  International / Generale / funzione split() in arduino on: April 18, 2011, 10:23:58 am
salve a tutti!! esiste una funzione split per le stringhe integrata nelle librerie di arduino??
grazie
89  Topics / Home Automation and Networked Objects / Freedomotic open source automation and arduino on: April 18, 2011, 10:14:55 am
Hi, we are developing an open source software for home automation.

This is a brief description

Freedomotic is a building automation framework which cuts time and effort to develop your own building automation software. Freedomotic provides usefull features just like a CMS does for website development.

Open source: GPLv2 license
Distributed & Scalable: can be deployed on a network of cheap peer-to-peer hardware node. It is scalable and provides automatic load balancing across nodes on the network.
Cross-language: it uses a MOM (ActiveMQ) to exchange information between components (JSON and XML text messages)
Cross-platform: Freedomotic is written in Java so it can run on Windows, Linux, Mac, Solaris. Java JRE 6 is required.
Event Based: Every action in the real environment and every interaction with the system (eg: a click on the GUI) is mapped to an event. Events can be intercepted at runtime with Triggers making the behavior of the system fully configurable and not predeterminated.
Modular & Extensible: Freedomotic is modular and can enrich its features using plugins. API are distributed along with the software to easely create new add-ons. It provides OSGi Framework features in a simpler way, leveraging well known OO programmig inheritance.
Semantic-rich: Freedomotic provides a semantic-rich knowledge of the environment to implement intelligence and reasoning systems. No coding is required, the environment can be described using our graphical editor.
Hardware Agnostic: Freedomotic has an hardware abstraction layer to abstract from hardware infrastructure (sensors and actuators) using events, triggers and command.


We want integrate Arduino devices and Freedomotic by creating a simple protocol. So we want invite all Arduino users to contribute to this project.

90  Using Arduino / Programming Questions / problem reading a string from ethernet shield on: April 18, 2011, 09:25:13 am
Hi I have a problem with a tcp socket.
I can send a string command to arduino ethernet shield. All is OK.
But I can't read Arduino reply (it should be "200 OK").
Always there is an exception

This is the java code used to talk to Arduino

Code:
try {
            outStream.writeBytes(message);
            outStream.flush();
            outStream.close();
      } catch (Exception ex) {
            System.err.println("Unable to write " + message + " " + socket.toString()
                    + ". Maybe the device is not connected.");
        }
      try {
            inStream = new BufferedReader(new InputStreamReader(socket.getInputStream()));
            System.out.print("Received string: '");

            while (!inStream.ready()) {}
            System.out.println(inStream.readLine()); // Read one line and output it

            System.out.print("'\n");
            inStream.close();
          } catch(Exception e) {
                     System.out.print("It didn't work!\n");
               }
      socket.close();

     }

The problem is with inStream section

Thanks
Pages: 1 ... 4 5 [6]