PDA

View Full Version : [Question(s)] Uploading the Hex_Mark II -- PhantomX robot



att5091
06-06-2013, 09:08 PM
Hey guys,

I am having a lot of trouble uploading the code to the arbotix from the Phanomx kit. I have never used a programmer before and I can't really find a clear and explicit guide on how to use it. I keep getting an error that says :

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x10
avrdude: initialization failed, rc=-1
Double check connections and try again, or use -F to override
this check.

avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x11
avrdude: stk500v2_disable(): failed to leave programming mode


I am thinking about just getting an FTDI cable and avoiding the programmer. Any suggestions on what I am doing wrong / how to fix it? Thank you

darkback2
06-06-2013, 09:53 PM
Getting everything to work with the arbotix is really hard. Unfortunately one wrong move means things don't work.

Check to make sure you have the proper drivers installed for your serial adaptor. Also check to make sure you are using the right port. I have a programmer and I have to use the lower of the two available port numbers. Most of all check to see if you have the right drivers.

DB

KevinO
06-06-2013, 10:30 PM
I disagree with db on it being difficult. Your errors mean it isn't seeing your programmer. What os are you using. If windows could you go to the device manager and check that the programmer shows up there? If it does, check the com port matches what you are using. And last are you using the upload with programmer option?

DresnerRobotics
06-06-2013, 11:29 PM
Getting everything to work with the arbotix is really hard. Unfortunately one wrong move means things don't work.

DB

Disagreed entirely. I think people get excited building a new kit and don't slow down enough to read through the Arduino and Arbotix documentation properly. The literal hundreds (thousand+ at this point actually) of Arbotix users out there that don't post on the forums looking for help are testament to that. Gotta realize, people often come here looking for help when they have problems, but rarely to post 'hey everything worked great!'. We get a skewed sample of users. Once you actually read the documentation and take time to digest a new concept, setting up the IDE and getting it working takes 15-20 minutes tops. So with that said :

Need a lot more info here. As Kevin said, that's usually associated with your programmer not being properly recognized. It also could be that the cable isn't plugged into your arbotix with the right orientation, the cable should be coming away from the board, not towards. I'm going to assume you're using the Pololu ISP programmer because it's what we sell and you haven't specific otherwise.

As others said, are your drivers for the ISP installed? Do you have the correct com port selected?

Are you powering the arbotix during programming? The programmer doesn't provide power.

Are you selecting 'upload using programmer'?

What LED activity do you see on your programmer when it's just idle plugged into your arbotix with the arbotix powered on.

We need more info to help you out here.

att5091
06-07-2013, 06:16 AM
Thank you everyone for your responses,

It very well could be that I am not connecting them properly as many of you suggested.

I will attempt to answer all of the questions being asked so maybe we can find a solution to this.

-Yes I am using windows and I checked that the device shows up there (Uartsbee) and yes I made sure that the COM ports match.
-I believe that the cable is properly attached. I have the green wire matching the GRN and the black wire matching the BLK pin on both the arbotix and the Uartsbee.
-I am using the programmer that came with the kit so if that is what it is, than yes. I thought it was called the "Uartsbee". I had a question on which programmer to pick on the dropdown in arduino. I have been choosing the AVRISP (serial) [Maybe this is the issue?]
-Yes I am powering the arbotix during programming using the provided battery.
-Yes I tried using 'upload using programmer' and I also tried burn bootloader.
-On the programmer it just has a constant green light at power. I never see RX or TX light up. (also, the arbotix has a constant green light on power and that is it. The only thing that does something different is the controller has a blinking green light next to user along with its constant green light)

Everyone I appreciate your help greatly and I hope that we can figure this thing out :) This community is filled with good people, I was afraid no one would help me with my pathetic little problem! haha

KurtEck
06-07-2013, 07:57 AM
I could be completely off here, but I am not sure if a programmer comes with the kit? I know a lot of people order one to use with the kit as it makes it a lot easier, but instead I believe the FTDI cable comes with the kit. Are you plugging something into the ISP connection 8 pins (2x4) on the board or are you connecting to the inline (6 pins?) connector? I think you are doing the later as you are talking about GRN and Black. If so you are trying to do a standard programming of the board.

Now assuming this and that the board does have the bootloader on it, you should choose the upload command, not the upload using programmer command. Make sure the correct board and comm port is selected.

Also this will not work if the XBee is plugged into the arbotix board. Try unplugging it and then do the upload and see if it works.

Good Luck
Kurt

TXBDan
06-07-2013, 08:14 AM
I think Kurt is onto your setup. You're using the Xbee Explorer as an FTDI interface.

Hardware:
Arbotix-> 6pin header cable (green and black wires) -> Xbee Explorer -> USB cable -> PC. Make sure the Xbee itself is NOT plugged into the Arbotix during programming.

