Results 1 to 7 of 7

Thread: How to do Wireless Upload of Sketches to Phantom Hexapod

  1. How to do Wireless Upload of Sketches to Phantom Hexapod

    Hello
    I have a PhantomX Hexapod and am able to upload sketches using the UartSbee-FTDI serial connection or via an ISP. They both work fine but I've read that it's possible to upload wirelessly to an Arbotix-M using the Xbees with one of them plugged into the UartSbee. I can get the Arduino serial monitor to work over the Xbee connection using 38400 baud but when I try to upload the sketch it never finishes the upload and the code on the Hexapod executes while the upload is being attempted.
    Is this because you can't reset the Arbotix-M wirelessly? I've read a few posts and articles about this but none of them are very clear and specific to the Arbotix-M. It would certainly speed up development if I could do program the PhantomX remotely.
    I also have noticed that I can upload sketches via the FTDI serial interface while the Xbee is plugged into the Arbotix-M. I thought this was not possible as they share the same serial port? Anyone know why that would be? It's convenient but a mystery.
    I'm using the following
    Arduino 1.8.3 running on macOS High Sierra 10.13.4 Serial port is /dev/cu.usbserial-A61N70TK
    Arbotix-M as supplied with PhantomX Hexapod MK III
    2 x Xbees S2C
    UartSBee v 5.0

  2. #2

    Re: How to do Wireless Upload of Sketches to Phantom Hexapod

    The Xbees can be configured to forward the state of some of its GPIO pins.

    You can wire the "DTR" pin from the serial converter to one of the GPIOs, and then wire that through to the reset -- this is what the Arduino IDE uses to reset into the bootloader.

    Uploading while the Xbee is plugged in may "work" as long as the Xbee doesn't also want to communicate. However, this may connect the TX output of the serial cable to the TX output of the Xbee, which mean that two outputs will drive into each other, which will lead to one or both of them burning out, if not immediately, then at least much sooner than desired.

  3. Re: How to do Wireless Upload of Sketches to Phantom Hexapod

    Quote Originally Posted by jwatte View Post
    The Xbees can be configured to forward the state of some of its GPIO pins.

    You can wire the "DTR" pin from the serial converter to one of the GPIOs, and then wire that through to the reset -- this is what the Arduino IDE uses to reset into the bootloader.

    Uploading while the Xbee is plugged in may "work" as long as the Xbee doesn't also want to communicate. However, this may connect the TX output of the serial cable to the TX output of the Xbee, which mean that two outputs will drive into each other, which will lead to one or both of them burning out, if not immediately, then at least much sooner than desired.
    Thanks for that. I can see how this would work as DTR goes low when you try to upload a sketch and looking at the arbotix schematic this is connected to RTS which then connects to the Reset pin 9 on the ATMEGA644P. I was also able to upload a sketch via the xbees by pressing the Reset button on the arbotix just before starting the upload.
    However looking at the Arbotix schematic and the board it appears that only pins 1 (VCC) 2 (DOUT) 3(DIN) and 10(GRND) are connected from the Xbee socket on the Arbotix board. The other Xbee pins don't seem to be connected to anything on the board. So I can't see how you can configure the Xbee to forward DTR to one of the digital data pins on the arbotix board so that it can then be connected to the reset jumper pin.
    Am I missing something here or do I actually need to solder a wire from DTR pin 9 on the XBee socket to one of the digital signal pins? I'm ok to do that if it's the only option.
    Also thanks for the tip about why you shouldn't leave the Xbee in when uploading via the FTDI connection.

  4. #4

    Re: How to do Wireless Upload of Sketches to Phantom Hexapod

    My guess is you would have to modify the board. Yes it is a shame that they did not add maybe semi-standard unpopulated .1" header pins to each of the XBee pins, such that you could easily solder something to the board... But as these XBee sockets are through hole type, should not be hard to solder a jumper wire to the bottom of one or more of the IO pins, to maybe do what you want.

  5. #5

    Re: How to do Wireless Upload of Sketches to Phantom Hexapod

    Oh, but it gets harder -- the Xbee is 3.3V signals. The Arbotix-M may be 5V signals. You will need a level translator, too, to make this work out.

  6. Re: How to do Wireless Upload of Sketches to Phantom Hexapod

    Hi,
    I made some progress with this. I soldered a wire to DIO6 on the bottom of the Xbee socket on the Arbotix board and brought this out to a level converter on the 3.3v side. I then connected the output on the 5V side to the reset jumper pin (removing the jumper). I could then switch the 5V on this pin to 0v via a Remote AT command request from the XCTU Frame generator. I could see that the RESET was triggered as the blinking LED stopped. However I couldn't immediately see how to add the Tx frame to do the RESET to the avrdude process that the Arduino IDE sketch download uses. Has anyone done this?
    So I tried IO Line passing, setting DIO6 as an DI on the transmitting Xbee and as DO - High on the Receiving XBee (on the Arbotix board)
    I've followed the tutorials on how to do this and pretty sure I have it set up correctly. I also connected DTR on the Uartsbee board to the DIO6 pin. I can see that pin DIO6 goes low when a download of a sketch is attempted on the transmitting Xbee. However I never see it go low on the receiving Xbee so the upload fails.
    I've read that some Xbees don't support IO Line Passing. I'm using mode S2CTH Xbees. Does anyone know if they support IO Line passing? The XCTU console certainly allows you to configure them that way. Is there some other setting for S2 Xbees that needs to change?
    So I gave up for the moment and went back to uploading sketches via ISP but am now getting the following error
    Arduino: 1.8.3 (Mac OS X), Board: "ArbotiX Std"


    Sketch uses 994 bytes (1%) of program storage space. Maximum is 65536 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 4087 bytes for local variables. Maximum is 4096 bytes.
    avrdude: verification error, first mismatch at byte 0x004a
    0x37 != 0x34
    avrdude: verification error; content mismatch
    avrdude: verification error; content mismatch


    Any thoughts on what is causing this or how to diagnose the issue? The code appears to upload ok and the currently loaded Led Blinking program just restarts after the verification error. I've tried burning the Bootloader and using the FDTi connection but I get the same error code.

  7. Re: How to do Wireless Upload of Sketches to Phantom Hexapod

    Quote Originally Posted by xenoc View Post
    Hi,
    I made some progress with this. I soldered a wire to DIO6 on the bottom of the Xbee socket on the Arbotix board and brought this out to a level converter on the 3.3v side. I then connected the output on the 5V side to the reset jumper pin (removing the jumper). I could then switch the 5V on this pin to 0v via a Remote AT command request from the XCTU Frame generator. I could see that the RESET was triggered as the blinking LED stopped. However I couldn't immediately see how to add the Tx frame to do the RESET to the avrdude process that the Arduino IDE sketch download uses. Has anyone done this?
    So I tried IO Line passing, setting DIO6 as an DI on the transmitting Xbee and as DO - High on the Receiving XBee (on the Arbotix board)
    I've followed the tutorials on how to do this and pretty sure I have it set up correctly. I also connected DTR on the Uartsbee board to the DIO6 pin. I can see that pin DIO6 goes low when a download of a sketch is attempted on the transmitting Xbee. However I never see it go low on the receiving Xbee so the upload fails.
    I've read that some Xbees don't support IO Line Passing. I'm using mode S2CTH Xbees. Does anyone know if they support IO Line passing? The XCTU console certainly allows you to configure them that way. Is there some other setting for S2 Xbees that needs to change?
    So I gave up for the moment and went back to uploading sketches via ISP but am now getting the following error
    Arduino: 1.8.3 (Mac OS X), Board: "ArbotiX Std"


    Sketch uses 994 bytes (1%) of program storage space. Maximum is 65536 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 4087 bytes for local variables. Maximum is 4096 bytes.
    avrdude: verification error, first mismatch at byte 0x004a
    0x37 != 0x34
    avrdude: verification error; content mismatch
    avrdude: verification error; content mismatch


    Any thoughts on what is causing this or how to diagnose the issue? The code appears to upload ok and the currently loaded Led Blinking program just restarts after the verification error. I've tried burning the Bootloader and using the FDTi connection but I get the same error code.
    Update to this

    Lock fuse =0x0F
    Low Fuse = 0xFF
    High Fuse = 0xDC
    Extended Fuse = 0xFD

    The lock fuse doesn't look correct as it looks to be in Boot Loader Protection mode 3.
    Should I write this fuse to 0xFF or would a chip erase work?



    Further info from verbose mode

    Arduino: 1.8.3 (Mac OS X), Board: "ArbotiX Std"


    Sketch uses 994 bytes (1%) of program storage space. Maximum is 65536 bytes.
    Global variables use 9 bytes (0%) of dynamic memory, leaving 4087 bytes for local variables. Maximum is 4096 bytes.
    /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avrdude -C/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf -v -patmega644p -carduino -P/dev/cu.usbserial-A61N70TK -b38400 -D -Uflash:w:/var/folders/6k/t8lxrw3x7k32nmsfp3js0gch0000gn/T/arduino_build_333858/ArbotiXBlink.ino.hex:i


    avrdude: Version 6.3, compiled on Jan 17 2017 at 12:01:35
    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/
    Copyright (c) 2007-2014 Joerg Wunsch


    System wide configuration file is "/Applications/Arduino.app/Contents/Java/hardware/tools/avr/etc/avrdude.conf"
    User configuration file is "/Users/john/.avrduderc"
    User configuration file does not exist or is not a regular file, skipping


    Using Port : /dev/cu.usbserial-A61N70TK
    Using Programmer : arduino
    Overriding Baud Rate : 38400
    AVR Part : ATmega644P
    Chip Erase delay : 55000 us
    PAGEL : PD7
    BS2 : PA0
    RESET disposition : dedicated
    RETRY pulse : SCK
    serial program mode : yes
    parallel program mode : yes
    Timeout : 200
    StabDelay : 100
    CmdexeDelay : 25
    SyncLoops : 32
    ByteDelay : 0
    PollIndex : 3
    PollValue : 0x53
    Memory Detail :


    Block Poll Page Polled
    Memory Type Mode Delay Size Indx Paged Size Size #Pages MinW MaxW ReadBack
    ----------- ---- ----- ----- ---- ------ ------ ---- ------ ----- ----- ---------
    eeprom 65 10 128 0 no 2048 8 0 9000 9000 0xff 0xff
    flash 33 6 256 0 yes 65536 256 256 4500 4500 0xff 0xff
    lock 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    lfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    hfuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    efuse 0 0 0 0 no 1 0 0 9000 9000 0x00 0x00
    signature 0 0 0 0 no 3 0 0 0 0 0x00 0x00
    calibration 0 0 0 0 no 1 0 0 0 0 0x00 0x00


    Programmer Type : Arduino
    Description : Arduino
    Hardware Version: 2
    Firmware Version: 1.16
    Vtarget : 0.0 V
    Varef : 0.0 V
    Oscillator : Off
    SCK period : 0.1 us


    avrdude: AVR device initialized and ready to accept instructions


    Reading | ################################################## | 100% 0.00s


    avrdude: Device signature = 0x1e960a (probably m644p)
    avrdude: reading input file "/var/folders/6k/t8lxrw3x7k32nmsfp3js0gch0000gn/T/arduino_build_333858/ArbotiXBlink.ino.hex"
    avrdude: writing flash (994 bytes):


    Writing | ################################################## | 100% 0.38s


    avrdude: 994 bytes of flash written
    avrdude: verifying flash memory against /var/folders/6k/t8lxrw3x7k32nmsfp3js0gch0000gn/T/arduino_build_333858/ArbotiXBlink.ino.hex:
    avrdude: load data flash data from input file /var/folders/6k/t8lxrw3x7k32nmsfp3js0gch0000gn/T/arduino_build_333858/ArbotiXBlink.ino.hex:
    avrdude: input file /var/folders/6k/t8lxrw3x7k32nmsfp3js0gch0000gn/T/arduino_build_333858/ArbotiXBlink.ino.hex contains 994 bytes
    avrdude: reading on-chip flash data:


    Reading | ################################################## | 100% 0.38s


    avrdude: verifying ...
    avrdude: verification error, first mismatch at byte 0x004a
    0x37 != 0x34
    avrdude: verification error; content mismatch


    avrdude done. Thank you.


    the selected serial port
    does not exist or your board is not connected


    This report would have more information with
    "Show verbose output during compilation"
    option enabled in File -> Preferences.
    Last edited by xenoc; 05-06-2018 at 10:19 PM.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. KURT< HELP!!!!!!!!! Phantom X Phoenix code to run on my hexapod.
    By gregorio_626 in forum Projects For Request and/or Sale
    Replies: 8
    Last Post: 01-26-2016, 06:51 PM
  2. Question(s) Mark I phantom Hexapod
    By thetanked in forum Humanoids, Walkers & Crawlers
    Replies: 6
    Last Post: 10-29-2014, 01:11 AM
  3. Question(s) Phantom x Hexapod mk1 with a 18
    By Jim Cheong in forum Humanoids, Walkers & Crawlers
    Replies: 1
    Last Post: 06-22-2013, 09:42 AM
  4. modeling of phantom ax12 hexapod?
    By abdelrahman in forum Humanoids, Walkers & Crawlers
    Replies: 1
    Last Post: 04-27-2013, 04:10 PM
  5. Question(s) having issues with programming my phantom x ax-12 hexapod.
    By jstew726 in forum Humanoids, Walkers & Crawlers
    Replies: 16
    Last Post: 02-17-2013, 11:42 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •