I've used an open source C serial listener/writer. The code is in attachement.

 

Hope this helps out.

Symon
 


Date: Thu, 19 Mar 2009 11:29:29 -0500
From: [email protected]
To: [email protected]
Subject: [Tinyos-help] Serial forwarder, C compilation => integration with 
external 9script) programs

Finally, I integrated the SerialForwarder option (C version, Debian OS, TinyOS 
2.1) with my base-station programs. For this, I only had to copy the T2 stuff 
to a directory and install a small JVM at the device for C compilation 
purposes. Now, I don't actually need the T2 stuff I copied to the device, 
except the C compiled codes related to the sf directory.  Also, I don't need to 
run the JVM anymore and my small device CPU capabilities thank for this 
resources savings.

I am using this solution to integrate multiple WSNs (MICA2, MICAz, TelosB, 
Iris, Imote2). I only tested for MICAz, but I think I will have no problems 
with the other platforms. I also need to have this solution for SunSPOT.

2 questions for the group:

1) Does anyone have any experience with a simple serial port listener software 
(C)? It is not for the TinyOS environment. Actually, I would like to use this 
capture program for the SunSPOT solution. Using the linux minicom software, I 
can also hear the messages from the SunSPOTs, but I need a C program to 
integrate it in my bash scripts.

2) Using the SF stuff (in my case, I am using sf and sflisten programs), the 
raw data is fine for me, because I can easily get my payload data from the T2 
messages. However, the integration of these programs with my linux scripts is 
not easy and I have 800-1100 ms of latency with the actual solution. Part of 
this latency is actually caused by the serial port speed bottleneck, but part 
is caused by the way I am solving the integration with the SF programs. Does 
anyone have any modified SF programs aiming integrating with external (script) 
programs?

Any suggestion is welcome !

MS: I did not understand your question about the radio reception. Actually, I 
developed my own T2 software to gather debugging/sensing data from each WSN. In 
a specific WSN, the nodes debugging/sensing data are transferred to their 
specific "WSN gateway", a mote that is USB-connected to the Linux-device I 
mentioned. This device has many "WSN gateways" attached to it. The software at 
this linux device transfers all messages, from all WSNs, to a PC-based server.

Regards,

Agnelo Rocha da Silva
Research Assistant - Wireless Sensor Networks Laboratory
University of Nebraska-Lincoln (UNL)



2009/3/16 Michael Schippling <[email protected]>

What's doing the radio reception?
MS

Agnelo Silva wrote:




I am using a small device (Linux-Debian embedded) which does not have any 
TinyOS software. This device will work as a base-station and I my intention is 
to avoid the addition of external packages, e.g. TinyOS.
My idea is to only use the Serial Forwarder (C version, TinyOS 2.x) on the 
device to interchange data with the WSN.
I would like to know what are the requirements for the compilation process, in 
other words, I need to install any TinyOS package for the solely functionality 
of the Serial Forwarder? Restrictions about the C compiler?


Regards,

Agnelo Rocha da Silva


------------------------------------------------------------------------

_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help


-- 


_________________________________________________________________
Chat with the whole group, and bring everyone together.
http://go.microsoft.com/?linkid=9650735

Attachment: adrport.c
Description: Binary data

Attachment: adrport.h
Description: Binary data

Attachment: adrserial.c
Description: Binary data

#Makefile

CC = gcc
OBJECTS = adrport.o adrserial.o
CFLAGS = -g -Wall

serial: $(OBJECTS)
        $(CC) -o [email protected] $+

clean:
        rm -rf *~ *.o *.out
baudRate: 9600

run:
        ./serial.out 0

Where 0 becomes /dev/ttyUSB0 and 1 becomes /dev/ttyUSB1, etc.

To modify the baud rate or the serial port, look in OpenAdrPort(char* 
sPortNumber)
for :

                1)  sprintf(sPortName, "/dev/ttyUSB%s", sPortNumber);

                2)  B9600



_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to