If you're not powering the Arbotix board externally, make sure the jumper is set to FTDI and not VIN. When you plug in the USB cable, you'll get power.

In the Arduino IDE:
Make sure you installed all the Arbotox Arduino libraries and you have 'Arbotix' selected as your board.
Select the right COM port for the FTDI. It should show up under device manager if you need to check.
Then just compile and upload using the buttons in the upper left corner of the Arduino IDE.

DresnerRobotics
06-07-2013, 02:01 PM
I am thinking about just getting an FTDI cable and avoiding the programmer.

I think this is what threw us off. You are already using an FTDI (aka UARTSbee) to program the Arbotix. This isn't usually referred to as a 'programmer' even though it does function as such, because it uses a software bootloader and a raw serial port connection. A 'programmer' generally refers to a separate ISP (in-system programmer) unit, which plugs into the ISP port (as opposed to the FTDI port).

Selecting a programmer in the drop down or using 'upload via programmer' doesn't apply to you unless you're using an ISP programmer. You only have the "upload" (ctl-U) option using an FTDI.

If you're powering it on and the user LED isn't flashing a few times, that sounds like your bootloader might have been blown away somehow. If this is the case, shoot me an email (andrew (at) trossenrobotics.com) and we can figure out a solution to get you up and running quickly. All of our Arbotix's are tested in-house, bootloader burned, and then the Pypose sketch is uploaded via FTDI before they go out the door, so I do know it should have arrived to you with an intact bootloader.

att5091
06-08-2013, 07:45 AM
Hello everyone!


Thank you for your responses. I think that you were correct, I believe that that was the problem. The COM port that I was using was not correct and also I was using 'Upload using programmer'. Thank you for your help.


Do I need to program the controller as well? and if so, does it need the entire code provided? and what board do I choose in the drop down? (I am using the seeduino provided in the kit)


The program uploaded very easily and then when I turned it on he twitched and moved a little bit but was not responding to the controller yet.


Thank you,
-Anthony

KurtEck
06-08-2013, 08:10 AM
I believe the controller is already programmed when the ship it, but it is not hard to reprogram it if not. If you don't already have it, I believe you can download the code from Trossen, which I believe is: http://www.trossenrobotics.com/shared/Downloads/Commander.zip

You need to remove the XBee from the commander and then plug a USB cable from your PC into the commander. As for board, choose "Arduino Duemilonove w/ Atmega328". Note: the name in the drop down has changed in different releases of Arduino. Also choose the com port that was created when you plugged in the Commander.

As for running the Running the PhantomX after you downloaded the code. Did you remove the FTDI cable and plug in the XBee. Also is the 2nd XBee plugged into the Commander?

Good Luck
Kurt

P.S. - I am running my own version of code in the commander, which I have up on Github (https://github.com/KurtE/CommanderEx). The main differences with my updated version is I do some averaging of the last 8 analog values as to smooth out stuff, plus my values for the joysticks use a wider range of values. I use +-127 where I believe the original code uses +-100...

TXBDan
06-08-2013, 08:31 AM
You might also have to pair your Xbees. Mine didn't come paired.

The hex won't move (not even stand up) until it receives messages from the Commander.

darkback2
06-08-2013, 09:41 AM
Sorry if my post came off the wrong way. By hard I meant that you need to read the directions very carefully and follow every step. You also need to make sure you have installed all of your drivers properly and are using the correct settings for everything.

Glad to know you got sorted. Keep us posted on your progress and please share pictures and videos documenting your experience.

DB

TXBDan
06-08-2013, 11:11 AM
The kit manuals could use a lot more information and detail. There is a lot of terminology that doesn't make sense to someone new to these things. Before i bought this kit i had only developed on PICs using a programmer. I didn't know that Arduino had a boot loader and loaded over serial, didn't know what FTDI was, didn't know what an Xbee was and that its a serial connection, didn't know what an Xbee explorer was and it can be an FTDI interface, etc. I didn't immediately realize the Xbee port on the Arbotix is using the same uart that the programming interface does, etc. I figured it all out by searching the forums and internet.

I think a few block diagrams showing the physical interconnect options and a couple paragraphs explaining the background would go a long way.

darkback2
06-08-2013, 11:23 AM
The kit manuals could use a lot more information and detail. There is a lot of terminology that doesn't make sense to someone new to these things. Before i bought this kit i had only developed on PICs using a programmer. I didn't know that Arduino had a boot loader and loaded over serial, didn't know what FTDI was, didn't know what an Xbee was and that its a serial connection, didn't know what an Xbee explorer was and it can be an FTDI interface, etc. I didn't immediately realize the Xbee port on the Arbotix is using the same uart that the programming interface does, etc. I figured it all out by searching the forums and internet.

I think a few block diagrams showing the physical interconnect options and a couple paragraphs explaining the background would go a long way.

Might make that a summer project.

DresnerRobotics
06-10-2013, 01:52 PM
Sorry if my post came off the wrong way. By hard I meant that you need to read the directions very carefully and follow every step. You also need to make sure you have installed all of your drivers properly and are using the correct settings for everything.

Haha, well this is robotics not interpretive dance. GOSH CHE. :P

att5091
06-13-2013, 07:17 AM
Hello everyone,

Thank you for all of your help, you were correct, I learned how to upload things now! My biggest problem was that I was thinking that the Uartsbee was a programmer.... Derp :/ lol


I am now having trouble installing pyserial. I installed python 2.7.5 and the wxPython2.8-win64-unicode-py27. They both installed very easily and seem to be working but when I try to install the pyserial, it comes up with a message that says "No Python installation found in the registry". Any ideas what this means?


Also could I just quickly run through what I have done so far?


First, I uploaded the pypose.ino to the arbotix. It uploaded quick and easily (when I plugged this in, it looked as if the robot got into proper formation as if it was going to be standing up but I had it on its back)


Then I uploaded the Hexapod_Mark_II.ino to the arbotix.


Then I downloaded and installed python 2.7.5 and wxpython2.8-win64-unicode-py27 (and had trouble downloading pyserial)


Then I tried to open the pypose.py file but it will not open (I am assuming because the pyserial is not installed) (also, what do I do when I open this file? do I upload it to the robot?)


Then I uploaded the comander.ino sketch to the controller


Then I paired the Xbees (but I had a question, what exactly needs to be paired between the two xbees? Do they need to be 38400?)


What is my next step? I am a bit confused.


I appreciate all of your help.


Thank you,
-Anthony

TXBDan
06-13-2013, 11:27 AM
I'd google around for help with Python. I'm sure its a common problem.

The linked Xbee tutorial has all the info you need on that topic:
http://forums.trossenrobotics.com/tutorials/how-to-diy-128/xbee-basics-3259/?

DresnerRobotics
06-13-2013, 01:21 PM
Hello everyone,

Thank you for all of your help, you were correct, I learned how to upload things now! My biggest problem was that I was thinking that the Uartsbee was a programmer.... Derp :/ lol


I am now having trouble installing pyserial. I installed python 2.7.5 and the wxPython2.8-win64-unicode-py27. They both installed very easily and seem to be working but when I try to install the pyserial, it comes up with a message that says "No Python installation found in the registry". Any ideas what this means?


Also could I just quickly run through what I have done so far?


First, I uploaded the pypose.ino to the arbotix. It uploaded quick and easily (when I plugged this in, it looked as if the robot got into proper formation as if it was going to be standing up but I had it on its back)


Then I uploaded the Hexapod_Mark_II.ino to the arbotix.


Then I downloaded and installed python 2.7.5 and wxpython2.8-win64-unicode-py27 (and had trouble downloading pyserial)


Then I tried to open the pypose.py file but it will not open (I am assuming because the pyserial is not installed) (also, what do I do when I open this file? do I upload it to the robot?)


Then I uploaded the comander.ino sketch to the controller


Then I paired the Xbees (but I had a question, what exactly needs to be paired between the two xbees? Do they need to be 38400?)


What is my next step? I am a bit confused.


I appreciate all of your help.


Thank you,
-Anthony

Sometimes Python has trouble working well with Windows. I think you HAVE to use 2.6 Python w/ 2.5/2.6 pySerial to get Pypose to work.

But this leads me to my next question: Why are you even needing Pypose? It's not required to get your hexapod working as we've already run pypose and exported a sketch, then optimized that sketch specifically for the robot. By all means, play with Pypose and try your own NUKE export, but I don't want you confused thinking it's a necessary step. You'll notice it is not listed in the Quick Start guide that I recommended you read through.

I'm working on some updated guides with step-by-step instructions for people to try to spell things out a bit clearer. The basic process is this though:

1) Build Hexapod with correct servo ID placement/orientation.
2) Setup Arduino IDE based on Arbotix documentation. Upload example Hexapod MK2 program found on product page.
3) Pair Xbees using instructions in linked tutorial, install Xbee in Arbotix and Commander.
4) Charge batteries.
5) Have fun!

Again, please read through the documentation. Many of the questions you're asking make it seem like you've failed to do this. Nowhere in the documentation does it say you need to install Pypose to get your hexapod working. You CAN go through pypose and make your own NUKE sketch, but we've already done all that work and optimized the gaits that are exported.

TXBDan
06-16-2013, 10:31 AM
I started a blog about my hex project and included some instructions on getting things going. You can check it out here: http://www.dandurusky.com/?p=27

(http://www.dandurusky.com/?p=27)