Re: [Tinyos-help] Problems with nx_union in TestSerial and sim-sf on T2
Hi All, On Mon, Jul 14, 2008 at 7:32 PM, Stefano Kismet Lenzi [EMAIL PROTECTED] wrote: On Sat, Jul 12, 2008 at 18:36, Federico Porceddu [EMAIL PROTECTED] wrote: Hi All, i'm trying to use TestSerial on Tossim (compiling with make micaz sim-sf ) I modified the TestSerial.h in this way: ... typedef nx_struct test_serial_msg { nx_uint16_t counter; nx_union { nx_uint8_t a; nx_uint32_t b; } prova_t; } test_serial_msg_t; ... I've tried to send messages with the java application TestSerial.java. Does the original TestSerial works on TOSSIM ? Yes, it work. I just add the nx_union. I did not modified TOSH_DATA_LENGTH because it is just 6 bytes and the payload size in serial message is 12 bytes (right?) But i made another test. I don't know where is the proble, but in the original TestSerial.h typedef nx_struct test_serial_msg { nx_uint16_t counter; } test_serial_msg_t; i modify just nx_uint16_t counter; to *nx_uint32_t* counter (so 4 bytes); typedef nx_struct test_serial_msg { *nx_uint32_t *counter; } test_serial_msg_t; i make another time mig files for python and java, recompile java, run application and there is the same problem!! is there a problem with serial messages on TOSSIM and *nx_uint32_t* ?? In this case: DEBUG (0): Received serial message (0x191ea23c) of type 137 and length 6 @ 0:0:4.367578128 //dbg from SerialActiveMessageC.nc receive:00 00 00 00 00 06 00 89 00 00 00 00 00 00 DEBUG (0): Messaggio Ricevuto : 0:0:4.367578128 //dbg from TestSerialC.nc In other case: DEBUG (0): Received serial message (0x191ea23c) of type 97 and length 157 @ 0:0:5.390625000 9d 14 61 dc 9d 14 61 00 02 00 00 00 00 d9 00 18 00 00 00 5a 01 00 00 00 00 00 00 e8 a4 f2 7f fe ff ff ff 00 00 00 00 90 bd b8 6c 03 00 00 00 74 a5 d9 00 b0 90 f3 7f 24 38 f6 7f 5c 83 f2 7f 00 00 00 00 78 22 ee 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 0b d9 00 0c 00 00 00 c6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 and it doesn't signal the Receive. Receive. (so message is not received from my TestSerialC.nc). Does it mean that TOSSIM receive the message that you sent with the TestSerail JAVA program, but the data received on the simulated node on TOSSIM doesn't seem correct and it is discarded beacuse the packet type is not the one expected by the node? Yes, randomly Packet Type and Lenght are not right, so they are discarded. I think that the problem may rely on either: - The implementation of the communication channel between TOSSIM e Java - The implementation of the serialization of Packet used for Python and Java message Randomly sometimes works like in the first case, sometimes like the second case. is there a problem with nx_union..? or in the Tossim? Can i use nx_union in the message definition like i do? I hope that some TOSSIM and MIG expert may better clarify your doubts Yes, I hope that someone can help me :) Thanks in advance. ~~~ Federico Porceddu ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] AbsoluteTimer and TimeSet.set() with TinyOs 2.x
Hi all, I have two questions: 1) in TinyOs 1.x there is AbsoluteTimer interface. Is there an interface like that in TinyOs 2.x ? 2) In TinyOs 1.x if i need to set the logical time to a specified value, i can use TimeSet.set(value) where value is a tos_time_t. Can i set logical time in TinyOs 2.x too? If it is possible, how i can do it? Thanks in advance Bye -- ~ Federico Porceddu ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Problems with nx_union in TestSerial and sim-sf on T2
Hi All, i'm trying to use TestSerial on Tossim (compiling with make micaz sim-sf ) I modified the TestSerial.h in this way: ... typedef nx_struct test_serial_msg { nx_uint16_t counter; nx_union { nx_uint8_t a; nx_uint32_t b; } prova_t; } test_serial_msg_t; ... I've tried to send messages with the java application TestSerial.java. I made the interface to the message structure with the mig tool like follow: mig java -target=null -java-classname=TestSerialMsg TestSerial.h test_serial_msg -o TestSerialMsg.java mig java -target=null -java-classname=TestSerialMsg TestSerial.h test_serial_msg -o TestSerialMsg.py the first one for java application and the second one for python script for Tossim. Sending messages from the TestSerialC.nc to Java application works well, but i have some problems in receiving messages from Java to TestSerialC.nc: Always, SerialActiveMessage.nc receives serial messages but the TestSerialC.nc sometimes signals the Receive. Receive, sometimes no. For Example: if Java Application send Sending packet 0 sent:00 00 00 00 00 06 00 89 00 00 00 00 00 00 the TestSerial.py always receives something (there is debug in tinyos-2.x/tos/lib/tossim/sf/sim/SerialActiveMessageC.nc, i added just the dbg of the message) In this case: DEBUG (0): Received serial message (0x191ea23c) of type 137 and length 6 @ 0:0:4.367578128 //dbg from SerialActiveMessageC.nc receive:00 00 00 00 00 06 00 89 00 00 00 00 00 00 DEBUG (0): Messaggio Ricevuto : 0:0:4.367578128 //dbg from TestSerialC.nc In other case: DEBUG (0): Received serial message (0x191ea23c) of type 97 and length 157 @ 0:0:5.390625000 9d 14 61 dc 9d 14 61 00 02 00 00 00 00 d9 00 18 00 00 00 5a 01 00 00 00 00 00 00 e8 a4 f2 7f fe ff ff ff 00 00 00 00 90 bd b8 6c 03 00 00 00 74 a5 d9 00 b0 90 f3 7f 24 38 f6 7f 5c 83 f2 7f 00 00 00 00 78 22 ee 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 40 0b d9 00 0c 00 00 00 c6 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 and it doesn't signal the Receive. Receive. (so message is not received from my TestSerialC.nc). Randomly sometimes works like in the first case, sometimes like the second case. is there a problem with nx_union..? or in the Tossim? Can i use nx_union in the message definition like i do? Thanks in advance. Ciao -- ~ Federico Porceddu ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
[Tinyos-help] Problems with Iris mote, mts300 and temperature.
Hi All, I have some problems with Iris mote and mts300 sensor board: I'm working with *TinyOs 2.0.2* ( i followed *isis.vanderbilt.edu * instructions). I'm trying to use temperature sensor but my mote crushes. So I installed an opportune modified Oscilloscope application: */*- OscilloscopeAppC.nc --*/ [cut] implementation { components new SensorMts300C(); [/cut] [cut] // sensor components OscilloscopeC.Vref - SensorMts300C.Vref; OscilloscopeC.Sounder - SensorMts300C.Sounder; OscilloscopeC.Light - SensorMts300C.Light; OscilloscopeC.Temp - SensorMts300C.Temp; OscilloscopeC.Microphone - SensorMts300C.Microphone; OscilloscopeC.AccelX - SensorMts300C.AccelX; OscilloscopeC.AccelY - SensorMts300C.AccelY; OscilloscopeC.MagX - SensorMts300C.MagX; OscilloscopeC.MagY - SensorMts300C.MagY; [/cut] } /*- OscilloscopeAppC.nc --*/ [cut] uses { // sensor components interface Mts300Sounder as Sounder; interface Readuint16_t as Vref; interface Readuint16_t as Temp; interface Readuint16_t as Light; interface Readuint16_t as Microphone; interface Readuint16_t as AccelX; interface Readuint16_t as AccelY; interface Readuint16_t as MagX; interface Readuint16_t as MagY; [cut] event void Timer.fired() { [cut] if (call Temp.read() != SUCCESS) report_problem(); } [cut] event void Temp.readDone(error_t result, uint16_t val) { if (result != SUCCESS) { val = 0x; report_problem(); } local.readings[reading++] = val; } } [cut]* *Oscilloscope.h *is the same of cvs, and in the *Makefile* I add * SENSORBOARD=mts300* I installed it with *make iris install,1 mib520,com1* with two warnings: * /opt/tinyos-2.x/tos/sensorboards/mts300/MagP.nc:83: warning: `Mag.gainAdjustXDone' called asynchronously from `I2CPacket.writeDone' /opt/tinyos-2.x/tos/sensorboards/mts300/MagP.nc:87: warning: `Mag.gainAdjustYDone' called asynchronously from `I2CPacket.writeDone'* and it works for all other sensors. If i try to sense temperature when i switch it on, it crushes and doesn't report problems (*report_problem() *switch on red led): *Iris mote* doesn't send (so *BaseStation* doesn't receive). If I install the same application in a *MicaZ *mote with the same *mts300*sensor board it works (temperature sensor too). So I read this thread * http://www.mail-archive.com/tinyos-help@millennium.berkeley.edu/msg16094.html *and I modified *PhotoTempDeviceC *in the following way: *// TempControl.Power - MicaBusC.Int2; TempControl.Power - MicaBusC.PW0;* With *MicaZ *motes it is the same (with or without this patch). With *Iris *motes, they don't crushes but temperature value is 0 or not the real and it is not costant. I tried all combination of hardware, cvs is just updated, so i think that the problem is another one. Can Anybody help me? Thanks in advance. Ciao, -- ~ Federico Porceddu ___ Tinyos-help mailing list Tinyos-help@millennium.berkeley.edu https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help