The Problem of Timelines

Problem

Definition: A clear, concise statement describing the issue to be addressed, including its scope, context, and constraints. It serves as the foundation for analysis, solution design, or decision-making.

So when I say “Problem” that’s what I mean: an issue to be addressed – the clearer the context the simpler it is to come up with a solution.

By the way, Magic Poi and SmartPoi (open source) have a Patreon Support channel . If you would like to keep track of progress – and optionally contribute (mostly to AI Coding Assistant and Server bills) please join up – you can join for free and get updates about the project, paid members get a discount when we start selling the actual project.

The Problem

TLDR: I am working on the best ways to create, save, fetch and display timed sequences of images for Magic Poi. It’s tricky but I am getting there!

Timelines and Sequences – in terms of Magic Poi:

Timeline: a sequence of images each with an attached time to be displayed. The times start at zero.

Sequence: just the sequence, timed at a regular interval.

So in terms of software, we have a User Interface running JavaScript, connected to a back end running on Python (Flask). The back end database is PostreSQL which actually contains all of the arrays of images and metadata (including ownership and relationships – eg Tom owns x.jpg and shared it with Dylan).

The Poi running C++ needs to connect to the Python server API using http requests (authenticated using JWT, so you don’t get someone else’s images!)

Currently how the flow works is:

  1. User creates timeline and saves – this adds the image ID’s in an array (each image has a number), like [1, 4, 67, 55] and the timeline times in an array (in milliseconds), like [0, 257, 1029, 40005].
  2. The back end saves the timeline image ID’s and times along with metadata (Timeline name, owner, shared with..)
  3. Now the hard part, poi fetch the timeline – after selecting “timeline” using buttons (I have created a nice menu system with 2 buttons – LED colours give indication of position in the menu, long press first button for menu, short press first button to select main menu position, short press second button to select sub-menu)

– this is where the hard part comes in. First of all, we need to know how many timelines the user has, so we need to fetch that in order to proceed. Then the sub-menu needs to have exactly that number of options to choose from. But what if we are not connected to WiFi? I have to have fallback options for every error, including Server errors (maybe the data center went down for maintenance, or I borked something in the Cloud..)

Eventually you get to the point of downloading the images (using the timeline image ID array) and then displaying after all the downloading is done in exact millisecond time, according to the timeline times array.

Also, I want the option to have the images display as a regular sequence (using another button menu option) rather than to exact timing – like the original SmartPoi did it. This is rather simpler to achieve thankfully but we still need to incorporate a new time variable which can be changed on the web interface or using buttons (or the offline on-board web interface, yes there is another one also)

Conclusion

So in case you are still following this – the timeline object is created in JavaScript, stored and served by Postgres DB and Python, and consumed by both JavaScript (web page loading) and C++ (Magic Poi download and display)

Status

Right now I have Magic Poi nested menu system which I am quite pleased with. We just finished testing on the new prototype board and everything works! In terms of software I can download and display one timeline in exact millisecond timing – or select a specific image from that timeline to display individually.

Todo

Still todo is the selection of which timeline – and also adding shared timelines to the list (the ones your friends shared with you using the easy to use right click web menu interface). And optional sequence mode, choose to display image each for 0.5 – 3600 seconds at a time before moving to the next.

Also I still need to add in the Flash storage space checks from SmartPoi (make sure we have enough space for the image files before downloading them!)

Maybe

I might even be able to squeeze in multiple timelines at once on the poi? This would require a way to check the Flash size restraints on the poi from the Server side, to enable calculations of size (some timelines might share images, so we don’t have to download multiple copies, sharing image files between timelines…) Right now I’m not worried about this though!

Also: Streaming! I already did this as a fun test but it requires the poi to be connected to WiFi the whole time. With two cores on S3 chip, one takes care of the downloading of images, the other displays. When an image completes downloading, it is immediately passed over to the other core with some cool memory swap code and displayed – while the next image starts downloading. This opens up many possibilities, and bypasses the restraints inherent in ESP32 Flash memory storage size (no I am not adding an SD card for downloads)

Conclusion

Wow that is a lot of words. Sometimes it is just good to outline the Problem in order to focus and get to the solution – which for me will be fast, efficient and reasonably priced Magic Poi, with versatile Timelines!

Rookie mistake – forgot to pin library versions!

In PlatformIO there is the platformio.ini – a really powerful tool to select versions of libraries from PlatformIO servers, and initialise settings for the whole project.
I recently had a problem where a friend was not able to compile my SmartPoi project – but it worked for me??

Long story short

I re-cloned the project myself (starting clean) and managed to reproduce the same problem my friend was having while compiling. After a lot of head scratching I realised – the libraries in my project were declared like so:

mathieucarbou/ESPAsyncWebServer @ ^3.1.5

However that just tells the compiler to fetch the LATEST version as long as it is above (^) 3.1.5 – and that particular library had a breaking change update. The reason I didn’t have a problem on my local version was because my compiler was just using the cached local version (not bothering to update every time, you can force this by doing “Full Clean” which I don’t tend to do)

