Smart Poi

Advanced Arduino Editing

My favorite practical Arduino project is getting a bit large for Arduino IDE, so I am looking to move the development over to a “real” IDE. During the past few months I have enjoyed using Visual Studio Code (on my laptop running Xubuntu) for HTML editing. Since they have plugins I thought I would give it a go.

First attempt: Platform.io

Platform.io has some impressive marketing out there. They also support esp8266 which for me is a must. Unfortunately it is another setup which requires an entire rewrite of the code (renaming all .ino files to .cpp for example) and for the amount of projects I have lying around and return to regularly that’s a definite pass. *UPDATE: unless there is no other choice!

Arduino Plugin:

There is a nice plugin for Arduino, however. It does require you to already have Arduino set up on your system (check). To set up the VSCode plugin you have to point it to the Arduino installation folder.

https://maker.pro/arduino/tutorial/how-to-use-visual-studio-code-for-arduino

The ESP8266 is also supported! (you just need to add the board repository, kind of like how you add it to Arduino)

I also found a plugin to upload spiffs (esp8266 file system). https://marketplace.visualstudio.com/items?itemName=kash4kev.vscode-esp8266fs *UPDATE: unfortunately spiffs is now obsolete and there is no upload option for LittleFS, the upgraded replacement.

So far in testing the whole thing works, uploading sketches just the same as Arduino, except now I have tab completion(the IDE completes your commands for you when you press <TAB>) and advanced syntax highlighting. Best of all, VSCode comes with Dark Mode!

I think I might enjoy it, going forward. The only issue so far is that VSCode is no lightweight, it seems to be using a fair amount of resources to run. Nowhere near Android Studio, however.

*UPDATE: Unfortunately the Arduino plugin somehow fails to support multiple .ino files for an Arduino sketch (!!!!!). Here is the bug report: https://github.com/microsoft/vscode-arduino/issues/271

This is simply unusable as a result (sigh)

Guess I’m having another look at Platform.io – for lack of alternatives!

If you stumble upon this post and have a solution please send me an email tomjuggler at gmail dot com

PS I did try the alpha version of Arduino: Arduino Pro IDE https://www.arduino.cc/pro/software but it’s just that, alpha. 106 Errors in my code? But it still compiles and uploads fine?

Whatever happened to processing.js

I have mentioned this before, Processing is the greatest tool to code for me because it provides easy access to so many creative coding options. The main reason I love it so much is because it is cross-platform. I use the same code on the web, desktop and mobile apps (Android).

Now one of those options is less accessible for many new coders. Namely, processing.js.

What is processing.js?

If you don’t know, processing.js is simply a way for your processing (JAVA) code to be translated into JavaScript and run in a browser canvas window.

Why is it cool?

I love processing.js because it’s the easiest way to use the same code and get web-based sketches running on my own server. Just include a processing.js file and the processing sketch (with a tiny bit of html) and it works.

What to do now?

Processing wants us to start using P5.js which is the functionality of Processing but using JavaScript syntax. I am mainly an Android and Java programmer, so for me this is an unnecessary step (mainly involving changing all int’s and floats to var) and I personally will continue using processing.js.

But they took the website away!

Now we come to the reason for this post: they took away the website! If you try and go to processingjs.org website now you will find it’s been taken down by the maintainers. Only the github code is left for posterity. Well luckily there is always the wayback machine: https://web.archive.org/web/20180510071709/http://processingjs.org

Processing.js is alive and well. It’s still working on my site, you can see a load of them all over this site, and on my cv even.

Google Play Store Says NO!

Google Play Store is the portal through which all successful Android Apps have to travel, in order to reach their audience. The last two Apps I tried to upload there were refused, one on the valid grounds of being just a web view. The other, most recently was mistaken by what I can only imagine is an AI to be an Augmented Reality App.

Here is the offending app. Apparently I need to notify people about the confusion that augmented reality can cause. Is this Augmented Reality?

Well try the app out for yourself and see: https://circusscientist.com/SwipeCard.apk

I have changed the age limit to over 18, hopefully this will get my app accepted. Otherwise the only recourse is sending an email to request a review (probably from a bot)

How To Fix the dreaded “Error Establishing A Database Connection” In WordPress

This is just a quick post to note what worked for me. I found loads of tutorials online but none of them had the full story.

Essentially I had to change my database password. Here is what I did:

