[Tinyos-help] Help with Serial Forwarder

Antonio Ruiz Ruiz antonioruiz83 at yahoo.es
Sat Jun 2 01:58:18 PDT 2007


Hello, I need your help. I'm trying to create an aplication to 
comunicate a sensor network via Mota0 with a java Aplicatión using the 
Serial Forwarder aplication. I have a problen, I don't receive the 
messages sends from Mota0 in the java aplication but I can see in the 
SerialForwarder GUI that messages arrive here.

To start de sensor aplication I execute: /main.exe -r=lossy 
-rf=topologyfile.txt/

To start de SerialForwarder:/ java net.tinyos.sf.SerialForwarder -comm 
tossim-serial /

To start my java aplication: /java Aplicacion

/This is my java code  to create a instance of MoteIF for send and 
receive messages from SerialForwarder:

    /try{
        mote = new MoteIF(PrintStreamMessenger.err, idGroup);
        mote.registerListener(new PracticasMsg(), this);
    } catch(Exception e){
          System.out.println("ERROR MOTEIF");
    }


  public void messageReceived(int dest_addr, Message msg) {
        if (msg instanceof PracticasMsg) {
            tratarMensaje(dest_addr, (PracticasMsg)msg);
        } else {
            throw new RuntimeException("messageReceived: Got bad message 
type: "+msg);
        }
    }

What is my problem?, please help me and excuse my english.
/



More information about the Tinyos-help mailing list