Hello Tello Pilot!
Join our DJI Tello community & remove this banner.
Sign up

Pack a homebrew action-cam on top of Tello

martinpi

Well-known member
Joined
Dec 15, 2019
Messages
110
Reaction score
53
Location
Vienna. Austria
Website
martinpi.at
Tello's camera offers limited resolution. Tello has no storage device on board but streams videos to the ground, so you get glitches and block artefacts. Why not pack a camera on top?
In general, action cameras are way too heavy for a Tello.
So I took a Raspberry Pi Zero W which is lightweight and produces good videos, even when fitted with a small and inexpensive camera. It can be powered by Tello's battery via a USB OTG cable, so you don't need to add an extra battery.
My setup works on the workbench now, I did not yet test it in flight.
Probably, the storage card on Tello was omitted for legal reasons. Be sure to check the regulations in your country. Here in Austria, I need to have a registration for a UAS equipped with a "sensor to record personal data" such as videos and photos, even if it weighs less than 250 grams.

Enough introduction, let's get hands on.

The goal: Record video (or still pics) on Raspi's SD card, with little or no interaction by the user.

You can communicate with a Raspi through wlan and manually start a program that does the job.
Unless you use a Tello EDU, you cannot connect an additional device. You need one connection (mobile phone, PC, ..) to steer Tello and one to communicate with the Raspi. So you might need an additional wlan hotspot to communicate with the Raspi, possibly a second wlan adapter on the PC.
While finding out Raspi's IP address (when I use my phone as hotspot, I get different ip addresses every time), starting an ssh connection and fiddling around, especially outdoors where the sunlight might blind you, Tello overheats or its battery is becoming empty.
So, when I did some experiments with Raspi and Tello, I often returned home frustrated because I did not manage to run the things which I had tried at home.

Therefore, I want to start the recording automatically when Raspberrry powers up.

What about ending the recording?
When you switch off the Tello and therefore the Raspi loses power, it will likely corrupt the video.

One solution would be to add a button to stop the recording. Not much additional weight.

My solution: I record short (10 seconds) videos. When power goes down, I only lose the last video.
Later, I will concatenate the videos on the PC. I expect that this will go easily and automatically, using ffmpeg or something similar.

Recording videos and saving them to the disk (card) requires unique filenames. The standard solution is to generate a filename from date and time, but this will not work here, because Raspi does not have an onboard realtime clock (you could add one, but this adds weight). I use a counter. You might list the existing video files, see which one is the latest, and continue from then on. When I erase (i.e. move to the PC) all videos from the SD to free some space, I would start with file number 0 (or 1) again, and I need to take care for not overwriting the files on the PC.
Therefore I use a little text file to record the latest number. What if this file gets corrupted? The probability of a power loss while writing the little txt file is extremely low, but I wanted to make sure. I use two text files, one for odd and one for even numbers.

If you are interested, I could share my code.

Be careful when starting a program, especially one with an endless loop, at startup. You could easily lock yourself out, the door is locked and the key is inside. Anyway, starting a program at startup is not such an easy thing to do. There are good instructions which you should follow very carefully. I never succeed at the first try. Get all your permissions correct, use the "try" statement in Python to avoid a crash. With the camera, it is easy to see at a glance if the program is running: When the red LED on the camera module is on, the camera is recording.

Maybe you got some inspiration for an inexpensive, interesting and useful project.
Have fun!
Martin
 

martinpi

Well-known member
Joined
Dec 15, 2019
Messages
110
Reaction score
53
Location
Vienna. Austria
Website
martinpi.at
And now I added that stop-button. I found it annoying that the script keeps adding videos when I do something else, like programming or downloading the videos.
 

Hacky

Well-known member
Joined
Jul 19, 2021
Messages
167
Reaction score
69
Location
Germany
Thanks for sharing. Some hints / addendums when using this approach with Tello EDU:

  • When using Tello EDU with latest firmware, powering external devices became difficult. If an external (OTG) device is connected to the micro USB port, Tello's WiFi hotspot is disabled. You will not be able to connect to Tello through WiFi in that case anymore. Also the WiFi client mode of Tello EDU will not work in that case.

    When you connect something to USB after Tello EDU already activated the WiFi hotspot, the USB port does not provide power anymore.

    Alternatively you could pick power directly from the Tello battery like shown in the video of this thread: Tello NeoPixel RGBW LED lights add-on, remote controllable, 5g
    In that case you have to take care about appropriate voltage conversion by yourself.

  • An alternative approach could be to set up Raspberry Pi Zero as Wifi hotspot. As mentioned before, Tello EDU will not activate it's own Wifi, when RasPi is powered through USB port but you could implement code on the RasPi that allows to communicate with Tello through USB serial.

    Communication through serial interface is e.g. described in the Tello RMTT expansion kit documentation and you find code examples on GitHub.

    Remotely controlling Tello EDU in that case would mean to let RasPi act as a kind of "command proxy" translating commands received by RasPi via WiFi into commands sent to Tello via serial connection.

  • You also could turn Tello + RasPi into an autonomous system. Tello will receive it's commands from RasPi in that case as decribed in the SDK documentation either via serial interface or via WiFi (in case you solved the power problem).
If you record videos in 10 second fragments and put them together later, you will have little drop outs in between. Instead you could record continously and start/stop the video using your additional push-button. You could also implement a "clean shutdown" e.g. by long-pressing the button for 3 seconds or so.
 

martinpi

Well-known member
Joined
Dec 15, 2019
Messages
110
Reaction score
53
Location
Vienna. Austria
Website
martinpi.at
Thanks for sharing. Some hints / addendums when using this approach with Tello EDU:

  • When using Tello EDU with latest firmware, powering external devices became difficult. If an external (OTG) device is connected to the micro USB port, Tello's WiFi hotspot is disabled. You will not be able to connect to Tello through WiFi in that case anymore. Also the WiFi client mode of Tello EDU will not work in that case.

    When you connect something to USB after Tello EDU already activated the WiFi hotspot, the USB port does not provide power anymore.

    Alternatively you could pick power directly from the Tello battery like shown in the video of this thread: Tello NeoPixel RGBW LED lights add-on, remote controllable, 5g
    In that case you have to take care about appropriate voltage conversion by yourself.

  • An alternative approach could be to set up Raspberry Pi Zero as Wifi hotspot. As mentioned before, Tello EDU will not activate it's own Wifi, when RasPi is powered through USB port but you could implement code on the RasPi that allows to communicate with Tello through USB serial.

    Communication through serial interface is e.g. described in the Tello RMTT expansion kit documentation and you find code examples on GitHub.

    Remotely controlling Tello EDU in that case would mean to let RasPi act as a kind of "command proxy" translating commands received by RasPi via WiFi into commands sent to Tello via serial connection.

  • You also could turn Tello + RasPi into an autonomous system. Tello will receive it's commands from RasPi in that case as decribed in the SDK documentation either via serial interface or via WiFi (in case you solved the power problem).
If you record videos in 10 second fragments and put them together later, you will have little drop outs in between. Instead you could record continously and start/stop the video using your additional push-button. You could also implement a "clean shutdown" e.g. by long-pressing the button for 3 seconds or so.
Thanks for these hints!

So I will stay with the current firmware (SDK 2.0) which lets me use WiFi and OTG at the same time.
Setting the Raspberry as hotspot is an interesting idea.

Yes, you are right. Since I have the stop button, I do not need the fragmentation any more. I must not forget to press it before powering down.
 

Dan

Well-known member
Joined
Feb 20, 2020
Messages
162
Reaction score
57
Hello I/WE are not hackers per se. Why re- invent the wheel? We have been working with top loads and booms loads for the Tello for a few years. We only hack, if we connote find solution We have tested with lights, speakers, cameras. etc. from the market. We have worked some with the Runtime camera system, and the Raspberry Pi camera and software to use it with a WiFI system, as a security device, a cameras on a window. They both worked well. We never got to the point of 3D printing a holder. We switched at that time to working with a bottom load drop release to drop a rescue throw rope. Many of our projects do not get comp[eted due to time lines. Good work with Raspberry PI. keep up the testing. You can find much of our work on Youtube MECATX.
 

New Threads

Members online

No members online now.

Forum statistics

Threads
5,285
Messages
38,079
Members
14,588
Latest member
rdmitre