On Friday 11 May 2007 02:22, you wrote: > When I run Make, I got the following error: > > mig -o serialpacket.h -c-prefix=spacket c > /home/hailun/tinyos-2.x/tos/lib/serial/Serial.h serial_packet > Unknown target mica > Known targets for TinyOS directory /home/hailun/tinyos-2.x/tos > and the specified include directories are: > btnode3 intelmote2 mica2 mica2dot micaz null telosa telosb tinynode > failed to parse message file > /home/hailun/tinyos-2.x/tos/lib/serial/Serial.h > make: *** [serialpacket.h] Error 1 > > I really have no clue to debug this since all these files are deliberately > written..(What I guess is that my environment setting is wrong but I really > do not know which setting is wrong!!)Please help me!!
It looks to me like your tinyos source tree is fouled, your env vars are wrong, or your env vars are unset. These are common problems for people installing tinyos. Once you get tos installed correctly -- tested by trying to make apps in the $TOSDIR/apps directory -- the SDK will compile for you too. You should follow the instructions at www.tinyos.net. And there's lots of installation help history on this list. Your installation of tinyos into an atypical location (i.e. /home/hailun/tinyos-2.x instead of /opt/tinyos-2.x) creates an extra burden, but it will work fine. You need to locate and modify the files that are used to set your environment and change them. It's probably easier to install it into its default location. > >From: Steve McKown <[EMAIL PROTECTED]> > >To: [email protected] > >CC: "Micfox Micfox" <[EMAIL PROTECTED]> > >Subject: Re: [Tinyos-help] The connection between some program in C and > > the mote > > >Date: Thu, 10 May 2007 15:27:18 -0600 > > > >Hi, > > > >On Wednesday 09 May 2007 03:59, Micfox Micfox wrote: > > > I have the following problem I need to solve and hope I can get some > > > advice from this mailing list. > > > Let me say I have a program called A (in C language). It can generate > > > some output (denoted as B). I need to pass B to the motes through > > serial > > > > port. However, the packets from the PC to motes are sent through Java > > > program. How can I make B to be passed to mote? (B is a dynamic > > variable > > > > and changing as A goes). > > > >TinyOS 2.x has a C SDK (it might exist for tos1 too?). The PC can open a > >serial port directly, to which a mote running BaseStation or something > > like > > >it is connected. The PC can read and write packets to/from the serial > > port, > > >with the connected mote forwarding them between the PC and sensor network. > >The SDK can handle active messages. > > > >If memory serves, running make in $TOSROOT/support/sdk/c creates > >serialpacket.c and serialpacket.h, then builds libmote.a. The lib > > contains > > >everything you need to do active message packet exchange via the serial > > port > > >(plus the code in sfsource.o, which you don't need). > > > >To open and close the serial port: > > handle = open_serial_source(name, > > platform_baud_rate(baud), 0, stderr_msg) > > close_serial_source(handle) > > > >Reading packets from the serial port: > > pktPtr = read_serial_source(handle, &pktLen) > > /* skip sync byte for tmsg */ > > msg = new_tmsg(pktPtr + 1, pktLen - 1) > > spacket_* and tmsg_read_* functions read data > > from buffer > > > >To write, it's something like this: > > char buffer[big_enough]; > > /* sync byte added by write_serial_packet */ > > tmsg_t* msg = new_tmsg(buffer + 1, sizeof(buffer) - 1) > > memset(buffer, 0, sizeof(buffer)); > > spacket_header* and tmsg_write* functions write > > data to buffer > > write_serial_packet(handle, buffer, sizeof(buffer)) > > free_tmsg(msg); > > > >The SDK deals with the serial header/footer, helps with the packet > > envelope, > > >and provides functions to read and write values adjusting between native > > and > > >nx formats as necessary. > > > >Hope this helps, > >Steve > > _________________________________________________________________ > 享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com > > > !DSPAM:46446a68143641804284693! _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
