[Tinyos-help] Transparent RS232 connection using motes
luis.fischer at cinetec.de
Thu Mar 31 13:33:14 PST 2005
Hi Jan Hendrik,
as far as I know there is no reference application available that
fulfills your needs. But you are right - it's absolutely possible.
I am doing a TinyOS development at the moment and need an UART
communication between mote and PC, too. It's important for me to
have a direct access to the mote's UART without encapsulating my
RS232 data within an active message, because I want to communicate
with my own PC software or with an terminal programm, instead of
using the Serial Forwarder.
This is what I did:
I had a deeper look at some of the demo projects that use the UART
(oscilloscope, TestUART,...) and recognized that using the
configuration HPLUARTC allows me to directly transmit and receive
bytes to / from the mote's UART. HPLUARTC can be found here:
/cygwin/opt/tinyos-1.x/tos/platform/mica2/HPLUARTC.nc (should also
work with micaz).
It provides the interface HPLUART (have a look at
/cygwin/opt/tinyos-1.x/tos/interfaces/HPLUART.nc) that provides the
commands init(), stop() and put(uint8_t) and the events get(uint8_t)
Use this configuration / interface to do the
mote-to-rs232-communication, collect the received data with a buffer
of a few bytes (don't forget an timeout of some milliseconds) and
then do the radio communication like done in the Rfm-Samples.
Just to reassure you: I think when starting with TinyOS there is no
other way than working in using the demo apps, go deeper step by
step to understand how they are implemented and then recognize and
use the right level of abstraction of each interface you need to
build up your own application. At first view it seems that there are
lots of applications already implemented, but to speak from my own
experience, most of the demos are only good for demonstration, but
have to be improved to be good for real application use.
Hope this helps a little!
Jan Hendrik schrieb:
> Hi All,
> I would like to use two or more motes to connect different UARTs ( i.e. PCs
> ) together.
> The basic functionality should be that the mote should take all messages
> that are received on the RS232 Uart, encapsulate it with the active message
> header and broadcast ( address 0xFFF ) it to other motes. Similarly the mote
> should pass all received radio messages to the Uart ( address 0x007E ).
> ( RS232 <-> Uart_mote_1 <-> Rfm_mote_1 <-> Rfm_mote_2 <-> Uart_mote_2 <->
> RS232 )
> I would like the link to be as transparent as possible, i.e. I would like to
> use the RS232 application as is, since I don't have the source code. At the
> moment the two RS232 devices communicate over a standard null modem cable.
> The TOSBase, TransparrentBase and Transceiver applications all seem to be
> designed to work with the Serial Forwarder.
> Am I just using the mote applications wrong, or is there another mote
> application already available that would act as transparent RS232-to-RF-to
> RS232 link between two RS232-centric applications?
> I have tried writing my own application to get some form of transparent
> communication going, but at this stage I have only managed to get a
> preprogrammed Text message from one mote via RF to another mote and out to
> the Uart. I can't seem get a plain text message from the uart of one mote
> via RF to another mote. Even though I'll keep on hammering at it until I
> succeed ( I have spent about a week working on it since I've received my
> micaz motes )
> I would like to know if I am trying to reinvent the wheel and if I am
> wasting my time. I know that It should be possible
> If I could at least get one-way communication ( RS232 -> Uart_mote_1 ->
> Rfm_mote_1 -> Rfm_mote_2 -> Uart_mote_2 -> RS232 ) going that would be a
> great start. Any pointers, tutorials, archived Tinyos-help newsletters that
> would help me achieve my goal would be very much appreciated.
> Where can I get an example of receiving plain text ( without the message
> header ) from the uart?
> I would the store this text in a buffer and broadcast the buffer via RF.
> Thank you for your patience in reading this long post, and thank you in
> advance for any help.
> Kind regards
> Jan Hendrik Rust
> Tinyos-help mailing list
> Tinyos-help at Millennium.Berkeley.EDU
email: luis.fischer at cinetec.de
[ X ]«---- nail here for new monitor
More information about the Tinyos-help