I dunno why people find January depressing. Perhaps they try going outside or something. That would be mistake. Seems to me to be the month to stay home, hermit and hibernate, and make something.

I am fully engrossed here, have been all month. Barely time for anything else. Loving it.

This is also why all my domain-name renewals come up in January.

Micropython is really interesting. Haven't felt this memory-constrained since I was writing software for 8-bit home computers.

I have become extravagant in my use of large buffers and just reading in whole files all at once from programming servers all the time.

It's nostalgic being back to trying to eek out each byte and resuse all the variables and refactor code so it'll fit in RAM.

Here's the surprising thing: every variable in Python is like 28 bytes of RAM.

You think you're just storing a switch that turns a thing on and off, a 0 or a 1. A bool.

But no. You're storing a Bool object, which has a type and a reference-count and overhead to represent it's structure.

Which means the most RAM-saving thing I've been able to do is basically replace all the variables with pointers into a byte-array.

Like back when programming the old Dos machines: basically just allocate your memory block and organize it yourself.

Fight the OS. Fight the Micropython.

It wants to turn your flag bits into 28 byte macro objects.

I may yet end up pushing multiple flags into one byte.

Like, a date-object is a tuple of 7 variables for year, month, day, hour, minute, second, fraction.

You store one of those in memory, it's an array of 7x28 byte numbers!?

You want a week's worth and you're just doomed.

FacK!

This machine only has 32k and the system takes up 2 thirds of it.

Store it as a timestamp in an array of longs and it's 32 bits. That's it.

I'm used to optimizing for throughput and latency, so this micro-environment where I'm happy to waste a few cycles to spare the bytes is a really different type of challenge.

Way more like the old Spectrum days.

Hurray, it's more or less sort of done!

Presenting: My Monolith Watch-face and Mood-Log app for Wasp-OS on PineTime.

(and also the Colmi P8 and Senbono K9 I'm told but I dunno what they are or if it'd work on that)

Here's a blog-post about the work I've done this month:

https://dalliance.net/vPre2/waspos

#pinetime #waspos #hack #hackability #python

Introducing Monolith and Mood for WaspOS / PineTime โ€“ Dalliance

It can get pretty busy-looking when all the features are turned on at once.
You can change the font and the colours, naturally.

This thing is logging step-counts and heart-rate every 15 minutes and collecting data on my mood and activities.

All in simple CSV files with no sniff of any cloud infrastructure or corporate spyware or surveillance capitalism's grubby eyes.

Just stuff I can import into Libre Office calc.

Looking forward to seeing what data it collects now I'm actually wearing it instead of programming it and rebooting it all the time.

It's been so fun working on this most of the month. Proper head-down 100% focus in-the-zone programming almost every hour I'm not working. My wrists are wrecked.

Glad to have it done now, have to get back to proper projects in Feb. Must stop and do other things. If only coz I'm out of RAM. That final squeeze to fit it all in was a toughie!

Though at some point I'll want software to graph all those logs I suppose ๐Ÿค”

When I first got the machine I was very underwhelmed. Apparently I was indeed already achieving about right goal of steps and have around the right heart-rate.

Couldn't really see myself wearing it long-term. Not really a watch guy. Didn't wear 'em even before I was carrying a phone everywhere.

But when I put the Python firmware on it and started actually programming it myself I fell for the thing entirely.

That's the power of hackability I guess.

My activity-log during the course of making this software to log activities has been pretty monotonous:

* Sleep
* Work on activity-log project
* Sleep
* Work on activity-log project.

etc.

Only my day-job meant I had to add a 3rd category.

Wondering if there's any way to fit a pac-man game into the remaining space. Maybe if I re-doubled the memory-efficiency of the mood app. Even on a small screen pac-man has so many dots. Maybe if screen-state itself could track dot-state? Hummm. Dunno if the screen's pixels even have a peek function.

Well the display froze at 7:20 am so I got a nice lie-in till noon thinking it was still early ๐Ÿ˜†

Wonder why that happened. Perhaps using it as a clock in the charger next to the bed was a poor plan.

Oh well, I like good sleep-till-noon now and then.

Starting to get a a bit of data from running these #waspos #pinetime logging apps I've written.

So I've been writing a log-viewing app of course.

My mood over the last most-of-a-week has been generally constantly good, with blips down mostly on work-day morning awakenings. The actual work doesn't make me sad, just having to get out of bed and do it. Even though I'm very lucky, that is only 3 days a week.

Step rates and heart-rates peak around the ten-minute exercise times as you'd expect and range about what you'd want I think other than the outliers that are probably just data glitches.

Higher in the late mornings, trending down towards bedtime.

Needs more data to track how it changes over time.

The screen show here shows the log-viewer and has all the logs selected: so it has bar-graphs diving up into 6 daily blocks, each of which is split and colored by activity and it's height corresponds to wakefulness.

Over that is drawn the heart-rate graph in red and the step-rate graph in blue.

The mood-graph is near the top coz I'm mostly happy. It'd probably clash more with the heart-rate and steps-count graphs for a miserable person, compounding their misery

Turns out I'm not done.

Damnit. It was supposed to be just a January project.

I'm adding another app along side the Mood-log and Monolith-Face for my Pinetime running WaspOS.

The plan is tagging the time of every meal or snack or drink or toke, tracking when you take your meds, or do your exercise, or whatever. User-configured categories.

The screen divides into four so my experimental hierarchy is:

* Food / Drink / Meds / Fun
* Food
* Meal
* Snack
* Sweets
* Cheese
* Drink
* Water
* Sugar
* Caffine
* Alcohol
* Medic
* Allergy
* Pain
* Vitamin
* ??
* Other
* Cigarette
* MJ
* ???
* ???

When the app is triggered it shows the time of last-milestone for each.

The ??? are empty for now. Tempted to put like LSD and MDMA in there but I've done them so infrequently it'd be not really worth tracking.

One day in and I'm liking knowing when I last fetched a glass of water or ate a snack with confidence. Not even importing into the daily graph yet.

What should it be called? "Level Up" seemed like it might encourage alcoholism given "tracking the number of drinks you actually drink" was part of the plan.

Working title is "milestone" mostly just for the alliteration of "Mood" and "Monolith" and "Milestone".

If you had a 2x2 menu of buttons to mark time-stamps that you could program into your watch, with as much recursion into sub-menus as you needed, how would you set yours up?

@pre I believe it is possible to read data from the screen. At least, it's possible to read the current scanline so that probably means it's possible to read other data like RAM too.
I had to bitbang SPI to get it working though:
https://github.com/aykevl/board/blob/main/board-pinetime.go#L209

... whether this is a good idea is a different matter.

board/board-pinetime.go at main ยท aykevl/board

Experimental board abstraction for TinyGo. Contribute to aykevl/board development by creating an account on GitHub.

GitHub
@ayke Well that definitely sounds too complicated then. Phew!