Smart Poi

Connect your poi to your phone – instead of connecting the phone to the poi

SmartPoi default setting

Smartpoi by default has main poi with access point enabled. When you want to control the poi you have to connect to it the same way you would connect to a your WiFi Router.

Downsides:

  • Main poi have low power for signal (we have to compete with other WiFi signals, and this actually fails in environments with a lot of WiFi routers around)
  • Main poi are doing a lot of work now – apart from displaying images they have to route signals to Auxillary poi also.
  • No internet – when you connect to the poi from your phone/computer you don’t have access to internet on your phone/computer while connected.

    Upsides?
  • Simple to implement (static IP addresses for both poi, router ip same as main poi..)
  • Full control (no problems with Router blocking WiFi traffic – this does happen!)

Alternatives

Router Mode is fully stable on the D1 mini version of SmartPoi now. You input your router SSID and Password, check the “Router Mode” box and the next time your poi re-start, you are connected.

Difficulties:

  • We need to find the poi IP addresses to upload images and send signals.
  • For discovery we need the Router IP address – usually this is easy to find, though, in WiFi settings of PC or Mobile
  • For JavaScript control interface we have (very technical) security settings that make it more difficult to send signals to IP addresses on your own network from the browser (to stop hackers). The poi have already got code to work around this limitation, though (CORS).
  • You need TWO external devices – a phone for web controls and a Router (usually router needs to be plugged in..)

    Advantages:
  • Better signal (Routers are built for this)
  • Internet!

A middle ground (the point of the article)

The third way is to CONNECT YOUR POI TO YOUR PHONE HOTPOT.

This DOES WORK. However there are some issues I was not aware of until I tried it.

  1. The biggest problem: for some reason it is VERY DIFFICULT on Android to get the HotSpot Gateway IP address (like we got the Router IP address before).
    How do we do this then? Well on the Android command line we can type in:
ip route | grep default

That’s it. Simple right? Only Android does not come with a terminal by default, so it requires the poi spinner to install another app, or set up developer mode.

The other way is to connect to your HotSpot with a PC – and look at the WiFi settings. Then we get the Gateway IP address (mine is 10.211.201.45 – so random!)
So far that’s all I got – not ideal. The good news is your HotSpot Gateway IP does not change (I have read that on some devices it might, though). So once you have it you can:

CONNECT TO HOTSPOT

  • Router Mode on poi – type in the hotspot SSID and Password
  • put in the IP address of the Gateway
  • click on Discover Poi
  • Done!



Now you have a much better connection which is stronger than AP mode, and you still have internet on the poi!

Online Hackathon was a bust

I did learn about Kafka though – apparently the company putting on the hackathon is very interested in using this distributed event streaming platform which is so massive it needs 8GB of RAM just to load up. Not something I can just load up on a VPS then unfortunately – I also learned about RedPanda, the Kafka replacement which was written in C++ instead of Java – which I might want to look at in future.
For now Mosquitto MQTT which I already use has a persistent memory option which is far less heavy on resources than either of these and might actually cover the same use case for smaller projects (in combination with a database)..

Anyway what turned me off of the hackathon was:

  1. The requirement to not use AI assisted coding – this is the future of coding and I don’t do programming without my Aider coding assistant. I wouldn’t do coding without code completion, linter, documentation, testing, and versioning either.
  2. The problems were basic
    – Sort letters in a string (!). If I wanted to do that I would go onto leetcode or somewhere and get my fill of algorithm fiddling, or write one prompt in Aider and get the answer instantly (or just search StackOverflow). What a waste of time, is this really going to find out how good you are at actual programming?*
    – Basic Kafka event pipeline, type the code into a bash prompt – I kid you not, type the Python code into a bash prompt. What about indenting? How does this even..**
    – another algorithm challenge, tldr (I already already left at this point).

I feel sorry for any corporate wannabee programmers who have to deal with this type of thing to get considered. I am also sad that I didn’t have a chance to show my actual skills (not memorising syntax/algorithms) to compete to earn the prize.

Moving on..

*OK I looked up the actual use of “k unique characters” algorithm and it’s legit useful, but I am definitely not looking for a research position, just use the current state-of-the-art algo and move onto dealing with the data?
**I’m guessing this is to try and stop AI input?

Cutting GitHub out of the loop

The recent curtailing of the popular BitBucket repository service* made me re-think my method of code deployment. Instead of using GitHub Actions or other proprietary service as my sole method of pushing code to my own server, I am cutting GitHub out of the loop and going direct.

*Bitbucket used to have no storage limit – now it’s 1GB for the free version. I had 14GB already on there!! GitHub will do this too at some point, no doubt..

SSH to the rescue

It turns out that pushing directly to your own VPS via ssh is not only supported by git, it is easy, fast and effective. I made my server re-load the web based code automatically (for me Flask) whenever I push. Here are the commands.

1. Set up bare git repository on VPS

mkdir -p /srv/git/myproject.git
cd /srv/git/myproject.git
git init --bare

2. Set up automatic update

create hooks/post-receive:

#!/bin/bash
GIT_WORK_TREE=/var/www/myproject git checkout -f main

make hooks/post-receive executable:

chmod +x /srv/git/myproject.git/hooks/post-receive

3. Add server as a remote

on your local machine:

git remote add server username@your-server-ip:/srv/git/myproject.git

(origin is still set to github, for backup)

4. Push code

git push server main

That’s it! Simple

Now I push main to the server and it deploys. There is much more to look at – the hooks are pretty powerful, you can do a bunch of stuff like update database, re-start web service and more whenever post is received.

Note: Permissions

/srv/git I gave user ownership of:

sudo chown -R username:username /srv/git

Bonus: restarting services with sudo

Allow your command to run as root in the /etc/sudoers file:

visudo
# add a line to the file
username ALL=(ALL) NOPASSWD: /usr/sbin/service myproject restart

Add restart command to hooks/post-receive file:

#!/bin/bash
GIT_WORK_TREE=/var/www/myproject git checkout -f main
echo "Restarting myproject service"
/usr/bin/sudo /usr/sbin/service myproject restart

Now when you push to server the service will automatically restart (and you get a message in the terminal).

It’s time to talk about PRICE

Hey Magic Poi fans.

Brett from EnterAction just ordered enough S3 dev boards to build all of our remaining poi!

Also, we had a meeting – regarding pricing. The “back of the envelope” calculation brings the introductory retail price to US $570 (estimate, subject to change) – that’s for a pair of 120px poi with charger.

The discounted price for PAID Patreon Subscribers will be approximately US $450. That’s an estimate, we have not made them all yet and there could be pricing changes, but I am mentioning the rough estimate now because I have to ask: are you going to buy a pair?

Right now not everything is ready, but next week I am putting the magicpoi.com site up LIVE for anyone to see. Poi #1 is done, we are testing the battery, controls, charging, and especially the durability (it all looks great so far, more details soon). Poi #2 or 3 is going to be flown over from Australia to South Africa in the next couple of months, at which point I will be tightening up the firmware, so I can use them in my shows of course. Poi #4 is then going to be FOR SALE. We are making a WEB STORE to sell them to the public – but the people who have been following along with development come first. That means YOU. We have 7 extra pairs of poi to make in this first “Alpha” batch.

This is not KickStarter by the way – I am not asking for money for something we didn’t make yet. WE ARE BUILDING THE POI RIGHT NOW.

So who wants a pair of Magic Poi? Is US $570 (plus postage) too much to pay? Are you waiting until we have the upgrade with 200px and live DJ sync? Should we try to cut costs by shaving a few pixels? Or are you just happy with building your own “SmartPoi” for now? Let me know! email tom at circusscientist.com or tom at devsoft.co.za

Smart vs Magic Poi – current situation explained

There seems to be a bit of confusion about the current status and difference between the SmartPoi and Magic Poi projects – so I thought I would break it down here.

SmartPoi

  • a 10 year+ old project of mine – originally conceived of as trying to make a cheaper version of “Pixel Poi” by “Feeding the Fish*”. At the time they were extremely expensive to buy. See “history of SmartPoi” page.
  • The latest STABLE version is the one I own – using a D1 mini and WS2812 LED strip (I also successfully used D1 Mini with APA102 strip) which is the one in the tutorial on my website. Programmed via Arduino IDE.
  • There is an older version for ESP-01 and APA102 strip – not supported anymore, even Espressif don’t support the ESP-01 anymore!
  • There is a newer version, using PlatformIO and ESP32 which I haven’t had a chance to fully test yet (except on a breadboard) – mentioned here. It is on a branch of the firmware GitHub – all of the control software for the D1 mini version works with this also.
  • SmartPoi is basically finished – apart from updating the ESP32 version for stability.
  • SmartPoi project has made me extremely happy, I lost count of how many people used my ideas to make their own poi – some sharing ideas back which helped me improve my design..
  • If you live in Brasil you can actually buy a commercial version of SmartPoi, really well made (better than mine!) – as well as the most amazing LED Hula Hoops. Send them a message, hook it up!

