Introducing MagicPoi Alpha

TLDR: Magic Poi Alpha is getting test circuit boards, new firmware which works with the new web service and development is being accelerated by AI. At the end I ask for money to fund the AI coding assistant – via my Patreon Account.

Major updates to the Magic Poi project:

HARDWARE:

  • ESP32 S3 chip
  • Buttons
  • 2020 size LED’s for more pixels
  • Lithium battery
  • Full housing re-design

FIRMWARE:

  • OTA programming
  • Dual Core with FreeRTOS background processes (downloading images won’t interfere with display)
  • Streaming from web functionality
  • Full integration with magicpoi web service API but works offline
  • Any number of LED’s supported
  • Timed events supported

Instagram video of magicpoi breadboard in action: https://www.instagram.com/reel/C-KaTrBOwb_/

WEB SERVICE:

  • Friends – share with friends (working on this now)
  • Products – currently legacy 36px, 72px and new 200px with more to be supported.
  • Image classification with AI on upload
  • Moved back-end data to PostgreSQL for scaling purposes
  • Actually complete re-write of the whole thing (old version online at http://magicpoi.circusscientist.com, new version to be hosted at https://magicpoi.com soon)
Adding friends to the new magicpoi.com alpha version

Development:

Firmware and Web Service are moving forward really fast now – recently I moved over to Cursor IDE, the AI based IDE that’s so easy to use my kid loves it: https://www.circusscientist.com/2024/09/05/my-10-year-old-son-made-an-android-game-with-no-coding-experience

There have been some challenges – recently I found out that the new ESP32 boards I bought aren’t even fully supported by PlatformIO – but I found a way to work around that.

Ultimately I want MagicPoi to work seamlessly. Add your friends on the web dashboard, create some timelines and push a button on your poi to sync everything up.

Hardware:

The first test board is coming out soon. The design is finished, using EasyEDA. We will be sending the board for production by JLPCB in the very near future – look out for an update.

After that it’s on to the poi body full re-design and finally Indigogo when you will be able to purchase the very first Magic Poi.

You can help!

If you want to be a part of MagicPoi development and the road to the Alpha production line, you can. I have started a Patreon to fund my AI dev tool and services addiction* as well as web hosting costs** – until we have something to sell that is. A few dollars per month from you would really help make this thing go faster. Also, anyone who signs up will get some exclusive discounts on the finished product.

*Go check out Cursor IDE and also the open source Aider they are so worth it.

**I’m spending $25 per month on hosting, $20 per month on AI coding tools and of course my friends over at EnterAction are putting up their own money to do the prototypes.

Feel free to reach out to me and don’t forget to subscribe to the magicpoi mailing list if you haven’t already.

UPDATES:

Sign up for our update alerts:

The deal with PlatformIO and ESP32 Arduino

I recently purchased a new board, the ESP32S3 Super Mini. That’s an S3 dual core version of ESP32 on a tiny yet powerful board.

The problem

The issue was that this board wasn’t working right – I had my code all set up (the new “Alpha” version of Magic Poi firmware – not published) and parts of it ran great for testing in Arduino IDE but as soon as I ported to PlatformIO it wasn’t compiling.

The real problem

It turns out that ESP32 S3 Super Mini and many newer ESP32 boards are simply not supported any more in PlatformIO. In fact, anything that relies on Espressif Arduino framework > version 4 is out of luck – as far as I can tell the owner of PlatformIO had a falling out with Espressif (business? personal? no reason at all?) and now they don’t support the new versions which work great on Arduino by the way (now version 6.something) Here is the issue on Espressif arduino-esp32 github: https://github.com/espressif/arduino-esp32/pull/8606#issuecomment-1805781410 for reference.

PlatformIO has their own version of arduino-esp32 called platform-espressif32. Here is a long discussion about the dropping of support on their github: https://github.com/platformio/platform-espressif32/issues/1225 for reference.

After reading more discussions on the PlatformIO github, Reddit and other places, I finally stumbled on this thread https://github.com/platformio/platform-espressif32/issues/1435 which contained:

The Solution

A very smart and intrepid PlatformIO user, Jason2866 made a fork of the PlatformIO Arduino Espressif base and put it here, with instructions on how to use it – and he updated it on his own to use the latest arduino-esp32. After some light editing and moving stuff around (including accidentally putting GND into +5v and vice versa – thank you Super Mini board for not blowing up) everything is now working. The Magic Poi project moves forward!

SmartPoi File List

Just a quick one to let you know that SmartPoi has a server (running on the lowly ESP8266) which means I can do stuff like this:


The html to do this is now on GitHub here: https://github.com/tomjuggler/SmartPoi-js-utilities – usage is in the README.

Basically it fetches a list of files from the poi and then fetches each compressed binary file in the list, decompresses them and displays the resulting images. Up until now the only way to see what was actually on the poi was to spin them, so this is definitely an improvement. This is all done using the SmartPoi AP – no internet access required!

Any day now* I will be upgrading my poi to work with ESP32 but until then I’m still trying to make the ones I use in my shows better!

*I am aware I have been saying this for a while now 🙂

Upgrading K8 IR RGB Clubs

I love K8. Their reasonably priced LED equipment is the basis for my favourite solo juggling act, the “Electric Glow Juggling Show”. I bought my K8 clubs over 7 years ago, and last month they finally died.

Emergency!

Since the pandemic finished (or at least since we all learned to live with it) I have never been busier. People want to book my shows. Luckily, a friend has some working K8’s I can borrow for now, but long term I need to sort this out. I’m not changing manufacturer so the choice is to either purchase a new set or fix the ones I have. The pandemic also had the effect of limiting my finances for the past two years, so new purchases are on hold for now – so I opened up my K8’s to see what can be done.

Inside the K8 clubs and balls

First impression: these things are well put together. It took me the better part of an hour to get the electronics out without destroying the club in the process. I found the problem: a really fat lithium battery, completely finished.

Then I found something really interesting. The actual circuit is pretty straightforward and is running on a replaceable Attiny chip. So a few years ago I made some code for Arduino which was an attempt to emulate the K8 IR RGB internal workings. With a few adjustments this old code actually works inside of my favourite clubs – it was as simple as matching the alignment and dropping in my own chip. Thank you K8 for not soldering your chips on, and using a header instead!

The plan

First priority is to get the replacement batteries – I ordered these ones on Amazon: the same size as the original but bigger (>2x) capacity. Should be great if they work!

In the meantime I am working on the code, with upgrades such as variable strobe (like Aerotech equipment), and timed record and playback of settings for my show*.

*I understand that K8 have implemented a method of record and playback functionality in their latest equipment, as well as more new settings – if you need LED equipment I highly recommend going there and getting some. Also, their customer service is brilliant. https://k8malabares.com/

Here is a sneak preview of a new setting running on the bare circuit – Red/Blue with variable strobe!

If anyone is interested, the code is up on Github here – most of it is from many years ago and not very good, but I am working on it, need to have everything working without bugs by the time I receive the batteries. After I upgrade I don’t want to have to open the clubs again! When I get everything working I will do an “instructables” style tutorial – even if you aren’t interested in the firmware upgrade, the battery replacement is worth doing to extend the life of this amazing equipment. By the way, one of my K8 balls stopped working ages ago – I just opened it up and the battery is replaceable too!!

Magic Poi 2022 update

Current state of Magic Poi – and some ideas for the future.

First of all, an announcement: Magic Poi is now available for ESP32, as well as ESP8266 architecture. This will bring improvements in performance. I plan on continuing support for both, and in the near future a combined code base will be provided.

I am going to list current features here, and improvements I plan to implement.

On-board images:

  • I have partnered with EnterAction, an awesome Sydney based fabrication company who are taking over the hardware development from now on. Improvements will include an SD card add-on for limitless on-board storage. This will require changes to the code, as currently the maximum is 52 images supported.

UDP streaming:

  • this is a defining feature of Magic Poi. The images are generated off-device, and “streamed” via UDP pixel by pixel. I plan to keep improving this functionality but change it to not be the default mode. Due to WiFi interference the UDP stream is sometimes interrupted, making the LED’s stutter, so work is being done to mitigate that.

“Timeline” – images changing in time to music:

  • currently there is a desktop app to generate the timeline (and associated images) and save as a zip file, which needs to be uploaded to the Android app in order to be “streamed” to the poi. I plan on changing this functionality to rather happen in the poi code, thus avoiding the WiFi interference problem. The timeline editor will be made into a web app, with the option to download directly to the poi.

Station mode:

  • poi connected to a router provides more stable WiFi than the current AP mode. I have made a start on providing a way to use this mode.

Online account:

  • like a PlayStation or Kindle, there is a benefit to having a cloud aspect to any product that consumes media. The Magic Poi website is going to be a place where you can upload and share images and timelines, as well as interact with other poi owners. All uploaded images will be private of course, unless shared. I have made a start on this cloud aspect, with an option in testing to download images directly from your cloud account to the poi. The ultimate goal is to be able to sync any two pairs of poi with two clicks!

Android app:

  • Still not working: text to image (stream words directly to the poi).
  • Once the online portal is finished, this will be added to the app, so shared images and timelines can be viewed without need for a web browser.

The above is a small part of the list – thanks to EnterAction taking over the hardware development side, I will have more time to devote to the software improvements. We also plan on adding a battery level indicator, and a higher power battery for more play time.

Thanks for reading!

Keep an eye on this blog, and sign up to the newsletter (if you haven’t already) for more updates as Magic Poi moves forward towards it’s inevitable crowd funder launch!

UPDATES:

Sign up for our update alerts:

I made an LED indicator for my portfolio site

Job hunting is tough – I’m busy until February 2022 but already feeling anxious about finding the next gig. That’s why I wanted to give myself a bit of an incentive – a visible indicator of success. I decided that whenever someone visits my portfolio site, I wanted an LED to light up. Read on to find out how I did it (using Flask, http requests, and an ESP8266)

Self Hosting

I recently had a bad experience with an online service shutting down on me – had a bit of a rant about it, although in the end it wasn’t too serious – but I am now determined to do self-hosting wherever possible *disclaimer: my current work project is hosted on Google Cloud, and I’m using Firebase and push services for some Android apps also.

The Flask api

The first step was to create a simple Flask api to facilitate tracking of site visits. This is based on this minimal flask api template on GitHub. I used a simple global variable to keep track of website visits because I’m doing this in my spare time and because it works fine – and I love boolean switches. Here is how it works in one simple gif:

Think of the hand as a visitor to my site, and the “switcher offer” is the ESP8266 at my home checking the api (the switch)

HTTP request from resume site

Since I am learning React my portfolio site was a good way to have another look at the framework. I used this single-page React resume site template as a base, adding my own details and an http request to the Flask api endpoint on load.

ESP8266 code

I used the basic http requests example with my own api details, and added in EEPROM code to record the incrementing number of visitors to persistent memory. The ESP8266 module checks once per second with the api whether there has been a new visitor to my site. If there has, the built in LED on my D1 Mini switches on. Although I have mostly moved over to using PlatformIO, for this very simple sketch I used the Arduino IDE.

Deployment

Like I said, this one is self-hosted. I’m using Digital Ocean droplets, which are a fixed cost of 5 dollars per month, for as many sites and services you can cram on there (trust me, it’s a lot). The React site was surprisingly simple to deploy, just build, copy the build folder and point Nginx at it. Flask is a little bit more complicated, compared to how easy it would be on Google Cloud, for example, but a few config files are really not too much to handle.

The result

Whenever someone visits my website, the LED lights up. Simple as that. And I can plug in and check how many visitors I have had. I’m hoping that one of those visitors will like what I do enough to hire me next year!

Visit my site https://devsoft.co.za to light up my visitor tracking LED.

Potential improvements

If I was making this into a product, I would certainly upgrade the Flask API to include a database to keep track of the number of visits, rather than doing this on the ESP8266 EEPROM – which maxes out at 255!* Obviously this could include a web interface for accessing the information, I could log the times… But most of this tracking stuff has been done already – analytics for websites. Perhaps the ESP8266 could pick up some of this information and display it on an LCD screen. A flask service for accessing Google Analytics from Arduino perhaps? Let me know if this is something you are interested in!

Also, proper authentication – if this wasn’t just for myself… JWT, rate limiting, CRUD endpoints and a web interface to change LED behaviour.

And maybe an RGB LED would be nice, then I could add in some of my other websites, in different colours!

*apparently the Arduino EEPROM library works differently on ESP8266 – ignore that part of the code, I need to update it (the counter still increments while the module is plugged in, though)

ESP8266 libraries treasure trove

While looking for a new WiFi manager for my SmartPoi project, I stumbled upon a great resource: https://www.arduinolibraries.info/architectures/esp8266 – a list of Arduino libraries broken down by architecture.

Just having a quick look, I have noticed some great libraries to help improve my ESP8266 based projects (I haven’t had a chance to look at these yet, but looking forward to it!):

some interesting esp8266 libraries:

  1. https://www.arduinolibraries.info/libraries/esp8266-timer-interrupt
    – interrupts for ESP8266! So useful.
  2. https://www.arduinolibraries.info/libraries/esp_eeprom
    – Speed up EEProm and add wear levelling
  3. https://www.arduinolibraries.info/libraries/firebase-esp8266-client
    – Firebase? On ESP8266? Sounds like a challenge!
  4. https://www.arduinolibraries.info/libraries/mini-grafx
    – graphics library, not sure which displays this supports…
  5. https://www.arduinolibraries.info/libraries/process-scheduler
    – process scheduler, is this easy to use though?
  6. https://www.arduinolibraries.info/libraries/restfully
    – hopefully this is better than doing it manually
  7. https://www.arduinolibraries.info/libraries/rich-http-server
    – more http requests wrappers
  8. https://www.arduinolibraries.info/libraries/settings-manager
    – store settings in .json
  9. too many WiFi config libraries to list here, I saw at least 15!

These are only the few I was interested in personally, the site lists 244 libraries for ESP8266. Check it out!

Stripboard Sucks

I have been trying to make my poi easier for anyone to duplicate by eliminating the costly custom circuit board. So I tried to make it on stripboard, which was a disaster. Here is the idea:

And here is how it ends up looking on the stripboard (with tilt switch):

So that looks great and all but in practice, having to cut the stripboard and solder and everything else, there are too many possibilities for shorts and troubleshooting it was turning out to be a nightmare. There are 18 solder points on the board above, not to mention cutting the metal on the stripboard (under the esp-01)

Here is another idea, I am trying to make this simple, the D1 mini costs just $1 more and can run on 5v which is the right voltage for the LED strip anyway. This is the new circuit:

Now we have only 9 points to solder (not including the LED Strip, I didn’t include it above either).

I also re-imagined my poi outer shell, to give access to the usb programming port on the D1 Mini, so this will help with development as well.

Looking forward to putting this all together, and updating my tutorial series (if it all works as planned)

Traffic Light with Button

Fritzing is a great open source project. It turns out that plugging wires into a breadboard is a great way for 5 year olds to develop hand-eye co-ordination, so I have started making some kid-friendly projects for my son.

The first was a traffic light project. This is conveniently located in the Fritzing examples, although you have to go to their website (link) to get the Arduino code. They use an Uno as controller, but I prefer the breadboard-friendly Nano. I didn’t have to make any modifications to this project for it to be fun, apart from using the Nano instead of the Uno in the screenshot, and adding a blue LED with a separate switch, as my son insisted on having his favorite colour represented.

This project offered multiple opportunities for learning. For one, it’s a working traffic light, so we went over the rules with some of his lego characters, look before you cross, press the button and wait, etc. Secondly I left the jumper wires to my son to plug into the board, and tried to explain a bit about DC current as well. We had fun turning the LED’s the wrong way, I just made sure the board wasn’t powered when he was busy plugging things in.

For power I used a power bank, plugged into the nano with USB. The power bank has two outputs, so we can have two projects powered at the same time. There are quite a few projects which are fun for kids, and since my kid loves “helping his dad” it’s going to be something I will be doing a lot in the future. More to come soon.