Donnerstag, 13. März 2014

Drohne und Telnet

Das habe ich mal gefunden..

http://drones.johnback.us/blog/2013/02/03/programming-multiple-parrot-a-dot-r-drones-on-one-network-with-node-dot-js/

http://nodecopter.com/hack

and thanks to

Diego Araos aka daraosn for:


#!/usr/bin/env bash
usage() {
cat << EOF
__ __ __ __ __
/\ |__) | \|__)/ \|\ ||_
/--\| \ . |__/| \ \__/| \||__

WPA/WPA2 support

This script connects the AR Drone to a WPA/WPA2 secured network.

Usage: script/connect "<essid>" -p "<password>" [-a <address>] [-d <droneip>]
<essid> Name of the WPA2 network to connect the drone to.
<password> Password of the network.
<address> (optional) Address to be set on the drone when connected to the network.
Use a different address than the router's default.
Set to "auto" or "dhcp" to let the router DHCP server auto-assign an IP.
Default is "auto".
<droneip> (optional) Current drone's ip address.
Default is 192.168.1.1
EOF
}

ESSID=$1
PASSWORD=$3
ADDRESS=$5
DRONEIP=${7:-"192.168.1.1"}
DHCPC=""

if [[ -z $ADDRESS ]] || [[ $ADDRESS = "auto" ]] || [[ $ADDRESS = "dhcp" ]]; then
DHCPC="; wait 5; /sbin/udhcpc -i ath0"
  ADDRESS="0.0.0.0"
fi

IFCONFIG="ifconfig ath0 $ADDRESS;"

if [[ -z $ESSID ]] || [[ -z $PASSWORD ]]; then
usage; exit 1
fi

set -ue

echo "ESSID: $ESSID"
echo "PASSWORD: $PASSWORD"
echo "ADDRESS: $ADDRESS"
echo "DRONE_IP: $DRONEIP"

{( echo "\
wpa_passphrase '$ESSID' '$PASSWORD' > /etc/wpa_supplicant.conf
{ $IFCONFIG iwconfig ath0 essid '$ESSID' && wpa_supplicant -B -Dwext -iath0 -c/etc/wpa_supplicant.conf $DHCPC; } &
"; sleep 1; ) | telnet $DRONEIP > /dev/null; }