Tag: RPI Project

  • Drone Light Show (Part 1) – Research

    Drone Light Show (Part 1) – Research

    I’ve been recently looking into building custom drones for a light show. A drone light show is a fleet of drones with lights that fly synchronously to display an image or animation in the sky.

    Intel's 500 drone light show
    Intel’s 500 drone light show

    Each drone has a GPS tracking device to ensure proper distance and movement. One central base station on the ground has a laptop running the Skybrush server (more about that later), which communicates to the drones with movement controls and flight plans.

    My first step was researching software and what kind most people use. Was it free? What drones can it run on? Etc. Some quick googling revealed an excellent software called SkyBrush. Skybrush is open source and offers all the steps from planning your sky layout to executing the formation.

    Using their software starts with Blender (or SkyBrush Studio). They offer a blender plugin that lets you control speed and formation, which you can later export to code for the SkyBrush server to use on the field. Full page here.

    After finding SkyBrush, I looked at building custom drones. First, I found this article on the subject from DojoforDrones a couple of months ago. It’s a detailed post on how he built and configured drones to work with SkyBrush and perform full drone shows. He got away with spending about $899 on each drone. (He used a kit that he offered on his website for $899.)

    One of the most expensive parts of the setup ended up being the GPS. You would imagine using the same technology as any $200 Android would be cheap. However, the GPS system that he (and many others) used was using RTK (Real-Time Kinematics). Essentially, it uses not only one satellite, as in a standard GPS device but a minimum of 4 satellites; this improves accuracy as you get the full “3D” tracking of the satellites in different places in orbit. In addition to 4 satellites, you also use a base station that provides correction data to the drone.

    ↴ Fun Fact

    There are 4 current GNSS sattelite companies (countries):

    • Global Positioning System (United States)
    • GLONASS (Russia)
    • Galileo (EU)
    • BeiDou (China)

    www.geospatialworld.net/blogs/what-are-the-various-gnss-systems/

    RTK GPS example
    https://en.wikipedia.org/wiki/Real-time_kinematic_positioning

    One major con to this system is price. Pricing can be a minimum of $200 to quickly going over $400 just for the GPS system. The most popular one I’ve seen others use is the HolyBro F9P, primarily for its accuracy and “Plug’n’Play” with Skybrush and ArduPilot. The main reason SkyBrush doesn’t recommend using a standard cheap GPS device is its accuracy, which is not good enough for drones to operate close to each other without homing fails and possibly crashing with the other drones mid-flight. There is also an FAQ that answers this.

    There is also a super detailed video by DroneDojo on YouTube that tests the actual field differences in GPS systems. I encourage you to watch the whole thing, but the main synopsis is at 19:02

    Another factor in the base station setup is a Wi-Fi router. This communicates to the drones to update any pre-flight plans and to update information on the Skybrush server running on the laptop. Most people I’ve seen use a standard home Wi-Fi router they had lying around, and that seemed to do the trick. But this also requires each drone to have Wi-Fi onboard, which is relatively cheap, with good ones going for about $45.

    I briefly mentioned ArduPilot earlier; ArduPilot is the base firmware you would run the drone off of and what SkyBrush installs next to. ArduPilot (or ArduCopter, a branch) can run on almost any correctly wired flight controller, ranging from cheap to expensive. Also, being open source, it has many branches and modifications available for almost any hardware (foreshadowing next post). A popular flight controller I see referenced with SkyBrush is the HolyBro Pixhawk 6C. While not the cheapest option, it is the most Plug’n’Play with out-of-the-box support for the LEDs I would mount on the drone and the RTK Module.

    However, I have found exciting leads on cheaper alternatives to the most expensive parts of this project, including a more affordable RTK module…

    That will be covered in the next part of this series. In the meantime, I created a read-only Discord server that will be the main update to this project before blog posts.

    Useful links:

    SkyBrush FAQ https://doc.collmot.com/public/faq/latest/index.html

    “How I Build Custom Light Show Drones…” https://www.youtube.com/watch?v=qBjRaalXJmY

  • ChatGPT for Learning Programming?

    ChatGPT for Learning Programming?

    Recently I was curious and tested some simple questions with the new GPT 3.0 Assistant trained by OpenAI; I also tried to by using it with a small programming project using Python. Which is known as the most convenient language in many people’s eyes.

    The project used a simple 16×2 character display to display statistics about the server hosting the site you are reading this on, which is run locally on a Raspberry Pi. I wanted to see live status updates on my website from the comfort of my desk without logging into the Pi via SSH and pulling the data on the command line. So I found a starting point, a library made originally by The Raspberry Pi Guy with many simple demos on using the character display to display information.

    One problem is that I am not experienced in using Python and have only used it in minor tasks. So I was curious to see if I could use the AI model to help me create a python script. And I was surprised by the end result.

    First, I gripped a built-in script with the demos that I had downloaded to the Raspberry Pi, hooked up a 16×2 display I had lying around, and only had one minor bug before I could get the script properly running. The original python script was built for a different version of python and used a different version. It used:

    !/usr/bin/env python

    Instead of:

    !/usr/bin/env python3

    Which just states where the python library is located; in my case, mine was called Python3.

    Once I confirmed that the display worked, I started editing one of the files as a starting point for my script; the essential functions I wanted it to display are:

    • CPU temperature
    • Check if the correct system tasks are running
    • Ping the internet for a connection
    • Ping the website domain to see if the website is running

    I started with a demo script called netmonit.py, which pinged the local internet router and pinged google. Then displayed them on the screen one by one, this demo being the closest I chose it. Then I found a script on the raspberry pi forum, which grabbed the CPU temperature and stored it to a variable, (it also printed it out to the console, but I didn’t need that, so I deleted that part.) I then mashed those two together to produce a script that surprisingly worked. But it didn’t all work out of the box.

    This is where ChatGPT came in handy; the assistant was able

    1: Find errors, correct them, and give me back the corrected code

    2: It told me what I had done wrong and told me what to do to fix it.

    3: I could even remember what code I gave it before and use that information to help me in the following answer. (This only was useful for a minor part but was noticed)

    Here’s some example of what it fixed for me (please keep in mind I’m a novice in Python and programming, so these issues are primarily googlable:)

    I even used it to solve my errors for me:

    I am honestly amazed by some of the technology. Using the power of this AI and my knowledge of basic programming, I could build a script that did all of the tasks I had before listed and display them to my display. And this was the result, a working screen display for my desk:

    Conclusion:

    Some say this will replace humans in some jobs, and I can see why they say that. I don’t see it as something that can completely replace the position. This is far from perfect or even close. I even had issues with some of the code the AI gave me, like some of it is outdated or the code was mashed from different sources. I see it as AI will become a super helpful tool, especially in programming, but it will only be that for now. The AI works in the simplest sense, grabbing datasets from books and the internet. But I think ChatGPT says it best:

    To train me, OpenAI used a process called unsupervised learning, in which the AI system is not given explicit labels or examples to learn from, but is instead left to discover patterns and relationships in the data on its own. In my case, the data consisted of a large dataset of text from a wide range of sources, including books, articles, and websites.

    -ChatGPT, or “Assistant”

    I do not have access to any additional data or information beyond what was used to train me, and I do not have the ability to browse the web or access new information. I can only provide answers and generate text based on my training and the information that I have been provided.

    ChatGPT, or “Assistant”

    Learning, though, is where it excels, for most popular languages would benefit students in learning programming. A tool instead of a replacement in the programming space. This video by Joshua Morony really demonstrates how well it works and has an excellent summary, I would recommend watching it:

  • Octoprint

    Over the year, I’ve used Octoprint for my 3d printers. Octoprint is a server that hosts on a Raspberry Pi (and now even an Android device), which then you connect to your printer, which you can connect using the local IP. Octoprint is mainly used for managing your prints since it’s a lot easier to upload the.GCODE files to a local server and have Octoprint start, stop, and pause the 3D print with a press of a button. Many other features make Octoprint one of the best companions for a 3D Printer.

    One of the other benefits is its plugins; since Octoprint is open-source, they fully support plugins by independent developers; Octoprint has been out for almost a decade now, there are many plugins in its library. Some of my favorites include:

    • PrintTimeGenuis. Which uses an algorithm that can accurately predict how long a print will take, I have used this many times, and after about a month of printing, the plugin can predict the exact time all the way down to the number of minutes a print will take.
    • Octolapse, Octolapse is a plugin that has a highly comprehensive way of taking time-lapses of your print; instead of just taking a video and speeding it up, it can tell the printer at each layer of plastic to move to a fixed point and take a picture, which ends up being similar to a stop-motion video. The amount of options you can change to take time-lapses is fantastic, and why it is a favorite of mine.

    Another valuable tool is Octoapp (android exclusive) Octoapp is a fantastic app by Chris Würthner, who made it work around Android OS. Like many other developers, Chris benefits from a subscription to the app in which the user gains more features, which with a small amount each month, is a great way to support the developer and get valuable upgrades to the app. Many plugins work inside the app, including PSUControl, MultiCam, Octoeverywhere, and many more. What I like is that the app is primarily bug-free when it comes to the interface and is definitely built with the user in mind, such as the quick switch option, pausing and canceling prints, having a swipe to confirm option.

    There are many really nifty and interesting plugins that have been made for every use case available below is a link to every plugin in Octoprint’s public repository, which is constantly being updated with new plugins.

    https://plugins.octoprint.org/by_author/

    Other links:

    Octoapp by Chris

    PrintTimeGenuis plugin by Eyal

    Octolapse plugin by Brad

    Octoprint.com

    Octoprint on Android

    The best Cura plugin for Octoprint

    Note: I am not a developer, nor am I affiliated with Octoprint by any means, just a Octoprint user who is grateful for the many developers who make 3D printing a better experience.

  • Setup Cloudflare DNS Proxy for Server

    Recently when setting my WordPress site, one of the requirements I wanted to meet was having a proxy server protect it. Basically, a proxy server is where another person’s server hides the original IP of the base server. For example, this image:

    In my case, I wanted my public IP to be not seen by using domain IP lookup tools. And possibly misuse it for malicious intents. (Such as DDoSing)

    After a little googling around, I discovered that Cloudflare had the free proxy option when you use their service. So I switched over nameservers to Cloudflare instead of GoDaddy nameservers, and it copied over the current DNS records. I just had to change the A record with the “orange cloud” enabled. The “orange cloud” is the switch on whether or not a DNS record has the proxy enabled or not

    above: Orange cloud means proxy is enabled, and grey is direct DNS enabled

    This tool can be handy for many hosting cases such as Minecraft Servers and Web hosting.

    I definitely recommend using Cloudflare for Proxy and DNS management, as they have many useful tools, including redirects for domains.