Hi all,
I'm working on a project where we use IPBaseStation on a mote attached
to a computer to send commands to a module attached to other mote
running an application over UDP using the UdpSocketC component.
When a packet (command) arrive to the mote over the 1234 port, the
application saves, the socket address structure of the sender, on
another structure of the same type, and then, the module who controls
(or wraps) the UdpSocketC module, signals an event presenting the
command just arrived, another module then sends that command to an
external module with sensors, this module performs measures according
to the command, and, when the measures are ready, the external module
sends the measure data to the mote, and this transmit the data, using
the blip stack, to the socket from which the command packet was
received. According to the command received by the remote mote, it
send measure commands to the external sensor module, just once, each
minute, or each 10 minutes.
The remote mote works, it sends a packet with fresh measures each
minute, but only the first 16 times... I verified this using
wire-shark... After the 16 packet, the remote mote seems to miss the
socket address of the sender... It continues transmitting packets
with the measures but to a total different address...
Here is the capture of wire-shark, fec0::5 is the address of the
station, and fec0::1 the address of the remote mote,
No. Time Source Destination Protocol Info
...
48 2083.437157 fec0::5 fec0::1 UDP
Source port: 35770 Destination port: search-agent
49 2093.662352 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
50 2123.662358 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
51 2153.662306 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
52 2183.662415 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
53 2213.658496 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
54 2243.663547 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
55 2273.656560 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
56 2303.663553 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
57 2333.663651 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
58 2363.658368 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
59 2393.656418 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
60 2423.653568 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
61 2453.658375 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
62 2483.655805 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
63 2513.657447 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
64 2543.658372 fec0::1 fec0::5 UDP
Source port: search-agent Destination port: 35770
65 2546.276999 fe80::5 ff02::1 ICMPv6
Router advertisement
66 2573.662396 fec0::1
fec0:1c4c:8838:da11:9a4b:9a4b:a438:25 UDP Source port:
search-agent Destination port: 35770
67 2573.662541 fec0::5 fec0::1 ICMPv6
Unreachable (Route unreachable)
68 2603.672355 fec0::1
fec0:a4c:8838:da11:9a4b:9a4b:a438:25 UDP Source port:
search-agent Destination port: 35770
69 2603.672509 fec0::5 fec0::1 ICMPv6
Unreachable (Route unreachable)
70 2633.672413 fec0::1
fec0:a4c:8838:da11:9a4b:9a4b:a438:25 UDP Source port:
search-agent Destination port: 35770
71 2633.672539 fec0::5 fec0::1 ICMPv6
Unreachable (Route unreachable)
72 2663.667514 fec0::1
fec0:a4c:8838:da11:9a4b:9a4b:a438:25 UDP Source port:
search-agent Destination port: 35770
73 2663.667624 fec0::5 fec0::1 ICMPv6
Unreachable (Route unreachable)
74 2693.667492 fec0::1
fec0:a4c:8838:da11:9a4b:9a4b:a438:25 UDP Source port:
search-agent Destination port: 35770
Apparently the problem begin when the station send the router advertisement,
To save the socket address from which the command come I do:
struct sockaddr_in6 *socket_dest_mapa;
struct sockaddr_in6 *socket_dest_multi;
.....
event void SocketMapa.recvfrom(struct sockaddr_in6 *rtte, void *buf,
uint16_t lon, struct ip_metadata *meta) {
if( !mapa_ocup ) {
mapa_ocup = TRUE;
cmd_mapa = *((uint8_t*)buf);
if( cmd_mapa != 0xFF ) {
socket_dest_mapa = rtte; <<---------
******""HERE""*******
signal GestorRed.petMedDone( &cmd_mapa, AP_MAPA ); }
else
signal GestorRed.petFinMedDone( AP_MAPA ); }
}
I heard that there are problems copying strings in nesC but I do not
know if thats the problem here...
Why might this be happening?
Any help will be appreciated...
Thanks in advance...
Aldo Javier Insfran Dominguez.
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help