*I actually met those guys in Brighton once – nice friendly, super talented people. I still hated them though – with envy of course.

Magic Poi

  • New project built from scratch using all of the experience and ideas I got while building the SmartPoi project
  • Difference is that Magic Poi has an Online Server where you can upload and store your images – as well as share with friends via a website (account sign-up required).
  • Also, Magic Poi is built from the ground up using software best practises. Using PlatformIO and FreeRTOS on the dual core S3 version of ESP32, which allows for parallel processing – for example we can load images without interrupting the image display (keep spinning while more images get loaded in the background).
  • Supports Timelines (timed image changes – switch images to music)
  • Supports single image display (one image at a time)
  • Has physical buttons to control poi. One click to download the Timeline you created (or one which was shared with you). One click to sync and start Timeline display. Button “menu” to choose images, multiple options.
  • Also has a battery monitor built-in.
  • Sync arbitrary number of poi via internet connection. Theoretically 100’s of poi can be controlled together in different locations across the globe.
  • Most features from SmartPoi to be added as well (including Offline use, web app controls)
  • Lots more features being added all the time.
  • NOT currently available to the public!

We plan to sell Magic Poi

  • Magic Poi is busy being developed by me (Tom Hastings) in partnership with my oldest friends who currently happen to have their own factory where they build a ton of cool stuff already – including electronics. I chose to go with EnterAction because I know and trust them fully and they have a track record of delivering quality products (and they are also poi spinners of course)
  • We are currently on the third iteration of the circuit board for Magic Poi. This could very well be the final one – but if it isn’t we will be fixing it and ordering the fourth, and so on until it is 100% – see the proposed timeline here
  • SmartPoi ESP32 version is fully compatible with Magic Poi hardware, by the way, and comes with OTA uploading, so if you tried SmartPoi and like it, you will be able to run the exact same Open Source code on Magic Poi – and upload without even plugging into USB. (of course I hope you will like the new Magic Poi firmware better)

The Patreon – why?

I set up a Patreon mainly because a few of you lovely people mentioned that you wanted to have a way to support me financially in developing the software. Up until a few months ago the only income I derived from my SmartPoi and other projects was affiliate links – full disclosure, I made R800 over 4 years. That is apart from the direct benefit of having and using my own SmartPoi in my shows.

Since the costs were increasing as we got closer to actual product launch I set up the Patreon. Right now there are 6 paid members who kindly give me money every month. It almost covers the full cost of 1. Server hosting and 2. (the big one) DeepSeek credits for AI assisted development. Development speed has increased exponentially since I started using Aider and improving my AI enhanced development skills.

Until we start selling Magic Poi I will keep diligently sharing updates and exclusive access to my Patreon supporters.

Any day now

  • Magic Poi will go on sale
  • I hope you will buy a set – the first “Alpha” version will be as cheap as we can make it I promise. Especially for Patreon paid subscribers, you guys helped me and I plan on waiving the cost for services such as server costs and development to give you guys a decent discount at launch.
  • Magic Poi firmware will be available to owners of the poi upon purchase. I am a firm believer in Open Source, you will have access to modify the code running on your own equipment if you want.
  • Magic Poi online account subscription will be included in the price of purchase. Poi will 100% work without any online subscription or internet connection.
  • I hope to get to a point where we sell enough poi to pay for my development time and of course the AI and Server costs, so I won’t need Patreon anymore to break even.
  • We have a long list of products we want to develop – all in the Poi/Juggling/Flow arts space. Magic Poi is just the first*.
  • If you haven’t already, join me on Patreon (until launch day at least). It costs nothing to join and you get the updates first (plus some exclusive content and discount if you pay the minimum $3 per month or more)

*I am very proud of my upgraded version of K8 IR controlled commercial juggling equipment – made my own version of the firmware and have some ideas to improve this for single colour poi, juggling balls in the future..

Magic Poi Product Launch Timeline

We are really getting there this time. Let’s review what we have done so far with Magic Poi and then I will try to make some guesses about when the actual launch will happen!

What is done?

  • test board 1 (some issues)
  • test board 2 (some issues, better than #1)
  • battery monitor upgrade
  • LED strip upgrade
  • parts design and 3d modeling for outer shell
  • battery charger prototyping and testing
  • test board 3 design (ready for order)

Still todo:

  • order test board #3 (this week!)
  • 1-2 weeks until delivery
  • put everything together
  • put the charger together
  • test everything (spin actual poi!)
  • build 3 complete pairs of poi for the 3 founders (Tom, Brett and Dylan)
  • build the code out from “development” version to “full spec”
  • test code
  • finalise design
  • offer “Alpha” boards and full “Magic Poi Alpha” poi for sale to early adopters (target Circus Scientist followers, Patreon supporters get a discount!)
  • refine firmware and server code with feedback from early adopters
  • set up Indigogo campaign
  • marketing and advertising
  • mass production

ETA?

As you can see, we still have a lot to do! A lot hinges on this latest circuit – if it is sound then the rest will not take long. The code doesn’t even need to be finished for us to sell Magic Poi – the old SmartPoi firmware is stable, and works on the new hardware just fine. And you can update to full Magic Poi firmware at any time (OTA update is built in).

Dylan from EnterAction is a qualified plastics engineer, so I have complete confidence that end result is going to be aesthetically very pleasing to look at and use.

Keep following for more updates! A few more months to go?! Now is a good time to sign up on my Patreon – to support my AI coding and hosting costs as we ride the downhill to product launch. All paid supporters will get a hefty discount on the prototype poi when it comes out – and a direct line to give feedback on the features we build in as we grow Magic Poi.

Agentic Embedded Development

“Vibe Coding” is the new thing – I consider myself a proponent of it. Coming from my “Copy Paste from StackOverflow” style it was a natural fit.

Having said that, I still (mostly) try to read the code. Sometimes you have to – especially in PlatformIO. AI simply doesn’t work as well for embedded code – probably because a lot of the good stuff is proprietary and not available to LLM scraping. Less code means less effective models. That ends up being a bit of a hassle when trying to do the code – test – fix loop. First of all it’s actually code – upload – monitor – test – fix if you are working with microcontrollers (never mind ones with web servers running, or interacting with web servers and apps!).

Simply put, I waste a lot of time waiting for the AI to finish coding so I can run a command or press a button to upload and check something.

Introducing Cline

Cline is an open source VSCode AI extension that works with open source models (you can also pay for a better experience). It can edit multiple files at once, run commands and interface with MCP servers! That’s all I needed for my test.

In the video below I show how you can easily get AI to do the coding loop for you – automating the boring stuff, as well as writing the code. For this test I actually went with the FREE version of DeepSeek 8B, which apparently can run on your own GPU (I don’t have one, so I’m using OpenRouter here).

This is a pattern that I plan on building on in the future. I show how to add a file with commands for Cline to run (upload, monitor) and how I bring it all together with one big prompt so that Cline actually runs everything on its own!

Future plans

I have also done something similar with the puppeteer MCP to automate browser testing. I run an embedded server on an ESP32 with automated embedded coding and monitoring – and puppeteer to do button clicking after code changes to test everything works. I should make a video about that.

I still have to make a big instruction file for Cline – with all of the ideas here inside. Then hopefully I can just tell it to make me a project in full and it will do it (beware, Cline seems to suck up tokens really fast!)

I do want to add Aider as an MCP for the coding part, though. Aider still has a lot of advantages, especially it’s git integration and configurability (maybe I’m just used to it). Hopefully the MCP option can seamlessly integrate with normal use (same config files and history?), I haven’t looked yet.

Also, I’m not very good at this part, but debugging is important – sometimes it’s essential. I would love to automate the debugging part, using AI. Maybe a PlatformIO debugging MCP server? We don’t have one yet…

Playing with MCP enabled Chatbots

MCP is the new AI buzzword. Being a bit involved in the AI-enhanced programming of my own projects, it escaped my attention until about a week ago. It’s time to have a look.

What I am using

Since I don’t want to pay any money (MCP can drain your tokens pretty quick!) I tried setting this up using local models first – but they are very slow on my laptop and I went with Deepseek Chat which is cheap for this test.

Essential Programs

  1. Ollama – run LLM’s on your own computer
  2. MCP Client for Ollama – allows your local models to connect to MCP’s and for you to configure and control everything from the command line OR:
  3. ChatMCP – cross platform GUI program for chatting to MCP enhanced LLM’s. Configure any LLM from api (Deepseek, Claude, OpenAI) to Ollama.
  4. MCP’s – there are literally thousands of these already! Some lists I found:
    https://github.com/modelcontextprotocol/servers
    https://glama.ai/mcp/servers
  5. DeepSeek – get your api key (or sign up for OpenRouter and use the free rate limited one!)


Example using ChatMCP

I will be using this simple calculator MCP as an example:
https://github.com/githejie/mcp-server-calculator
I just happened to have qwen2.5-coder:1.5b already installed in Ollama so that’s the one I am using (it supports tools) actually I used Deepseek Chat – Ollama is a bit slow on my laptop (it does work though).

In ChatMCP we add the tool like so:

After configuring my Deepseek API key in the settings (bottom right) I choose it from the menu.

DeepSeek Chat works fine (and it’s cheaper). I also got qwen2.5-coder to call tools, it’s a bit slow on my laptop, however (requires Ollama to be running in the background and I don’t have a GPU).

You need to enable the tool:

Then just make the request:

As you can see the AI used the calculator tool (spanner icon) to answer the request! There are so many tools available, from web scraping to controlling your android phone! I even made my own MCP tool to turn on an LED.

I just took a photo with my Android phone by telling the AI to do it for me (using phone-mcp)! What will your MCP enabled AI assistant be able to do?

NOTES

You can add MCP tools to your coding assistant now (eg. Cursor). I am using Cline which has a plugin for VSCode and allows for Deepseek API use (I already pay for this). The configuration looks like this (same format for “MCP Client for Ollama”):

{
  "mcpServers": {
    "hello-world-server": {
      "disabled": false,
      "timeout": 60,
      "command": "/run/media/tom/9109f38b-6b5f-4e3d-a26f-dd920ac0edb6/Manjaro-Home-Backup/3717d0b5-ba54-4c0a-8e8d-407af5c801bd/@home/tom/Documents/PROGRAMMING/Python/mcp_servers/hello_world/.venv/bin/python",
      "args": [
        "-u",
        "/run/media/tom/9109f38b-6b5f-4e3d-a26f-dd920ac0edb6/Manjaro-Home-Backup/3717d0b5-ba54-4c0a-8e8d-407af5c801bd/@home/tom/Documents/PROGRAMMING/Python/mcp_servers/hello_world/server_mcp.py"
      ],
      "env": {
        "PYTHONUNBUFFERED": "1"
      },
      "transportType": "stdio"
    },
    "blink-led-server": {
      "disabled": false,
      "timeout": 60,
      "command": "/run/media/tom/9109f38b-6b5f-4e3d-a26f-dd920ac0edb6/Manjaro-Home-Backup/3717d0b5-ba54-4c0a-8e8d-407af5c801bd/@home/tom/Documents/PROGRAMMING/Python/mcp_servers/mcp_duino/.venv/bin/python",
      "args": [
        "/run/media/tom/9109f38b-6b5f-4e3d-a26f-dd920ac0edb6/Manjaro-Home-Backup/3717d0b5-ba54-4c0a-8e8d-407af5c801bd/@home/tom/Documents/PROGRAMMING/Python/mcp_servers/mcp_duino/server_mcp.py"
      ],
      "env": {},
      "transportType": "stdio"
    },
    "github.com/modelcontextprotocol/servers/tree/main/src/puppeteer": {
      "disabled": false,
      "timeout": 60,
      "command": "docker",
      "args": [
        "run",
        "-i",
        "--rm",
        "--init",
        "-e", "DOCKER_CONTAINER=true",
        "-e", "DISPLAY=$DISPLAY",
        "-v", "/tmp/.X11-unix:/tmp/.X11-unix:rw",
        "--security-opt", "seccomp=unconfined",
        "mcp/puppeteer",
        "--disable-web-security",
        "--no-sandbox",
        "--disable-dev-shm-usage"
      ],
      "env": {},
      "transportType": "stdio"
    },
    "phone-mcp": {
      "command": "uvx",
      "args": [
        "phone-mcp"
      ]
    },
    "calculator": {
      "command": "uvx",
      "args": [
        "mcp-server-calculator"
      ]
    }
  }
}

As you can see, uvx solves a lot of configuration long story here – otherwise you have to specify the path of your virtual environment.

The most common MCP servers are Node based, or Python. I am using Python as it’s my preferred language. Node is pretty similar, just use npx instead of uv.

Next Steps

Next up: converting all of my code to work with MCP. Seriously – if you aren’t MCP compatible, then you need to work on it, I think in the future this will be very important. Check out FastMCP for python implementation.