Conclusion

Make sure to pin your versions, especially in code you want to share!

My new platformio.ini now has lib_deps that look like this:

ESP32Async/ESPAsyncWebServer @ 3.7.4

Go and get the latest ESP32 SmartPoi now

git clone https://github.com/tomjuggler/SmartPoi-Firmware

cd SmartPoi-Firmware

git checkout -b ElegantOTA_CombinedS3C3_PlatformIO origin/ElegantOTA_CombinedS3C3_PlatformIO  

SmartPoi Controls Android App updated

Android App now available for download!

I finally managed to get this working on *most* of my devices.

When it works, it’s great – upload from your phone/tablet, control with indication of connection, sliders for brighness and more! See previous blog post for details of how this all looks (it’s the same on Android, except for drag-and-drop uploading which is not possible)

DISCLAIMER: Android is a vast collection of different versions and capability devices. I used to do Android apps in the Play Store and gave up, because things break a lot. This app is just a web app inside a container and won’t do anything to your phone but it might not work – especially the uploading part.

Links: Android 12+ devices: https://circusscientist.com/SmartPoiControl_Apr_25.apk

Android 7-10 devices: https://circusscientist.com/SmartPoiControl_Apr_25_Older_Android.a
pk

Android 11 phone: Try both? Neither version works on my Android 11 phone. Actually not sure about Android 8/9/10 either. I tested on Android 7, 11 and 12 only.

And yes, I am aware that I am living in the future (named the app Apr 25 in March).

Thanks to my Patreon supporters!

More people are joining up – it’s free! You don’t have to pay to support me on Patreon, but my paid supporters are helping out a lot, particularly with my AI coding assistant bill. Without AI coding assistance this app wouldn’t be possible, and without my supporters there wouldn’t be money for the api’s.

Patreon supporters (free and paid) get the latest news first! https://www.patreon.com/c/CircusScientist

SmartPoi JS Utilities Update Demo

I just uploaded a full walkthrough of the updates to YouTube. Some functionality is not obvious, but the uploads are faster, and connection is more reliable. Overall I am quite proud of this version.

Next up: port the improvements over to the Android App.

To support my ongoing work on the SmartPoi and Magic Poi projects (and to help me save up for a new Microphone!) please consider contributing to my patreon. https://www.patreon.com/c/CircusScientist.

Shout out to Flávio from my Patreon, this one is for you!

Special Notice:

In the next month or so all of my paid subscribers over on Patreon are going to receive a surprise. I have something that nobody has done before (I checked) but I’m keeping it for them, so now is a good time if you like poi and making stuff, go ahead and join up.

Moving On

TLDR:

Some old Circus Scientist services have to go, in order to move forward with new projects. This is due to Ubuntu Server upgrade (not intentional)

Outline:

There are two ways to look at things in software:

  1. Keep things compatible and working no matter what. I think of this as the “hoarder” mentality (think Microsoft)
  2. Move fast and break things (aka Google)


I guess I try to keep a happy medium, leaning towards the “hoarder” side. Right now though, something is going on that I don’t have any power to change. The Ubuntu Server version 20 which I have most of my “experimental” services on is going EOL in a few months.
I don’t have a choice – I need to upgrade all of my online projects. Sometimes this is as simple as upgrading Ubuntu in-place but due to Python version updates this time it’s impossible. Each service has to be updated and put on a new version of the server – I’m using the latest LTS version, Ubuntu Server 2024.

What is going away

  1. LED Website Indicator. I really love this project, my first fully integrated Web and IOT project. Basically nobody cared except me. I’m going to open source the Arduino code at some point, some parts are already are available on GitHub.
  2. MagicPoi old website. There is already a new version with most of the same functionality (my patreon subscribers have had access to this for a while). This was my first really large Flask website with an api accessible from ESP8266 and is a bit old and insecure now. I have a backup if anyone has data from there that they need to get back, just send me an email and I will sort you out.
  3. AI Site Generation. A fun project that was just for learning purposes really.
  4. Monkey Detector (web version with api). Another learning project, not being used.
  5. K8 Juggling. Very old fun service.
  6. Invisible Deck Practiser. Just a JavaScript version of an Android app (magic).
  7. Other personal sites not related to this blog.

Temporary disruptions

Several other services need to be migrated, this may take up to a week depending on the complexity. Expect disruptions.

  • SmartPoi Downloader
  • The new alpha version of magicpoi site (with api)
  • devsoft.co.za
  • show.circusscientist.com
  • Other personal sites not related to this blog.

Conclusion

Sometimes you have to break things in order to move forward.

Everything that is moving to the new server is going to have proper Python virtual environments with up-to-date libraries. More secure, faster, future proof.

A Cyber War is preventing me from working on Magic Poi?

News article here: https://www.theregister.com/2025/01/27/deepseek_suspends_new_registrations_amid/

Two possibilities:

  1. Deepseek is lying and they just oversubscribed (you might have noticed they went viral with the excellent R1 open source model I have been using for the past week already on SmartPoi, Magic Poi and more)
  2. Someone is DDOSSING the heck out of them because they are jealous. Is it the US govt? OpenAI? Random hackers?

