When I started this blog I barely knew anything about coding. I’ve come a long way since, so much so that I can create and deploy my own blog – all from a Git repository.
So friends, the adventures continue over there!
When I started this blog I barely knew anything about coding. I’ve come a long way since, so much so that I can create and deploy my own blog – all from a Git repository.
So friends, the adventures continue over there!
For some just beginning their programming journeys a common example to conquer is blinking an LED, which usually goes something like this:
digitalWrite(13, HIGH); delay(1000); digitalWrite(13, LOW);
For me, I decided to try a much harder approach, in a fiddly effort that could be regarded as virtually pointless. Nevertheless, I persisted, because I thought it would be cool.
The idea: blink a Blinkt LED on Server Pi whenever it serviced a request from the outside.
For those unfamiliar with my little family of Raspberry Pi minions, here is a brief overview:
Maintaining this small fleet is a joy and a curse (one or both of “my own mini infrastructure, yay!” or “It’s all fallen over because Node exceptions are weird, noo!”), but since I started versioning it all in Git and adding crontab and boot scripts, it’s become a lot easier. However, for this particular task, I found only one process can usefully control the Blinkt LEDs on top of Server Pi. Since this is a parameterised (services only) instance of Monitor Pi, it must be this process that does the blinking when a request is processed.
Since I’m already a big fan of modular Node.js apps, I just added another module that sets up a single-endpoint Express server, and have each of the other three Server Pi processes POST to it whenever they service a request with their own Express servers. Neat!
An hour of synchronising and testing four processes locally and on-device later, and I now have a blue blinking LED whenever a request is serviced. Sadly the activity isn’t as high as it was in the News Headlines heyday when it was tasked with converting news story images to Pebble-friendly 64 colour thumbnails and an experimental analytics service late last year, but with the interesting tentative steps the unreleased notification service is taking, Server Pi may end up seeing a bit more action than simple status checks and app news lookups in the future.
With all this work done, it’s also time for another diagrammatic mess that I like to call my infrastructure…
After the Dropbox outage (which appears to still be affecting me) the tutorial source code is now on GitHub.
Just so you know.
Back to work! This means I’ll be developing stuff in my spare time rather than all day. I know, it’s sad news.
Things to expect eventually (in the weeks range):
Hopefully Watch Trigger on the Play Store is stable enough to fend for itself for the time being. If not, let me know.
So now the semester has finished, I can get down to some real coding and tutorial writing. Things to expect over the next few weeks:
In other news, the latest versions of Watch Trigger (2.3) and Watch Trigger + (1.5) have been sent to Google Play, fixing xx-hdpi display issues and a bug when opening the front camera on the LG Nexus 5.
Stay tuned!
I’ve embarked upon my fourth and final year at university, and so a lot of my time is taken up with the course and associated course-work, including a mammoth individual research project.
The good news is that a large part of that project will involve writing software in C++, which I’ve never used before. I have, however, used C so the leap is not too far. Thus over the last week or so I’ve been gaining familiarity with using the OpenCV image processing library and after the initial teething troubles installing and linking the library it looks very promising for what I hope to achieve.
In the free time remaining when I’m not doing other life stuff, I’ve been working on a much more polished GClient using the knowledge I obtained working on Watch Trigger, as well as trying to figure out why zoom isn’t working in a test build of Watch Trigger +. Yet more wresting with the finicky Camera API.
Hopefully I’ll crack it soon!
Lots going on at the moment, so here’s a list of what’s coming soon (also a personal reminder!):
Got to do my best not to lose sight of a current project!
So while the exams are going on, I don’t have a lot of time for long coding sessions, but I am working on a small side project that builds on earlier work, and therefore requires minimal effort.
The idea is this: Modify the Java server to run cmd
commands from my Android phone. First stage is creating a networking class for Android use. This could be useful for commands such as shutdown
without having to use the slow TeamViewer app, for example.
Here we go!
So I’ve finally started that blog idea I’d had my eye on for a while – a place to document all the thoughts, processes and results of my attempts at programming. Sure, its been done before, but isn’t that the idea of a blog, to be personal?