To LUGNET HomepageTo LUGNET News HomepageTo LUGNET Guide Homepage
 Help on Searching
 
Post new message to lugnet.roboticsOpen lugnet.robotics in your NNTP NewsreaderTo LUGNET News Traffic PageSign In (Members)
 Robotics / 5417
5416  |  5418
Subject: 
Re: IR questions
Newsgroups: 
lugnet.robotics.rcx.legos, lugnet.robotics
Date: 
Tue, 22 Jun 1999 21:10:42 GMT
Viewed: 
293 times
  
Luis Villa  <liv@duke.edu> wrote:
This is a whole bunch of IR questions, which come from my first serious
fooling around with the IR.  Since some of these are legOS or Linux
specific, I've cross-posted- I hope no one is too offended.

1) Despite putting the bot in an infinite while loop sending "H", the
tower turns off after 1-2 seconds. I was under the impression that
receiving from the bot would keep the tower alive. Is this incorrect? Is
there a special keep-alive from the bot, or should I just send out a keep
alive from the PC on a regular basis?

Only transmitting keeps the tower alive, at least according to my tests.
If absolutely necessary, an occasional 0xff sent by the PC will keep the
tower alive; this will result in only a start bit being sent, which ought
to occupy very little air time.

Unfortunately, the bot cannot do anything to keep the tower alive.

2) Using LegOS and send-raw, if I use something like tm-and-ir that
attempts to send an entire string, I'll sometimes get the first character,
but the rest of what I send is gibberish. In contrast, using a while(1)
loop to send a repeating characters (like "H") will get through with only
an occasional error. Is this a timing or threading problem? Something I
should be aware of in the code? Both ends are running at 2400 baud- would
dropping that rate help at all?

I'm not sure what you are trying to do here, so I don't know what might be
broken.  Are you trying to use send-raw to send to the RCX or are you
trying to use send-raw to receive from the RCX?  Either way, only tower
reception needs warming up, with the warmup time that ranges from .1 sec to
2 sec depending on ambient lighting.  Therefore, sending to the RCX does
not require the tower to warm up as long as you do not check the echo and
do not care to receive a response.

There might be a problem with reception in tm-and-ir.c.  For example, the
following line at 2400 baud might make the display indecipherable:

      while(dir_read(&(buffer[3]),1)!=1)
        ;

At 2400 baud, characters scroll by very quickly, no?  At least this is the
case if you can/do use send-raw to send long strings of characters.

Dropping the baud rate probably won't help much, unless you think the
display is scrolling by too quickly.

Rewriting send-raw.c will probably help a lot, in the sense that you can
add code to keep the tower alive and keep reception warmed up, and you can
add more code to make it more like a terminal program so that it can both
send and receive.

3) Perhaps Markus or Kekoa would be best suited to answer this- is there
a reason why send-raw does not prime the tower when no arguments are
presented on the command-line? It would seem obvious to do this by
sending out a single byte (which occurs automatically in Kekoa's send.)
Is there a reason why this doesn't happen? Will it interfere in the
robot?

I do not know anything about send-raw.c, since I did not write it.

Also, I do not think send.c really primes the tower in the way you
describe.  It does send retries, which effectively allows the tower to warm
up, but it does not explicitly warm up the tower by sending a single byte.
Not send.c at least.

I do have a send2.c that I have not yet bothered to release but which I
might have described to the list - it has a "wakeup tower" function that
sends an occasional byte and waits for the tower to receive it back
correctly.

As for a keepalive byte interfering with the robot, LegOS is pretty
primitive at the moment, and forces the user to handle packet framing.  A
random keepalive byte at tower power on should not mess up reception, but
in the LegOS world at least, it is up to the user to guarantee that framing
does not break in the presence of such extra bytes.

At some point I can release send2.c if others want to use it, but probably
not today, since I am busy today.

-Kekoa



Message is in Reply To:
  IR questions
 
This is a whole bunch of IR questions, which come from my first serious fooling around with the IR. Since some of these are legOS or Linux specific, I've cross-posted- I hope no one is too offended. 1) Despite putting the bot in an infinite while (...) (25 years ago, 22-Jun-99, to lugnet.robotics.rcx.legos, lugnet.robotics)

2 Messages in This Thread:

Entire Thread on One Page:
Nested:  All | Brief | Compact | Dots
Linear:  All | Brief | Compact
    

Custom Search

©2005 LUGNET. All rights reserved. - hosted by steinbruch.info GbR