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).

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…

FastMCP LED Control Server

I made a Python program using MCP protocol to interface between AI and an LED.

Source Code: https://github.com/tomjuggler/BlinkMCPServer – includes Arduino sketch and MCP python server with example Cline json config.

Tech used: FastMCP (Python) Arduino Uno (Serial) and Cline for VSCode (MCP Client), with DeepSeek Reasoner as the LLM – massive overkill just to turn on an LED!


This project was built using Aider – pair programming in your terminal.
https://aider.chat/

Check out the demo video where I tell the AI to turn on my LED – all done from Cline agent inside VSCode!

Android Devices

Over the years I have had many mobile devices – all on Android. This blog post is going to go through the ones that still work, and how I use them.


  1. Xiaomi Redmi 9A
    – Main phone, primary use is Google Calendar, Maps (to get to shows) and WhatsApp. Also reading.
    – Absolutely hate this phone
    – Laggy
    – Managed to update to Android 11 but with great difficulty (hacking phone because Xiaomi doesn’t want me to upgrade my own hardware)
    – Looking for a replacement (after which I will hack it some more I guess)
    – This is the last Xiaomi I will ever get – moving back to Samsung if possible (see below)

  2. Doogee Mix Lite
    – Primary use for Podcasts
    – Old main phone (got it for the camera and fingerprint reader)
    – Doogee actually pushed an update that bricked this device!
    – After that I found a LineageOS based rom called ViperOS – Android 7, the latest available for this phone.

  3. BlackView Tab 9 (10 inch)
    – Primary use: Crunchyroll (Anime), PipePipe (YouTube) and Kodi (movies and series from my local networked HDD, when we don’t use Kodi on our Raspberry Pi 400 to watch on the “TV”).
    – My son’s old tablet, battery died because he would let it run down to 0%
    Hacked it to add replaceable batteries
    – Haven’t replaced the OS yet

  4. Lenovo Tab 7
    – Primary use FlipBoard (news reader)
    – I like to read news in the morning. 7 Inch is perfect.
    – Upgraded to Resurrection Remix OS (based on LineageOS)
    – Latest available Android 7 (upgrade from 4.4 original!)

  5. Proline 7 inch
    – Primary Use: kids friends sometimes need something to play LAN MineCraft Bedrock on, or Roblox.
    – Another Tablet that my son broke (he now has a restriction on his new one) by running the battery down.
    – Replaced the battery and now it’s a backup device.
    – Impossible to update software, turns out this has a “Spreadtrum” chip inside, a low cost, rare and very bad SOC. Did come with Android 12 “GO” version, so it works at least.

  6. Samsung Galaxy Y
    – Primary use case: Radio and Music player for shows
    – my first android phone (3.5 inch!)
    – Thanks to replaceable battery it still works
    – I bricked one trying to upgrade (my wife’s old one) so this one still has Gingerbread on it (Android v3.3)
    – Processor is Arm v6!

  7. Honorable mention: Samsung Galaxy SII
    – Worked up until a year ago
    – Used as Podcast phone and for Android App testing
    – Managed to upgrade all the way to Android 12 (LineageOS)
    – Original was JellyBean (Android 4.3)
    – Hoping to get another Samsung device for next main phone, really good experience with the two I had so far.

Conclusion

I don’t have one device that does everything. I don’t buy a flagship device when I get a new phone. But I do try to make use of old devices, which offers some benefits, including extra battery life (just use the other device while one is charging) and saving money (I am especially pleased with having a 10 inch tablet for Anime, for “FREE”)

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

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.

Boost Your Online Reach: How Multiple Related Websites Can Grow Your Business

Use your industry specific knowledge to create a related website and fill it with your own ADS. Create your own referrals with much less cost than paying for ads. I could go on, but let me start with

An Example

My own business is in the Entertainment Industry. We do high value entertainment which can run to thousands of rands invoiced for a single booking, and our customers often convert to returning customers (we get 50% returning customers on average) – so a single lead can be very valuable, long term. That is why we advertise on Google.

Many years ago we set up a page on our main site, which was in response to all of the enquiries regarding Party Venues. This was a simple service to our customers with our recommendations regarding our favorite venues in the Durban area. This quickly became the most popular page on our site, according to Analytics. Soon after I decided to branch out and create a full website using the initial list – and now this site durbanpartyvenues.co.za is getting up to 2000 visitors per month. We get 10-20 referrals from this site which converts to an estimated extra R1000-R10000 per month (guesstimate according to converstion statistics).

Since we were already paying for a web server the actual extra cost is R100 per year for the domain fee (!). Of course I spent a lot of time on the website development – first in WordPress and later Flask (Python) which made it easier to add new venues using a simple spreadsheet which makes it easier for my non-technical partner to do it.

Expanding

Last year we added capetownpartyvenues.co.za since we occasionally do entertainment in that city. This year I am working on another related services website, durbanpartyhub.co.za which will cover related entertainment services. This time we are planning on allowing our friends in the entertainment industry to pay a small fee for preferential placement (once the site gets traction).

Does this apply to your industry?

I am sure you can think of related products and services that you have inside knowledge of which can

  1. Provide informative content for potential customers
  2. Be made into a website which you create and control with your own brand front and foremost

Shameless plug

The years I spent refining this “Related Services” template has given me an unique insight into efficiently building out an effective marketing vehicle for my company – while at the same time offering a valuable service for our customers. At DevSoft, we use AI development tools to speed up, refine and enhance the website creation process. Perhaps the ideas in this blog make sense to you? If so, get in touch!

Changing times

I recently read an article on ZDNet which was talking about the new ChatGPT search and how Google Ads is going to be less relevant in future. The takeaway from that is that your organic web presence is going to be even more relevant, if paying for search placement becomes less effective. I did a test with the new ChatGPT search and “Magician for Kids parties in Durban” and “Top 10 Outdoor Party Venues in Durban” both return sites that I own at the top, organically – thankfully due to our SEO.

The article didn’t mention it in but I think social media pages (Facebook, Instagram, etc) are going to be even more important in the future – but you don’t have control over those. Owning your own content and related content is the most important thing in my opinion.

PS: check out the AI Enhanced super commercial version of this blog post here: https://devsoft.co.za/blog

My 10 year old son made an Android Game with no coding experience

Recently I have been trying out cursor IDE – based on VSCode.

My verdict is: it’s magic. After trying out several others including Github Co-pilot, I have to say that in my opinion this is the future of coding. It’s so easy that after I set it up for him, my son spent a few happy hours prompting his way to a really fun Android game, without writing a single line of code*. You can download and and try it yourself! I especially love level 2 where you have to fight poop emoji’s – fire at will! Just be ready for level 3 where a bug new feature means you can’t fire, and have to collect powerups and ram the enemy ships.

*OK I helped with the image files and debugging, compiling for Android etc..

The future of coding is awesome. That’s why I have now made a patreon account, where you can support my AI addiction – unfortunately cursor and other services I love to use are not free. Help me by subscribing with a few bucks please! https://www.patreon.com/CircusScientist. I promise every cent will be spent on products and services to improve my open source code (currently focused on finishing the awesome Magic Poi)