Assuming you have ssh access to your DigitalOcean Ubuntu droplet:

Fictional Database Name: wordpressDB

Fictional WordPress User Name: wpUser

Fictional Password: 12345

Open your wordpress wp-config.php (usually located at /var/www/html) and change the password, and make a note of the database name and user.

nano /var/www/html/wp-config.php

define( 'DB_PASSWORD', '12345' );

Now change the mySql database details:

mysql -u root -p

use wordpressDB;

UPDATE wp_users SET user_pass = MD5('12345') WHERE ID=1 LIMIT 1;

grant all on wordpressDB.* to 'wpUser'@'localhost' identified by '12345';

flush privileges;

exit;

Conclusion

Anyway that’s what worked for me, hope it helps someone at some point (probably me, in the future). Generally WordPress is pretty stable, this is the first time I encountered this problem.

Legal Animation

A friend who is a graphic artist contacted me, he has a client who is looking for some complex animation of legal transaction history, to illustrate corrupt dealings I imagine.

Anyway, here is the work I’ve done so far.

Hypothetical scenario: There are some terrible things going on at Google, FaceBook and Monsanto. Not to mention the USA, what are they doing with their finances? Check out the attached video to find out!

Corrupt Companies and dodgy dealings

Think I am going to get the gig? At this point I am enjoying creating this program enough not to care.

For those who are interested, the data comes from .csv files – transactions and accounts. Also there are different types of transactions, indicated by a different coloured line. Still a lot to do, but I’m quite proud of this one.

FaceBook is killing me

Here is a tip guys, don’t rely on those big third party services for your livelihood. Due to circumstances beyond my control (coronavirus) my family business has been forced to sink or swim online. We have been doing a ton of marketing, on FaceBook, Instagram, YouTube and the like. Now some bot at FB has flagged my company for “Unusual Activity” and removed my page and also suspended my account.

I’m pretty sure that asking for donations from our followers was the root cause of all this. Whether or not we get back online doesn’t matter, the damage is done. All the links that bounce will reduce our potential to survive the financial squeeze.

All because we used a big, free service, and thought that it was “ours”

Well that is a lesson I won’t need to learn twice. Or at least three times, having already been burned by Google constantly shutting down or ‘upgrading’ services.

UPDATE: Facebook re-instated my account and our business page, no reason given. We removed the reference to paypal payment link, for video show bookings, maybe that was what it was?

Making a Living during the Coronavirus Outbreak, part 2

A CLOWN’S QUEST TO SURVIVE LOCKDOWN

In case you missed the last post, the Corvid-19 epidemic has reduced my income to zero. This is what I am doing to survive.

My best show, now on your TV

The Problem:

My wife and business partner came up with the idea, and did a whole load of FaceBook, Instagram and email marketing, so all of a sudden we had bookings, quite a lot of them. Right now I still have to do 4 more personalised kids show video’s by the end of tomorrow.

This is great, they are only R200 each, about $11 US, but everything counts at the moment. The problem is that each video is 30 minutes long, and on my dual core celeron laptop that equates to 3 hours of rendering each if you want HD.

Get the gig first, now learn how to do it!

So I have google. I have used Kdenlive before which amazingly turns out to be a front end to a command line video editor, “melt“, who knew!

My plan (now working) was this:

  1. Render all the non-changing parts of the video (using a script – you can generate melt .mlt render files for pieces of a project inside Kdenlive and que them with bash)
  2. Script the rendering of personalised voice-over parts of the video
  3. Script the audio from the left stereo channel voice recordings over to being on both sides (why did Kdenlive do this to me?!)
  4. Script all the different pieces getting put back together (1GB file in 15 pieces takes 10 minutes, using ffmpeg)
  5. I used YouTube to help me reduce the quality (for someone who didn’t have bandwidth for 1.2GB download), uploaded to YouTube Studio and set the video to unpublished. Then downloaded lower quality again with youtube-dl, share using Google Drive.

It works, more please!

Now each new video takes about 20 minutes to do, instead of 3-4 hours previously. I am hoping to streamline this even more. I guess if I really needed to I could cobble together a system where all I have to do is say the recipient’s name and their video is generated automatically. Of course that would defeat the purpose of a “personal” video. I really do like to feel like I am giving attention to each order.

Why not order your own video for the kids? Email info@bigtop.co.za to book your personalised show!

*Update: our President just announced an extra two weeks of lockdown for everyone.