💾 Archived View for tilde.club › ~kitzman › posts › 2022-02-06_for_iot_1 › index.gmi captured on 2024-06-20 at 12:03:36. Gemini links have been rewritten to link to archived content
-=-=-=-=-=-=-
6 February 2022
So...
My previous attempt to use pmOS was not so successful... ... probably due to lack of vendor libraries which would require the native Android libc, lack of set properties, and daemons I'd have to compile in order to use, let's say, the GSM network.
So I decided to give Android a try, as a general-purpose IoT operating system ^^.
Last time I saw it in the wild, for the same usage, was for ODroid. Apparently a project called "Android Things" existed - a library/OS extension for devices - but was discontinued as of 5th Jan 2022.
. . . .'. \ / \ / .'. .' '.' ' -= o =- -= o =- .' ' / | \ / | \ | | | | | | .=====| |=====. |.---.| |.---.| ||=o=|| ||=o=|| || || || || || || || || ||___|| ||___|| |[:::]| jgs |[:::]| '-----' '-----' __ __ __ __ ___ __ _ __ / /___ / /_ / /_ / / ___ / _/__ __ ___ / / ___ ___ _ (_)___ / / / // -_)/ __/ / __// _ \/ -_) / _// // // _ \ / _ \/ -_)/ _ `// // _ \ /_/ /_/ \__/ \__/ \__//_//_/\__/ /_/ \_,_//_//_/ /_.__/\__/ \_, //_//_//_/(_) /___/
Great things are gonna happen!
One of the things I want to do is to customize AOSP/LineageOS for ultra-low battery consumption. That does not only mean powering off most devices, but also suspending the system and waking it up after intervals of time. I will triangulate GSM and Radio, use it for an SIP network, etc.
Another motivation is using my knowledge to make network unlocking easier (see my other posts).
The device I'm trying to use, is an old, scarred, HTC M7.
First step was to discover an unofficial, maintained version of LineageOS. XDA Develpers to the rescue!
The LineageOS wiki is pretty well documented. Pulling the code took approximately ˜36 hours.
Everything that was left was to add the unofficial repos - the Manifest format is XML, so after skimming few times through other XMLs and the documentation, creating a local manifest was quite easy.
Building it takes ˜45 minutes, on a 12-core computer, using 50GB of `ccache`.
As I ran it the first time, of course I noticed some bugsâ„¢. Running `adb logcat` luckily worked, and I piped it through my script [1] that sends it to a syslog-ng RFC5242 port (which then sends it to Promtail, Loki and finally Grafana).
After noticing nothing really works, and getting a lot of `permission denied ` messages, my first instinct was to set SELinux to permissive. Which obviously worked. And after few minutes of looking around, I found where to change the CMDLINE as well. :)
For using it an IoT device, I've set the following requirements: