postmarketOS first look

At home we have a bunch of old Android devices and laptops. The laptops all have some version of Linux running on them by now, but so far I have only had limited use for the oldest Android devices. I have an old S3 mini for example which has a great screen, but unfortunately LineageOS (the Android Upgrade) latest version available is Nougat, and that runs rather slowly. Besides, I already have two Android devices working with later versions.

PostmarketOS is a fairly new project with the goal of porting Alpine Linux (really small) with mainline kernel to ALL Android devices. Also you can run all types of UI on top of postmarketOS for example Plasma Mobile. I just wanted to see if I could have a device with WiFi which I could use to run some Bash scripts, c programs and possibly Python.

Here is how it works:

  1. You need a computer running linux – install the pmbootstrap program
  2. put phone into fastboot mode – making sure to follow instructions on postmarketOS wiki – S3 mini page was here
  3. after following the install guide (really comprehensive and simple), and choosing the kernel (mainline or the old one from Android), the Desktop (mate, xfce, plasma mobile, and many more), just run the install scripts
  4. ssh into phone via usb (or just use the phone touch screen)
  5. to install any program (from alpine linux) type apk add <program>
  6. a good one to have is corekeyboard (onscreen keyboard for phone)

So here it is then: Mate desktop running on postmarketOS in my S3 mini. (not mainline kernel though):

This is my phone screen now. The menu works and everything! (date and time no)

So far I have not been able to get WiFi working, or Bluetooth, however there is an option to share the laptop internet via USB, so I can still install programs. I installed gcc and compiled and ran a c program, and of course a shell script. This is really a great project and worth checking out if you have an old phone or two lying around.

Monkey Detector Circuit and App

It’s been a while since I was so excited about a project. After much struggle (to do with a very hot voltage regulator) I have come up with a working circuit for the hosepipe tap trigger.

I was hoping to power the whole thing from 12 volts but the voltage regulator was getting a bit hot, and my main directive for this whole project is to not spend any money (otherwise I would have a relay shield like this one instead of the bare 5v relay which I had to trigger with a transistor)…

The other exciting thing was the Android app. I decided to create a stand-alone app which recognizes monkeys to put on the play store. Right now it plays a loud siren sound when a monkey – or baboon – is detected. I can’t even count how many times it would have been useful to have a simple alert which would warn me about vervets attempting to break in on the other side of the house.

Don’t get me wrong, I love the monkeys. They are really interesting to watch, their kids play in our yard, they do tight-rope on the telephone wires, and the troupes have all-out warfare sometimes on the road. The other day we found out that our neighbor’s dog has a pact with the monkeys: they open the bin for him and he helps them eat the contents. Just some monkeys and a dog getting along just fine!

So the Android app is pending review, it’s called Monkey Detector, I will add a link to it when available. My third play store app!

Update: Monkey Detector on Google Play Store – unfortunately some devices are having a problem where the app isn’t playing the alert sound. I am looking into this (it works on my phone…)

Monkey Detector – image for app icon

Mobile Monkey Detector

It’s amazing how machine learning has improved over the last few years. I was dabbling with TensorFlow for a while, then moved on to look at pyCharm, but ultimately I was going to go with the easy-to-use Google image recognition API for the mobile version of my monkey detector.

Then a few days ago I stumbled upon fritz.ai and their even easier-to-use pre-trained mobile classifier. Unfortunately the example was written in Kotlin, but anyone developing an Android app today should know that, so I gave it a go. Here is the tutorial on Medium (with link to Kotlin code on GitHub) https://heartbeat.fritz.ai/image-labeling-on-android-in-kotlin-using-fritz-ai-and-camerax-1466089b2e34

The current version of the app (detects monkeys but doesn’t send a signal to my WiFi connected sprinkler system yet) is here: circusscientist.com/seeMonkey.apk – now available on the Google Play Store!
In order to use it you need to give camera permissions before first run, otherwise the app will force close. Just point it at a monkey and get alerted* (pictures of monkeys work fine)

*If you are wondering what happens, my 6 year old son shouts “Hey you, get away from my lunch!” when a monkey is detected.

The next step is to adapt my Arduino controlled tap valve (more on this to come soon) to receive WiFi (using ESP8266 of course) and then send the signal from the app (in Kotlin…!)

I can’t wait to make the demo video, those monkeys are trying to get into the bin (and our house) every day, and they hate getting squirted.