Accessing the solar website:

Wilderland has two websites, one always-on, higher resolution website that is heavier to run, and one experimental, situated site, that is solar powered, and in the Nephin Park

The solar site might not always be on or available, it also has other quirks, and will be slower. Adjust your expectactions for this Permacomputing + Small Web alternative.

page

Permacomputing: workshop 2 - Repurposing Smartphones

Step by step of the second PMC workshop on Wednesday June 25th in the Leitrim Sculpture Centre in Manorhamilton.

schedule outline

  • 10.30: start
  • 10.30 - 11.00: project introduction, Materials Matter and Wilderland, PhD intro
  • 11.00 to 12.30: Repurposing Smartphones - method 1: termux
  • 12.30 to 13.30: Lunch break
  • 13.30 to 14.30: Repurposing Smartphones - method 2: postmarketOS
  • 14.30 to 15.30: Discussion - getting your thoughts and opinions

Ways of doing

This workshop is meant to be enjoyable and relaxed. It wants to share information in a usable way and provide hands on experience. If you have any questions or concerns, please feel free to speak up, don’t be afraid to interrupt.

Project introductions

disclaimer + credits + acknowledgements

The content shared today is part of a developing artist research. There is a risk that some actions could result in damaged devices (sometimes called ‘bricking’ a device). Any of the information provided today should not be used unless you are sure of what you are doing. In particular, the shared command lines should be triple checked, as most of the pmOS stuff is very device specific. The information that I share today was gathered over a number of years, from a number of sources. In somewhat of a chrono/importance order:

two methods

Two methods for repurposing smartphones are shared today, one relatively simple one using Termux (“terminal emulator app and a Linux environment for Android devices”) and another more complex, but ultimately more flexible method flashing PostmarketOS.

Method 1: termux

installing f-droid

go to https://f-droid.org and download f-droid (some devices older than Android 6 might need https://f-droid.org/en/docs/Running_on_old_Android_versions/)

your device should recognise the .apk file as an installable

but unless you have done some tinkering before, your device won’t let you install .apks from unknown sources.

We can allow this to be installed in the settings.

Once this is enabled, you should be albe to install f-droid. You might have to re-run the Package installer, by tapping on the downloaded .apk in your android Downloads.

When installed, you should be able to open the f-droid, it is effectively an alternative app store.


using f-droid to install ‘termux’ and termux packages

search for termux in f-droid, and you should see the main package

Once installed, consider installing the following Termux:Boot addons, for later projects. This is not essential, but will help if you want to run anything for long periods on the device.

Follow the guide here https://wiki.termux.com/wiki/Termux:Boot to make sure that termux starts when the device boots.

termux api gives you access to lots of good device funtionality, such as ways of querying the battery status, making a call from the cli, poping up a notification, and lots of other good stuff. See https://wiki.termux.com/wiki/Termux:API for more details.

connecting to termux over ssh

The following details the process of accessing a mobile android device via a laptop. For this to work, you need to make sure both devices are connected to the same network.

  1. launch termux on the device and type whoami to get your termux username. Put this in place of the <user> in the command below at point4

  2. run

pkg update
pkg upgrade
pkg install apache2
pkg install openssh
pkg install termux-services
sv-enable sshd
  1. find the android device’s IP address in the android network settings. Put this in place of the <ip-addr> in the command below at point4

  2. on your laptop (if you are on macOS or Linux) open a terminal, (if you are on Windows) open a PowerShell, and run

ssh -p 8022 <user>@<ip-addr>

on the the samsung A40 that runs remote.wilderland.ie it looks something like:

ssh -p 8022 u0_a278@192.168.1.17

configuring termux to do stuff

Most of the good stuff you can do with termux is listed in the Termux-services page. The service manager is very helpful in termux, to run services in the background. We installed it earlier with pkg install termux-services so you should be good to go. Usage example:

sv-enable httpd should start the http service and make a webserver and a website be accessible from your device.

Note that this doesn’t start the process on boot, so if you expect your device to power on and off frequently, consider the information on the Termux:Boot

Project ideas

So far, my explorations into termux and pmOS have been for the remote.wilderland.ie project, which is a web-hosting project. But I’ve been dreaming up other possible projects / uses of portable termux devices. Below is a short list of ideas, with very rough initial reseach.

  • making an IP camera for wildlife observation (or other surveillance needs, I suppose): considering that termux-api can access the camera, and motion seems very mature, and accessible via apk, it should be possible to create a wildlife observation device with a termux device, a sim card, and a solar panel.
  • making a digital signage or digital display: depending on space and need, a termux device (maybe a tablet) has all the right hardware for a digital sign. With web pages, you could easily give people access to a shared folder, and the termux device could pull these images and show them on rotation. If you just needed to display text, you could make a barebones cms with an etherpad, wget the content of the etherpad and <marquee> tag?

Method 2: PostmarketOS

Installing pmOS on a device can be very straightforwards or very complicated. It depends primarily on whether or not the devices is known and supported by the pmOS community.

See the installation page and the devices page to determine how easy / complex this is going to be.

In this part of the workshop, each participant will follow their preferred track, either installing a pmOS device if compatible, or, a number of devices will be made available to the group for experimentation.

If you are using a device provided for the workshop, the username is most likely user and the password is most likely 147147, as per the defaults.

SSHing to a pmOS device

Using a combination of device-screen CLI and / or nmap and / or the webui of the router we will use, determine the IP of the device. Then you should be able to:

ssh user@ip-address
147147

If that succeeds, you’ll probably want to read through this pmOS terminal cheat sheet.

Noteworthy system things:

  1. pmOS is based on Alpine Linux and therefore uses the ‘Alpine Package Keeper’. This can be called using the apk program:
sudo apk add neovim
  1. service management will be done either via systemclt or rc-service, depending on if your install came with a GUI or not. See this bit of the wiki for more details on that

Project ideas + things to explore:

So far, my explorations into termux and pmOS have been for the remote.wilderland.ie project, which is a web-hosting project. But I’ve been dreaming up other possible projects / uses of portable pmOS devices. Below is a short list of ideas, with very rough initial reseach.

  • making a media streaming server: if you can mount an SD card on your device, it might be possible to use it as a Music Streaming server via Navidrome. apk add navidrome, but this runs on docker, so it would be quite heavy. You could have your device at home, connected to wifi and power, and if it ran Navidrome you could access it at http://:4533 on the go with Subsonic clients (e.g., DSub, substreamer) on other devices and share playlists.
  • making a retrogaming console: if your device is powerful enough, and you’re running a GUI, there is a package called retroarch, that seems ready for touchscreen controller.
  • make a portable web-radio broadcaster: A pmOS device, a sim card, and a solar pannel could be all you needed to create a web-radio broadcaster. You might need a better mic than the on-board one, but alsamixer could detect other audio input devices. This idea came to me when I heard that field recording artists were driving electric cars to known avian morning chorus locations. As it happens, the Ballycroy Visitors centre in the Wild Nephin park is such a location. Maybe a pmOS device could be left in one of the trees discretely to broadcast the morning chorus, live, every morning in the summer? A mix of alsa-utils, alsactl, arecord (or pulseaudio? I’m up to date on linux audio processes) for recording, then an icecast server, would possibly do the trick? You might alternatively get the pmOS device to stream audio to a remote icecast server, if it was too heavy?