Drones are getting more and more popular (and expensive) so why not build your own? With less than 200$ you can build your own FPV drone, no remote needed, it streams video to your smartphone while also using it as a remote. Alternatively you can use a PS4 controller as a bluetooth controller by connecting it to your phone. This is an advanced tutorial, you are expected to have some linux/raspberry/python/android experience. So, let's get started.
In case you want to see the final result, here it is:
And this is how the app looks like:
Total: $205.91 (assuming you had a raspberry already, else + about $35)
You can also buy cheaper and less performant parts, i just wanted it to look nice and have that extra oomph of power.
Ok, lets build it. Follow the assembly instructions of your frame and then mount the motors, the ESCs and Power Distribution Board (don't solder the ESCs to the motors if you didn't test the spin direction first!).
Flash the MultiWii firmware using the Arduino IDE: www.multiwii.com
Calibrate your MultiWii using the MultiWiiGUI tool (also available on multiwii.com)
Mount the raspberry camera and power it on to check if it works, here's how:
ssh into pi:
on another terminal on your pc run:
nc.traditional -l -p 5000 > fifo.264 | mplayer -fps 30 fifo.264 -cache 1024
then on the raspberry via ssh:
cat fifo.264 | nc.traditional <your.pc.ip.address> 5000 & /opt/vc/bin/raspivid -o fifo.264 -t 10000000 -b 2000000
If all goes well, you should now have a live video stream from the raspberry to your PC. Neat.
Now, your raspberry pi should act as a wifi hotspot, you don't want to be carrying around a router everywhere you want to fly the drone. So plug in the WI-FI antenna and set the dongle in hotspot mode and enable DHCP by editing /etc/network/interfaces to look like so:
source-directory /etc/network/interfaces.d auto lo iface lo inet loopback iface eth0 inet manual allow-hotplug wlan0 #iface wlan0 inet manual iface wlan0 inet static #wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf hostapd /etc/hostapd/hostapd.conf #iface default inet dhcp address 192.168.1.1 netmask 255.255.255.0 dns-nameservers 188.8.131.52 184.108.40.206
Note: You may need to restart dhcpcd: sudo service dhcpcd restart
Then edit /etc/hostapd/hostapd.conf and add these lines at the top of the file:
interface=wlan0 driver=nl80211 ssid=XDRONE hw_mode=g channel=6 macaddr_acl=0 auth_algs=1 ignore_broadcast_ssid=0 wpa=2 wpa_passphrase=<wifi.secret.password> wpa_key_mgmt=WPA-PSK wpa_pairwise=TKIP rsn_pairwise=CCMP
You don't need to configure IP forwarding, there wont be any internet connections to share anyway :)
After you do this steps you wont be able to connect the raspberry to your WI-FI, so either connect to it's new WI-FI hotspot or plug in an ethernet cable to continue.
Next step is to clone the python app into the home directory of your raspberry, so login to it and do: git clone firstname.lastname@example.org:C1PR14N055/drone.git
To run the python app simply do: python x.py
You can also make it so it always starts on boot by editing /etc/rc.local and adding the line sudo -u pi /usr/bin/python x.py &
Now on your PC clone and compile the app in Android Studio: git clone email@example.com:C1PR14N055/droneapk.git
After that's done open the apps settings and set them to match the setting from the pi (file x-conf.json).
Pro tip: to pair a PS4 controller and use it with your phone enable BT and hold SHARE + PS buttons for about 10 second until the front light is blinking, then pair to it from your phone. Also make sure to check the "Use controller" option in the android app's settings.
So, after all this hassle, here it is flying :)