Skip to content

Instantly share code, notes, and snippets.

@remy
Created November 12, 2012 23:58
Show Gist options
  • Save remy/4062916 to your computer and use it in GitHub Desktop.
Save remy/4062916 to your computer and use it in GitHub Desktop.
NodeCopter Tips

This is just a holding place for the things I find out until they make up a proper document or separate docs. This is a working doc - but it might be helpful to someone. I'm also trying to approach any changes I make in a non-destructive manner, in that it's easy to reverse out if I make a mistake.

What software is on the drone?

All listed here

What happens when the drone boots?

The script /etc/init.d/rcS is kicked off. This boots up the wifi, and udev for listening to mounting drives.

If you want to make successive changes that you can easily reverse out - like changing the wifi channel, I'd recommend appending a /root/boot.sh script to /etc/init.d/rcS. In that boot script you can include wifi channel, how the wifi works (connecting to existing network rather than letting machines connect to it, etc).

Where does the usb mount to?

By default to /data/video/usb1 and then if it's free also to /data/video/usb.

Do something automatically when the USB is inserted

I played around for a while with udev rules - but it ended up a waste of time. Partly because when the drone boots it reset the udev rules directory (by removing and recreating). However, something (unknown what) kicks off /bin/mount_usb.sh when the drive is inserted and this does the actual mounting.

I've appended /data/video/usb1/mount.sh, so that when a usb drive is inserted, if there's a script called mount.sh on the root, it'll automatically execute.

This script can then be used to automatically change the channel or network the drone connects to. Maybe if you fancied something clever, it could write out a config file that's read by the /root/boot.sh that I've suggested above.

Giving the drone a network to connect to

Karl Westin posted this gist - make sure to change and to values that work for you!:

killall udhcpd; iwconfig ath0 mode managed essid <SSID>; ifconfig ath0 <THE DRONE IP> netmask 255.255.255.0 up;

I'm still trying to determine whether you really need wpa_suppliment to get the drone to connect to WPA/WPA2 networks - or if wireless-tools has the capability in there.

How much storage is available?

The main data store you'll probably play around in is /data/video as that's the landing point when you FTP in. It's only 53.5Mb.

I've been dropping johnny-five on to my Drone, but the whole directory is around 40Mb. However, I found if you delete the docs directory in johnny-five (and IIRC, I removed the Socket.IO activeX dependancy) it ends up around 31Mb - so it fits!

@paulca
Copy link

paulca commented Nov 14, 2012

There's some more on command line networking stuff at http://www.ardrone-flyers.com/forum/viewtopic.php?f=8&t=807&hilit=wifi

@remy
Copy link
Author

remy commented Nov 14, 2012

I'm looking at these commands to see if I can connect to a WPA network using the drone (though so far untested).

@remy
Copy link
Author

remy commented Nov 15, 2012

Also here's a dump of commands I was using on the drone - note that I was originally looking to hooking in to udev - but the drone deletes all the rules on boot, so this turned out to be a dead end (do not run these - it's just here for a record for me):

ACTION=="add", SUBSYSTEM=="usb", RUN+="/bin/mount.sh"
/tmp/udev/dev/.udev/rules.d/55-mount.rules
udevadm info -a -p $(udevadm info -q path -n /dev/sdd1)
cat /etc/init.d/rcS
cat /sbin/udevd.sh
udevadm trigger --action=add --subsystem-match=usb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment