parrot ar drone usb port

Create a gist now Instantly share code, notes, and snippets. parrot ar drone 2.0 arduino communication with node possible other names: ardrono, dronenodeuino, ardronenodeuino, arnodedroneduino ahahahah above shot is from @rem getting node on the drone untar node-serialport and put node and the node-serialport folder onto a usb thumbstick thingy put the thumbstick thingy into the drone (like in the above photo) telnet into drone, telnet 192.168.1.1(it might be usb1) cp -r usb/node-serialport/ node_modules/ note: you can use node-serialport to get data from arduino but you can't use johnny-five because it depends on firmata which doesn't support Tx/Rx serial communication this last point means you have to write actual arduino sketches and upload them to the arduino directly, but you can still write node code that runs on the drone to reads the serial data also I found out that since the serial port on the drone is intended as a debug console you will get a bunch of debug data spewing out at you from the boards Tx pin.

I don't know how to turn it off at this time. what this means is you can send data into the drone over serial but you can't (to my knowledge -- someone should hack this) send data from the drone over serial to a device yet here is where things get tricky be very careful that you don't eff up your drone! the drone has a female USB port exposed next to the battery connector but unfortunately it is hardcoded into host mode so it can only be used with mass storage devices :( that last point is based on my naive understanding of electronics. prove me wrong and fork these instructions! there is another serial console on the drone motherboard open up the bottom of the drone under the little piece of black tape to expose a buncha plastic hole thingies: turns out this has pins for TTL serial communication and USB serial communication. this awesome post by jazzomaniak is where I figured this out here is a pinout from jazzomaniak: ** it has come to my attention that the serial console tx/rx pins on the AR Drone 2 run at 1.8v which means you'll need a level converter to talk to the arduino.

here is a schematic from the mirumod project that shows where the level converter should be installed ** without a level converter i still was able to receive and transmit serial data from arduino to drone but it was flaky. i believe (but have not yet tested) that after fixing the voltage mismatch that communication will be much more reliable
parrot ar drone kaskus you'll wanna get some thinnish gauge wire (around AWG 16 I reckon, AWG 22 is for most breadboards and my 22 wire didn't fit into the drone serial ports)
parrot ar drone for sale uk get an arduino uno which provides 5v or 3.3v TTL serial via digital ports (Rx and Tx).
parrot ar drone kokemuksiadue and uno have this, not sure about others
parrot ar drone d&r

here is a shot from @rem of drone with the entire bottom cover removed you can also theoretically power the arduino from #8 and #9 on the drone if you hook them up to a barrel power jack thingy for the arduino (or use the Vin and GND pins for the same effect). I haven't hooked this up yet cause I ran out of cables. @rem in the comments below said he got it working
parrot ar drone radio kit you can also use the other USB port on the drone to power the arduino, but I don't have a short enough USB cable for this
parrot ar drone prix fnac upload the sketch in this gist called helloworld.pde to the arduino in a telnet shell on the drone type cat /proc/cmdline and find out which tty device the 'console' is set to. on my drone it was ttyO3 set the tty socket to raw mode: stty -F /dev/ttyO3 -raw verify the baud rate of the socket: stty -F /dev/ttyO3.

mine originally said 115200 but after messing with it it seems to change to 9600. the arduino sketch and the node code running on the drone need to both contain whatever stty tells you the baud rate is for communication to work. the Input/output error above is because I was sending serial data from the arduino into the drone. I unplugged the serial cables from the arduino and tried the command again and it worked. I think it was around this time that the drone decided to switch baud rates to 9600 go into a node repl (./node) and copy paste in helloworld.js from this gist sp = ("", { You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.A word of warning: You should not do anything like the following if you do not know what you do. You may ruin your drone. As A.R. Drone has an USB OTG Port, it should be possible to use this port for extending the functionality of A.R. Drone.

But sadly Parrot disabled this port and only allows to use it for flashing purpose. Luckily they provide the source code for the driver [1]. So... let's have a closer look to this USB port.. First, Parrot defined the port as device only. According to dwc_otg driver: In order to enable the USB host mode, it is required to overwrite/ignore the usb0_info defined in mykonos.c. This can be achieved by patching dwc_otg_driver.c where the platform data is copied to the local parameter data. This is done by function "dwc_otg_set_specific_param". Also, by default (if not overwritten by platform data) the local parameters are configured as DWC_OTG_HOST_DEVICE. So simply not copying this parameter would prevent the driver from going to DEVICE_ONLY mode. Thus the driver is modified and the assignment "params->ctrl_mode = info->ctrl_mode" is removed: As noted by MAPGPS [3], there is still an issue with the driver causing Oops. To fix this issue, it is necessary to change the overcurrent_pin from 89 to -1:

After compiling, ftp-ing the module to the drone and callingdmesg shows that something gone wrong.. also VBus is still +0 V :-( Looking at the drivers code, it seems like this HANG! message indicates a communication problem with the PHY. Checking the voltage levels of the PHY, it seems like almost all pins are tri-stated. Having a look at the PCB, a SMSC USB3317 can be identified. According to its datasheet there is a pin named RESETB. When this pin is set to low the PHY is suspended and all I/O are tri-stated. By monitoring RESETB it can be observed that RESETB is toggled by program.elf. So dumping all GPIO registers before and after starting program.elf the pin can be found. And voilá: GPIO_127 is used to enable/disable the PHY. Program.elf sets it to output a high level which then switches a transistor and pulls RESETB to low. In order to activate the USB as host GPIO_127 needs to be set to input level. This can be done either by ioctl or by the gpio command: