Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: tzankoff on March 28, 2011, 07:57:48 PM

Title: Major VRBot Headaches
Post by: tzankoff on March 28, 2011, 07:57:48 PM
I am attempting to install the VRBOT module on my Axon II microcontroller and am running into nothing but problems...and I am not sure why. So far, the only thing that has gone right is that the library file is being detected when I compile my program (which has been properly uploaded via COM2 on my computer). More on that later.

Here is what I have done so far:
1) power to Axon II is sufficient
2) wiring from Axon to VRBOT is correct (TX/RX plugged into UART3; power plugged into regulated bus)

Here is where things get a bit weird. I turn on the Axon. Nothing blows up and there does not seem to be signs of error. I run the VRBOT GUI and attempt to connect and get this bridge program thing going. No good on all 5 of the COM ports that I have to choose from. When I try on COM2, the Axon returns a buffer problem.

At this point, my question is what the buffer should be set at. Without setting one, my compiling returns errors.
Title: Re: Major VRBot Headaches
Post by: tzankoff on March 29, 2011, 06:14:20 PM
Ugh! Not one response. I'm doomed!  :o
Title: Re: Major VRBot Headaches [some progress...but still need help]
Post by: tzankoff on March 29, 2011, 08:57:02 PM
OK. I think I have made a very little bit of progress

One step in this process that I was unaware of prior to now is that I need to use the Axon II serve as a TTL to USB adapter (according to the instructables.com article I found earlier today).

According to the article, the code for the adapter is in the Axon II demo file folder. I believe that I found the files (in the "USB_2_Serial_Adapter" subfolder). I adjusted the contents to point to the appropriate UART at the appropriate baud rate, compiled, uploaded to Axon II, but still no luck. Trying to connect the VRBot GUI to Axon II still produces some kind of buffer overflow problem.

I really need some help with this. I've been at this for three nights now and I am running out of hair to pull out. Every instruction for the VRBot that I have seen online does not tell me what I need to know. I don't know what I am missing, but I don't know how I am supposed to look for something when I don't know what it is.