Annoying

Whatever the reason (and I really want to know so I can know who to be angry at!) it is affecting my work.

Thank you so much to my Patreon supporters for their contributions, the money is already in the Deepseek API account so I’m just waiting for access to be restored(!) before I can continue.

I did get some stuff done.

Did I mention that SmartPoi is now (almost) ported to the ESP32? The only thing that is not working is the LittleFS uploading, and that is really an Arduino IDE problem – I am trying to find a work-around but currently you can use it (just fire up the SmartPoi-js-utililities and upload some images). Check out the ESP32_2025 branch – but maybe wait a month (end of Feb?) by which time it will hopefully be merged into main (the whole thing is now working on ESP32/8266 with the same code base!!). Recommended: ESP32 S3 Super Mini (available on Aliexpress). This is the actual chip that Magic Poi will run on! Don’t get it confused with the ESP32 C3 Super Mini though – that one is single core only (and half the price – I have some C3 here and SmartPoi works on there too.)

For this new ESP32 branch I have even re-enabled the UDP streaming (which you can try using the old SmartPoi Android app). The new Android app for uploading and switching pics works as well. I haven’t tested UDP yet but if you use a dual core ESP32 S3 the WiFi runs on a separate core to the display code, which means it might actaully work now (I disabled it due to stuttering images).

This is hard work

Once again I appeal for support! Please help me by joining Patreon (it doesn’t cost anything to join) and subscribe to a support option if you can.

Support me on Patreon.

I just got here, what is SmartPoi, Magic Poi and DeepSeek?

SmartPoi project – WiFi connected POV Poi

Magic Poi – Internet connected upgrade to SmartPoi (work in progress)

DeepSeek AI – Right now the world’s second most powerful large language model when it comes to coding. I use this extensively to develop open source apps faster. Cheaper than ChatGPT but not free – hence the Patreon 😉

UPDATES:

Sign up for our update alerts:

Magic Poi 2025

Well 2024 was a good year, I feel like I got a lot done – mainly with finalising the SmartPoi project enough to be usable for December (it worked, yay!).

What is coming this year?

TLDR: doing the same thing as last year only better, faster – I just got distracted by some monkeys this month.

Right now we have one prototype with a lot of issues to address. The factory gave us the wrong buttons for example and one trace wasn’t connecting for some reason… Anyway I disabled the buttons (there is a web interface after all) and so we have something to test on while getting the next circuit ready.

So yeah I think for me it’s about getting the poi working seamlessly, and improving the user interface – I thought the buttons were going to be enough but after looking at all of the options (Multiple Timelines, Sequences, sync with friends, brightness etc) I was clearly being a bit optimistic. I recently saw someone came out with POV poi that has a screen on it (!) – is this what we need? Sounds like a battery hog to me so probably not but anyway I am looking into it.

With the web interface we still need timeline sharing, so that has to be first priority (it is directly related to the poi buttons, though – my plan was to sync with a button press originally). Also more ways to share images and maybe rate them or something.. I am rambling here but you can see there is a lot to look at.

A bit of a delay..

I have been a bit distracted so far this year, not just with the circus tricks – I got hired by a university to help with some research related to Monkey Detection (another speciality of the Circus Scientist). Never thought I would get paid to do this, but apparently South Africa is not the only country that has issues with monkeys conflicting with humans in urban environments. So I am currently working on a Machine Learning (Image Recognition) app for research purposes.

I also have a bit of a deadline this year, as my main “experimental” server running Ubuntu 20.04 is going to become obsolete in July and I need to transfer everything off of there onto a new one well before then. I know you can upgrade in place but some of the stuff relies on old libraries etc so requires a re-write anyway (or just to be thrown away) so I’m taking each deployed project and transfering to a new server. The new Alpha version of Monkey Detector is already on a newer version of Ubuntu Server thankfully.

So yeah

Give me a month (February is traditionally very slow for live entertainment here) and I expect to be posting more frequent updates to the Magic Poi project. Looking forward to getting version 0.2 out and moving closer to the Product Launch

PS:

I really plan on getting an actual product out by the end of the year, even if it is just a kit version. Please quote me on that, this thing has gone on long enough. I am ready, are you??

Using the SmartPoi WebApp

Hello fellow SmartPoi users.

As you may know I am a professional circus performer and during the holidays I get very busy with shows. Just pointing this out in case you wonder why you don’t see any development on the project in December and January (January is holiday time for me after much hard work).

I made a quick video demonstrating the Desktop WebApp to upload images – see it here:

I might do another showing the Android app at some point, although it’s basically the same JavaScript in a web container.

And finally here is a happy holidays present – lots of 100px poi images I scraped from the Visual Poi site http://circusscientist.com/Pics_100px_5000.zip– all credits to their respective authors, originals are from https://visualpoi.zone/

Enjoy! And see you next year for the continuation of improving SmartPoi and building Magic Poi for affordable DIY POV spinning.

Best wishes

Tom