Categories
Website

Vitals Recorder – For the sick days

Since I joined uni in London, I’ve fell sick a few times.
I have this habit of logging my temperature (something from my family) so its easy to report to a GP, and easy to remember when you last had medicine.

I have been using Google Keep as this scrongled way of logging my temperature, but that seems a bit inconvenient; So I look around Google Play Store — and nothing much (in 2019).

Then I remember this isn’t my first rodeo with fevers, and I had been working on vitals-recorder to log temperatures.

Here it is – https://bd.kekvrose.me

It was incomplete, with quite unusable issues, so I went on to complete it. Atleast the smallest bit of it. Try it out maybe!

What’s the thing?

Well, its to track your temperature, as and when you need. It can also log BP, sugar levels, SPO2 (in case you have that kind of fever) and a small description. I usually just log any pills I’ve taken at that time.

Very simple to add and edit. Plus, if you don’t like Fahrenheit, you can seamlessly use Celcius instead.

As visible, you can also export this data out as JSON, if you decide you want to use something else. The format is not too complicated to wrangle, and its documented here – Items.ts. The JSON is an array of items.

Completely offline

Well, the best part is this “app” is that its a PWA. This means it will work offline from the time you first open the website, and you can “install” it on your phone/desktop and it will function similar to a “native” application.

Not the best name but hey it works.

The data’s all stored locally (IndexedDB) and never leaves your device. In fact, since its completely local, there’s no server side processing and its hosted completely on Github Pages.

Summing it up

Well, here’s a nifty tool in case you want to log any vitals. Feedback is always great to have, so do try it out and let me know!

(Psst: Link is at the beginning of the post)

Categories
advpi

advpi – Week 8 – MMIO

After a(nother) long break, I have decided to work in small features. This week was mostly adding MMIO handlers, ARM test code compiling and changing out logging.

MMIO

Well, it was already there, but I didn’t have any easy way of using it. I added a modular system to register and track MMIO request handlers, and then each handler, can implement its own logic for handling any MMIO request!

So what does this mean?

We can now delegate parts of MMIO to other bits of code to make this happen.

Code building

Getting tired of writing in ones and zeros (what a long forgotten issue) — I turned to assembling code.

A quirk of the process is that I need raw code, as a binary blob, and not the ELF binary that as (the GNU Assembler) provides.

This led me to a well-accepted solution from the interwebs:

as one.S -o one.intermediate.bin
objcopy -O binary one.intermediate.bin one.bin

But then, I saw this wonderful issue: where I realised that the as installed in my RPi was for ARM8, and for 64 bits. The easiest way to turn to 32-bit compilation was (arguably not easier, but less of a headache) to install the gcc-arm-none-eabi package, and use its as.

So with that out of the way, we can quickly create up an example program, and get:

mov r0, #0x10000
mov r1,#0x1000
mov r2,#0x4500
ldr r3,[r2]
add r1,r2,r3
str r1,[r2]
WFI

I’m not sure how to get a HALT or equivalent out of the machine, but I get these wonderful logs if I run the machine twice (two exits from MMIO; one for the ldr and one for the str):

Yay! MMIO works, and the logging handler receives it.

Logging

As evident above, working with logs is getting a bit tedious, especially from using cout and printf, so I linked up this wonderful library spdlog to handle the logging.

So with this, I can tweak the log levels to see the data I want, and more importantly, the logging api to define them is much cleaner.

Summary

There’s a lot more things to do, but I will probably have to read more to understand which section can be tackled next. It might be a good idea to have a look at the Timers and Interrupts before going onto other topics.