On the bright side, I still have some servos, an MP3Trigger, and some other stuff to keep my busy.  :(
Title: Re: Major VRBot Headaches
Post by: Admin on March 30, 2011, 06:15:42 AM
Are you getting compiling errors for the buffer?

But yes, you need to connect VRBot to the GUI using a USB to serial adapter like you said, and the Axon II can be programmed to work as one. You must make sure your baud rates are all synced for this to work - double check them.
Title: Re: Major VRBot Headaches
Post by: tzankoff on March 30, 2011, 08:33:59 AM
Quote
Are you getting compiling errors for the buffer?
I was...but then I realized that I had not set any buffer in the Project Wizard. I have since set them to 80 and 20 like you have in your code. Compiling now returns no errors.

Quote
But yes, you need to connect VRBot to the GUI using a USB to serial adapter like you said, and the Axon II can be programmed to work as one.
That is the part I am not sure if I am doing correctly. I am taking the hardware.h and usb_2_serial_adapter.c (renamed to "vrbotadapter.c") files from your demo folder and put them in the appropriate source and header file folders in AVR Studio and compiled without error...but something is still not right. When I try connecting the VRBot GUI to the Axon (using the same COM port that I use to upload programs to the Axon [right?]), the Axon returns a buffer error and the GUI cannot detect any device.

Quote
You must make sure your baud rates are all synced for this to work - double check them.
I am putting everything at 9600 since that is the default for the VRBot.
Title: Re: Major VRBot Headaches
Post by: Admin on March 30, 2011, 02:52:22 PM
You need to do whats called a loop-back test.

Program the Axon to be a USB to serial adapter. Get a wire and connect the Tx to the Rx (short them). This means whatever you transmit also gets received. Then connect using Hyperterminal.

Type something in, and it should be echoed back in Hyperterminal. There is also a setting that echoes anything you type in Hyperterminal, so make sure thats turned off so you don't get confused between local and Axon echoes.

This will verify your baud rates and that your code is generally working.
Title: Re: Major VRBot Headaches
Post by: tzankoff on March 30, 2011, 04:59:02 PM
<< You need to do whats called a loop-back test. >>
Finally, some good news! I set up the loop-back test and saw what I was supposed to see.
Title: Re: Major VRBot Headaches
Post by: tzankoff on March 30, 2011, 05:16:59 PM
Good news, bad news, and worse news.

GOOD: After the loop-back test was successful, I removed the short and installed the VRBot (yes, correctly)...and I was ble to connect via the GUI. I played around with testing the existing groups. It worked. Hooray!

BAD: I tried to train some new words and it would not work. Blah!

WORSE: I disconnected and have not been able to connect again. Ugh!
Title: Re: Major VRBot Headaches
Post by: Admin on March 30, 2011, 06:07:07 PM
GOOD: After the loop-back test was successful, I removed the short and installed the VRBot (yes, correctly)...and I was ble to connect via the GUI. I played around with testing the existing groups. It worked. Hooray!

BAD: I tried to train some new words and it would not work. Blah!

WORSE: I disconnected and have not been able to connect again. Ugh!

Sounds like you're making a silly mistake somewhere . . . check batteries, make sure baud rates all match, restart, etc.
Title: Re: Major VRBot Headaches
Post by: tzankoff on March 30, 2011, 11:19:18 PM
Somehow, I knew you were going to say that. ;D

Anyway, I did swap batteries, checked the baud rates (everything is still at 9600), did the loop-back test again just to make sure (worked fine), disconnected and reconnected everything from the Axon, and I'm still in the same spot as before.

Title: Re: Major VRBot Headaches
Post by: tzankoff on March 31, 2011, 01:44:38 PM
Well, I still have a robot to program so I am going to let this topic go...for a little while anyway.

I am still not sure how the VRBot module can work one minute and not the next when the only thing that occurred between point A and point B is the power switch on the Axon II being flipped off and back on again five minutes later. I don't know if I can still use the SI commands already on the VRBot, but I'll give it a shot and see what happens.
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 03, 2011, 04:54:09 PM
OK. I am back and my robot is finished (yay!) minus the VRBot module (boo!) and related programming.

I am still having the same trouble as before. I have setup my Axon II to serve as a USB-to-serial adapter. I performed a loop-back test to make sure that I could receive what I was transmitting (which I was). I have the VRBot plugged in properly to UART3 on the Axon. The baud rate is 9600 everywhere.

I try to connect to the VRBot via the GUI and...nothing except the usual "Could not detect device connected to port COM2" message. COM2 is the correct port. The connection process did work once before and I have not changed anything since. Hence, I am not sure what I am doing wrong...assuming I am the one at fault. For all I know, I might have a faulty VRBot.

Any other ideas?
Title: Re: Major VRBot Headaches
Post by: Kylepowers on April 03, 2011, 06:06:27 PM
It sounds to me like a hardware failure if the software is right. If your getting it to work on and off. I would check the pins on the VRbot or the cable itself. Otherwise you probably have a faulty unit with the VRbot. Which then i would contact them and ask for there help.
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 03, 2011, 09:29:19 PM
Sadly, that is what it's starting to look like to me. I've done every obvious thing that I know how to figure this out. However, with no power/status LEDs, it can be somewhat difficult. Blah!

For what it's worth, the rest of my robot seems to be working just fine.  ;D
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 05, 2011, 07:25:22 AM
I think it's now official. My VRBot module is defective. The last straw is when I tested the wires that came with the unit. I hooked up the power, put a volt meter to the other end, and got 5v. Then, I hooked up the TX/RX wires and did a successful loop test on the other end.

So I am going to return the unit and try getting another one. If only Zagros Robotics would answer their phone...  :P
Title: Re: Major VRBot Headaches
Post by: Admin on April 05, 2011, 10:33:25 AM
In your Axon code, make sure you flush the Rx buffer for the VRBot during initialization like I did in my ERP example code. Its very noisy during powerup, filling the buffer up with useless junk.

Do this for your serial to USB adapter code.

Let me know how that works out!
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 05, 2011, 08:16:24 PM
I am thisclose to giving up. This thing has been more trouble than its worth. Things have gotten so screwed up, I am wondering if there is anything I can do to regain the full head of hair that I once had. I am only going to try this one more time because I know of one person (Admin) who has managed to get this thing to work. With that said, I am going to start again...from the beginning.

First, I put the USB-to-Serial program on my Axon II. Just for kicks, here is the code.

Code: [Select]
hardward.h
#define USB_UART UART1
#define OTHER_UART UART3
#define USB_BAUD (BAUD_RATE)9600
#define OTHER_BAUD (BAUD_RATE)9600
#define USB_ACTIVATE &uart1SendByte
#define OTHER_ACTIVATE &uart3SendByte

Code: [Select]
adapter.c
#define RPRINTF_FLOAT
#include "sys/axon2.h"
#include "led.h"
#include "rprintf.h"
#include "hardware.h"

void appInitHardware(void){
uartInit(USB_UART, USB_BAUD);
uartInit(OTHER_UART, OTHER_BAUD);
rprintfInit(USB_ACTIVATE);
led_put_char(1);
}

TICK_COUNT appInitSoftware(TICK_COUNT loopStart){
rprintf("\nAxon initiated.\n\n");
led_put_char(2);
return 0;
}

TICK_COUNT appControl(LOOP_COUNT loopCount, TICK_COUNT loopStart){
int tempbyte;
tempbyte=uart3GetByte();
if (tempbyte!=-1)
uart1SendByte(tempbyte);
tempbyte=uart1GetByte();
if (tempbyte!=-1)
uart3SendByte(tempbyte);
return 0;
}

I compiled it with no errors. I ran a loop test on Hyperterminal and got the results that were expected. I know I have mentioned my reason to believe that my VRBot module is defective. However, under the assumption that it works properly, what would I have to do next? (Just let me play dumb on this one. Please?)
Title: Re: Major VRBot Headaches
Post by: Admin on April 05, 2011, 08:26:52 PM
Again, you need to flush the VRBot buffer in your initialization. :P

Just put this in appInitSoftware:
uartFlushReceiveBuffer(OTHER_UART);
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 05, 2011, 11:21:47 PM
Code: [Select]
void appInitHardware(void){
uartInit(USB_UART, USB_BAUD);
uartInit(OTHER_UART, OTHER_BAUD);
rprintfInit(USB_ACTIVATE);
led_put_char(1);
delay_ms(2000);
uartFlushReceiveBuffer(OTHER_UART);
}

Result...nada. In the meantime, I got an RMA for the module and I am sending it back tomorrow.
Title: Re: Major VRBot Headaches
Post by: Admin on April 06, 2011, 06:53:01 AM
My only other suggestion is to use a 'normal' serial to USB adapter . . .

Try with the bufferflush at the end of appInitSoftware, and power-cycle the VRBot before running the code. Thats all I can think of . . .
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 06, 2011, 05:43:33 PM
I have already packaged the thing and sent it back. I am now waiting for a replacement. Of course, it's on backorder now; so it may be a while. At least there is other stuff I can play with.
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 23, 2011, 08:24:16 PM
About three weeks have passed and I *FINALLY* got a new VRBot (now under the name EasyVR) in the mail from SparkFun...and guess what?

Exact. Same. Problem.

I am not even going to fuss with it this time. I'm not going to pull out what little is left of my hair. I'm not going to ask anybody what to do. I'm sending it back and forgetting about it. This whole thing has been more trouble than its worth. I'm sorry I ever started thinking about it in the first place.
Title: Re: Major VRBot Headaches
Post by: Admin on April 23, 2011, 08:29:56 PM
Just give it one more try but with a normal USB to serial adapter, probably 10 min of effort . . . else all that hair loss was for no reason :P
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 23, 2011, 08:40:01 PM
10 minutes? Hell, I was at this for 10 days (if not more) earlier. Any particular adapter in mind (since you got yours to work)?
Title: Re: Major VRBot Headaches
Post by: Admin on April 23, 2011, 08:44:12 PM
It took me just as long to figure it out . . . if that makes you feel any better :P

The problem I had was somehow data/noise would get in during startup and fill the buffer with junk. It took me forever to figure out that was the problem, but adding the buffer flush after initialization fixed it. I used a regular USB to serial adapter to configure it, which will probably bypass whatever problems you are having.
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 23, 2011, 08:46:57 PM
When training the VRBot, were you getting any "wait timeout has expired" or similar error messages?
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 23, 2011, 08:49:31 PM
...and how the heck do these things plug into the VRBot anyhow? ???
Title: Re: Major VRBot Headaches
Post by: Admin on April 23, 2011, 08:54:25 PM
Nope . . .

this is the only problem I had in terms of configuration:
http://www.veear.eu/Forums/tabid/236/forumid/8/threadid/397/scope/posts/Default.aspx (http://www.veear.eu/Forums/tabid/236/forumid/8/threadid/397/scope/posts/Default.aspx)

...and how the heck do these things plug into the VRBot anyhow? ???
what things?
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 23, 2011, 08:59:12 PM
Quote
what things?

The USB/serial adapter
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 24, 2011, 12:31:03 AM
That's it.

I am through with this damn thing! I am sick and tired of this "sometimes it works and sometimes it doesn't" crap! Half the time, I cannot even connect via the GUI. The half of the time that I do results in nothing but errors, errors, more errors, and more errors after that...none of which are documented might I add. I am fed up. I have spent wasted too much time on this piece of junk.

I am sorry for having tried this and I am sorry you folks had to waste your time reading your way through this debacle. I am really glad you are not in the same room with me right now because I am doing some serious ass shouting at my computer and at myself during times when I am not typing. That is how unbelievably pissed off I am right now.

Admin, I'm sorry...but asking me to try again is not helpful nor encouraging. It just adds to the frustration. I'm not blaming you, but I am sick and tired of doing everything (not just here, but from other sources as well) that has been asked of me and not having a damn thing to show for it.

On Monday, I am sending this thing back. One of these days, I will try finding something else...maybe.
Title: Re: Major VRBot Headaches
Post by: Ro-Bot-X on April 24, 2011, 07:42:35 AM
Do you have the EazyVR module? I think I want to try it out if you don't mind sending it to me instead of SparkFun. I had good results with Arduino and VRbot, but from what I read EazyVR has also speaker output and I want to try to add some speech to it if I can. It would be nice to have a single module that handles voice recognition and speech synthesis. Send me a PM if you want, maybe we could do some parts swap?
Title: Re: Major VRBot Headaches
Post by: Admin on April 24, 2011, 08:36:16 AM
I think thats about the time you should stay far away from anything expensive until things cool off :P
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 24, 2011, 12:18:55 PM
I think thats about the time you should stay far away from anything expensive until things cool off :P
I did. I stayed away for three weeks while waiting for a new VRBot to replace the defective one I sent back...and look what happened. :P

For what it's worth, I did have some positive elements from this experience:
1) I am able to connect to the NotSoEasyVR via the GUI half of the time whereas before I was only able to connect once and that was it.
2) I am able to perform (mostly) successful tests on the SI commands.

The downsides right now:
1) I cannot train any SD commands I create. It keeps giving me a "The wait operation timed out" message.
2) When I click "Reset All", sometimes it will give a "Could not reset all memory. The wait operation timed out" error message.

I am still leaning towards sending it back.
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 24, 2011, 12:32:22 PM
...aaaaand we're back to cannot connect at all anymore. Goodbye, crap. Hello, Sparkfun.
Title: Re: Major VRBot Headaches
Post by: Admin on April 24, 2011, 01:13:49 PM
Seriously, try it with a USB to serial adapter. It may just be the Axon intermediary isn't fast enough for VRbot PC software.
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 24, 2011, 06:33:32 PM
I am only going to try this one more time because I know you got yours to work. Just answer one question and I promise to go away for a while on this issue. Which adapter are you using? I was looking around earlier and all I saw were adapters with USB on one end and 7-pin computer serial ports connections on the other. Is that what I am supposed to see or am I just an idiot...or both?
Title: Re: Major VRBot Headaches
Post by: Admin on April 24, 2011, 07:18:41 PM
This is what I used:
http://www.sparkfun.com/products/718 (http://www.sparkfun.com/products/718)

USB in one end, and Tx/Rx/5V/ground out the other, plugged directly into VRbot. Don't use the 3.3V line on your USB!


side rant:
I think my only real complaint about the VRbot is the owners of it tightly guard the hardware design as a secret. Understandable from an IP prospective, but they absolutely refuse to answer a single question about their hardware - not even if it has a voltage regulator on it or not, or any of the capacitor values. They even deleted my post on their forum (http://www.veear.eu/Forums/tabid/236/forumid/8/postid/395/scope/posts/Default.aspx#395) where I partially reversed engineered the design to help others select an appropriate power supply :-X
Title: Re: Major VRBot Headaches
Post by: Ro-Bot-X on April 25, 2011, 05:36:10 AM
This is what I used to connect to my VRbot without problems:
http://www.sparkfun.com/products/10008 (http://www.sparkfun.com/products/10008)
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 25, 2011, 12:18:59 PM
I will go with Ro-Bot-X's idea for the adapter for two reasons:

1) It's 5V as is. 
2) It's in stock.  ;D
Title: Re: Major VRBot Headaches
Post by: Admin on April 25, 2011, 12:44:02 PM
Both are 5V as is. ;)

On the one I linked, you'd use the pin labeled VCC for 5V:
http://www.sparkfun.com/datasheets/BreakoutBoards/FT232RL-Breakout-Schematic.pdf (http://www.sparkfun.com/datasheets/BreakoutBoards/FT232RL-Breakout-Schematic.pdf)
(it's marked on the bottom of the PCB)
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 25, 2011, 01:00:10 PM
I could have sworn it said 3.3v which you told me not to use. Then again, I did not look at the bottom of the thing in the pictures.
Title: Re: Major VRBot Headaches
Post by: Admin on April 25, 2011, 01:02:26 PM
Yea, on the top it says 3.3V . . . but there are lots of other connections on the side with other options.

That said, it's out of stock, so no biggy.
(I'm shocked it's out of stock, as it's a popular item)
Title: Re: Major VRBot Headaches
Post by: tzankoff on April 25, 2011, 01:11:26 PM
Yeah. Knowing me, I would probably pick the wrong one, fry the board, etc. Anyway, I ordered one. We'll see what happens. In the meantime, I got a hold of a 20-button (5x4) matrix output keypad (previously got a 16-button version) that I will be attempting to use. Bwhahahahahahaha! ::)

At least I have ONE project that is going according to plan.
Title: Re: Major VRBot Headaches
Post by: Admin on April 25, 2011, 01:22:12 PM
[rant]
Yea, I used 3.3V at first. The VRbot datasheet stated it'll work, given average voltage/current requirements. But it didn't work, and I pulled hair out for several days. Turned out the VRbot does current spiking (average current != max current) that caused the USB to reset. So yea, 5V and you'll be fine . . .
[/rant]
Title: Re: Major VRBot Headaches
Post by: aaa3a on May 09, 2012, 11:24:55 AM
which pins no. to use in 9pin serial port if i prolific use usb to serial cable to connect EasyVR with pc

i have searched pinout.ur and found 9pins serial port pinout as follow

pin 2 is Rx and pin 3 is TX pin 5 GND and pin 7 VCC is that right ?

and should i connect Tx for EasyVR to Rx in serial port and Rx of the EasyVR to Tx in serial port or 1 to 1 Rx ---> Rx 

thanx
Title: Re: Major VRBot Headaches
Post by: Admin on May 09, 2012, 11:56:05 AM
aaa3a, see here:
http://www.societyofrobots.com/robotforum/index.php?topic=15630.msg112133#msg112133 (http://www.societyofrobots.com/robotforum/index.php?topic=15630.msg112133#msg112133)