A sneak preview of the future of online Magic Poi emulation.
The patterns need work, but I’m pretty exited about this development.
The patterns need work, but I’m pretty exited about this development.
The above example creates an infinite succession of 72x72px images – perfect for display on my 72px poi. I adapted the code from this showcase example on the P5js website.
My plan is to add this – and many more – options to the magicpoi website. They will complement the user generated images and be downloadable directly to the internet connected Magic Poi.
PS: Currently, if you want to see what any of the images generated above will look like on the poi, you can right click on the changing image, select “open image in new tab”, download the image and then on the magicpoi profile page (you need to be signed in for this to work – sign up, it’s free!) select upload and drag the image onto the page, or choose it from the file menu. Then you can turn this: into this:
As you can see, the possibilities are endless. I plan on making the P5.js image generation into a plug-in system for Magic Poi.
Currently the Magic Poi site relies on some Processing (Java) code which is called from python – as well as other bash scripts to do certain things. I wanted to make it faster and cleaner by using Python for everything, so I did some test scripts. (Github). Also, the Processing code required a virtual screen buffer to run on the server constantly!
The main functionality involves compressing images into the .bin files which are saved to the poi memory for display. Since there is limited memory, and to save bandwidth, I am using the R3G3B2 algorithm to compress images. The poi only accepts images which are rotated 90 degrees clockwise, so that needs to happen too, as well as dynamically re-sizing any images which are wider than the 72px available.
I am still conflicted about whether to keep the Android app as the control for the poi, or to do something else, but making everything available as an api on the server keeps it flexible for now. The RotateImageVisualPoiStyle api can be accessed right now. Upload your image, and see what it will look like on the poi!
# change the /path/to/image.jpg to your own image file name
curl --location --request POST 'http://magicpoi.circusscientist.com/api/rotate_visual_poi_style' --form 'file=@"/path/to/image.jpg"' --form 'fixed_width="72"' --output 'rotated_image.jpg'
The factory where MagicPoi were being developed had a fire last month! All of the prototype poi melted, so all I have left is my breadboard version. This is going to cause some delays..
curl http://magicpoi.circusscientist.com/api/get-filenames
Feedback is always welcome.
My K8 Prophecy clubs have reached the end of their tether. After 8 years of use! First of all, many thanks to K8Malabares for their excellent equipment. Most smartphones won’t last that long (except for my Samsung Galaxy S2, which still works). If you need juggling equipment you can’t go wrong with K8. I have some of their non-LED equipment as well and it’s just as good.
About six years ago I did an experiment – to see if I could emulate the K8 IR code on an Attiny85 chip. I knew they used that chip, or possibly the Attiny45, because one of my clubs was faulty and I opened it up to have a look – K8 sent a replacement, by the way, talk about great customer service!
Now that my balls and clubs are not working anymore, due to the battery reaching end of life, it’s the perfect time to test out my new code. Luckily K8 didn’t solder their chips, instead opting for a convenient chip socket for easy replacement! I made some updates to the code, adding new functionality and colours. (K8 have also done an update since I bought my equipment) The most important, for me, was adding a timeline record and playback. This means that I can record the timed colour changes for my entire show into the chip via IR remote, and play it back (in time with the music) by pressing a single button. This is similar to how Aerotech Ultimates used to work.
You can check out the code for Attiny85 here.
The batteries were the main thing. K8 use lithium batteries with 250mah power. I found some batteries online with a capacity of 600mah which I thought I could make fit (see below for details – not quite, but I made it work). I also bought a cool new charger for the new batteries.
For anyone who wants to try and do this, I am posting some tips and photo’s.
Pull off the tape from the center, then pull out the staples:
Take off the knob and top bumper:
Pull off the plastic around the handle, then unscrew the plastic spacer (needs an allen key)
The next part is really sensitive – make holes in the top of the bulb cover to let the inside pipe come out. Get it out by pushing from the bottom – I also shoved a dowel inside and pushed upwards. If you use too much force this plastic pipe could bend, so be careful.
Now pull out some more screws holding the thicker top piece of the inside pipe on, and pull the spacer out to let the electronics out.
The bottom thin pipe should come off easily, leaving the bare circuit board.
Now cut off the insulating cover, exposing the battery. See how fat it is!
Pull the battery away from the board (carefully) and cut the two wires as close as possible to the battery – we need those!
The new battery ready for placement. Also, my newly programmed chip in place (old one from K8 labelled C2.
Now comes the hard part. Making space for the new battery. I had to cut into the larger diameter tube on both sides so that this could fit. I actually bought a Dremel to do this job.
Now put the circuit back into the top pipe, and find the battery wires. Then solder the battery on – finishing with insulation. The battery should fit with only a little bit sticking out on both sides of the pipe.
I used clear tape to stick the battery in – it was already pretty snug as the holes were just right.
Just like taking it apart, only in reverse (and much easier)
Put the longer circuit cover tube back in and line up the holes (with the spacer), then put the screws back in. This works fine with just pliers, just twist left and right for these, while pushing in firmly:
Now the inside tube goes back into the top of the bulb – it just snaps in easily (how hard was that to take out, though, whoah!)
After putting the top bumper back, the middle spacer goes on. I forgot to mention, that doesn’t come off without removing a plastic screw cover (yellow, bottom of thin tube) so keep that in mind if you haven’t taken this apart yet.
Finally it’s time for the wrapped plastic handle – I didn’t put the staples back, you are welcome to try and do that..
Add some tape to keep everything together, screw on the knob and your club is “as-new” again.
Just a quick tip, I noticed that there is a bit of wear where the circuit goes from thin to thick (you will see what I mean – the long bit with all of the LED’s. Some of my clubs had non-working colours due to this, and I had to bridge the gaps with wires.
Let me know if you have K8 clubs and are interested in upgrading yours, I am happy to answer any questions.
Magic Poi, with the firmware written in Platform.io and the web interface in Flask is the future. Currently I don’t have a working set*, though, and due to upcoming shows I needed to make some changes to the existing Smart Poi.
*Due to other commitments, the company who are doing the hardware design for me have put the build on hold for now.
I have resisted using LiPO batteries for my projects up until now, but since I was already getting some for my K8 equipment upgrade I bought some 1000MAH LiPO batteries for the 32px poi. The voltage regulator I have in the circuit (LM117) is not optimal for these, I believe that it is not using the batteries full capacity – but it does work!
At the time I wrote much of the Android app which pairs with Smart Poi (in 2017!), I was set on having all of the patterns stream from the smartphone to the poi over WiFi. In the real world unfortunately I found that due to WiFi interference this was not possible at most venues, where the 2.4GHZ spectrum is saturated and the stream stutters. So I made a way to upload and display patterns directly from the ESP8266 flash. Initially this was done with UDP as the streaming was taking place, then I moved over to http post. The latest update to the app disables UDP while the post is being sent, so uploads are really fast. I hope to refine this and port to the 72px version as well in the near future. You can get the apk for the latest version (so far only tested on Android 10) here – any future updates will be made to the same file. *Please note that the text message option still crashes, I am looking at this as a matter of urgency! Also, on first run the app sets up some example images and may need a restart (possibly even a phone reboot) to work correctly.
I am working on a ‘lite’ single colour version of “Magic Poi”. The plan is to eventually replace all of my juggling equipment with internet enabled equipment which can sync using a web interface, like “Magic Poi”. The first test page is up here: http://magicpoi.circusscientist.com/lite and includes a colour change function and a really cool “Automatic Poi Simulator” visualisation which was kindly shared with me by Danny Thomas from kaien.com. Eventually this page will have a timeline (to music) function, and ability to download to the equipment. The firmware will also include offline capability, which will disable the WiFi to save power during operation.
Many thanks to all those who continue to support this project. Smart Poi continue be a part of my performance every week. I’m inspired by the thought of enabling more people to make reasonably priced POV poi and other LED equipment which can do as much as, or more than the commercial versions.
As always, if you haven’t already, head on over to the Smart Poi Overview page and sign up to the newsletter for occasional progress updates. Feedback is welcome.
PS: did you know that every time someone visits my website, an LED flashes on my desk? I made an online service and open source firmware for the D1 mini which means that almost anyone with a website can have the same functionality. Check out https://www.circusscientist.com/led-website-indicator/ if you are interested!
Several years ago I read an amazing scientific paper on the mathematics of Poi patterns, by DrexFactor – you can have a look at the web version here.
So recently I was thinking about it again and managed to plug some of the formulas into a Processing sketch:
I have always enjoyed emulation software for juggling, it’s amazing what you can do – juggle 100 flaming swords for example (or make an LED juggling emulator, like this one I made) Anyway, it turns out that there isn’t anything similar for poi spinning.*
Seems like there should be one.
*UPDATE: turns out there are quite a few. Thanks Reddit! Here is one of my favourites, done in Processing: http://www.kaiein.com/poi_auto_sim/
**UPDATE 2: Danny Thomas from kaien.com kindly let me use the code for my own emulator – I’m using this as the base for a new single colour version of “Magic Poi”, “Magic Poi Basic”. See the demo here: http://magicpoi.circusscientist.com/basic
K8 are my favourite type of LED juggling equipment. Recently I updated my virtual juggling web app to include a working remote control – just like the real thing.
So the app consists of an animated juggler, a remote control and “Change your pattern” button.
While the juggler is juggling, you can press buttons on the remote to change the juggling ball colours (accurately emulating the actual K8 equipment settings)
The “Change your pattern” menu is a large list of different juggling patterns, which when selected will change the animation displayed.
The back end is based on Flask. I am using the beautiful soup library to fetch the menu of juggling patterns from the awesome library of juggling website. Once selected, the gif of the pattern is fetched. It is then processed (a script inverts the colours and makes the juggling balls transparent) – if that hasn’t already been done for the particular pattern.
The juggling animation and remote control are written with P5.js. The juggling ball colours are implemented as a background which shows through the transparent balls. The button co-ordinates are relative, so work on any size screen (looks best on Desktop)
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.
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.
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:
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)
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 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)
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.
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.
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.
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.
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)