loading
 
Serial problems
Justin from United States  [6 posts]
15 year
I am trying to debug with the serial interface and am having some difficulties.

Specifically I am trying to interface with an Axon. I have it set to data bits 8, parity None, stop bits 1 and no flow control.

When I send 'r' it should reply with "You pressed r".

Whats odd, is that it will respond, but only after I disconnect and then reconnect.

So I press r, nothing happens.
I disconnect and reconnect then it says "You pressed r".

If I pres r twice, it displays the message twice when I reconnect.

Realterm seems to work fine with the exact same settings.  Any idea what may be going on here?
Justin from United States  [6 posts] 15 year
I just did some more tests. And whatever I send just queued up.

I have a program that just sends "Hi!\n" every 1/2 second. If I leave it connected for awhile, then hit disconnect then reconnect, I get a whole long list of "Hi!"s. So everything coming in is just getting queued up.

Any idea whats going on here?
Anonymous 15 year
Justin,

Sounds like the serial module is buffering the responses and not showing them immediately in the console. We had this issue a while back with other devices. Can you confirm what version of RR you are using?

Sending a newline should cause the buffer to flush and RR to show you the results regardless.

Can you also forward back the Axon app and we will attempt to replicate the issue here.

STeven.
Justin from United States  [6 posts] 15 year
I am using RoboRealm 2.1.1.4.

Who should I send the files to and what files do you need?

Right now I just have a function that does this:

void findFire(void)
    {
    while(1)
    {
    rprintf("Hi!\n");
    delay_ms(500);
    }

    }

using the standard rprintf function in the standard axon files provided on societyofrobots.com.

Justin from United States  [6 posts] 15 year
So I have done a little more experimenting and it looks like it might be dumping the buffer into the console about every 200 characters. But getting to that limit  or disconnecting and reconnecting by pushing the button in the serial comm module seem to be the only things that make it dump.

I have set up a loop that prints every char 0-255 with a 20ms delay between sending chars and it will just happily run through that loop dumping every couple hundred characters. (It will create a new line on a line break char, but it doesn't cause it to dump)

There is one peculiarity I noticed though. When I view the chars in decimal in both realterm and in Roborealm it prints out "...7 8 9 13 10 11 12 13 14 15..." The 13 appearing once out of place seems a little odd.

I attached the .hex file that I uploaded to my axon to test this.
Justin from United States  [6 posts] 15 year
Or so I thought, I think I attached it for real this time.
test.zip
Justin from United States  [6 posts] 15 year
Is there any way to get to a repository of older versions?

I would be interested to see if any of the older versions work. I don't need that complex of features, but I really do need to be able to reliably send commands via serial to RoboRealm.
Anonymous 15 year
Justin,

Can you download ver 2.1.1.6 which has a small but needed fix for the serial module with respect to the Axon. The incoming serial data was buffered up to 256 and not being triggered to process until that limit was hit. For some reason the Axon serial interface was not triggering the timeout RR was looking for to continue processing. We've made some adjustments that now seem to work. We tested your above Hi program and it now prints out the line once every 500ms in the console.

The 13 in your above code does seem out of place but is most likely the newline that you are printing at the end of that line? We're not sure as we can't see the source.

Let us know if you continue to have any issues.

STeven.
Justin from United States  [6 posts] 15 year
Brilliant, works great, thanks!

This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index