m.a.r.i.n. hacklab at the sea

A few days of summertime in the Finnish archipelago at the M.A.R.I.N. hacklab at the sea.

This experience included a lot of swimming in the sea, saunas, boat activity and simply exploring the environment, but the hacking seemed to fit in surprisingly well with this routine.

Having the privilege of being in such a place makes you aware of your footprints. With only renewable power resources available, I wanted to lower the power consumption of my computer to extend its battery life. I came across some useful instructions from the ubuntu wiki and from that discovered powertop which I can’t recommend highly enough.

This is the script I’m currently using to switch everything to low power mode, cobbled from the resources above.

# Set CPU scaling / max freq to battery mode

for x in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor; do
    echo "conservative" > $x
    # The second column is the second from the highest freq most power savings / least slowdown
    awk '{print $2}' $X/scaling_available_frequencies > $X/scaling_max_freq

# Tweak virtual memory to conserve power when running on batteries.

echo 10 > /proc/sys/vm/swappiness
echo 0 > /proc/sys/vm/dirty_expire_centisecs
echo 1500 > /proc/sys/vm/dirty_writeback_centisecs
echo 60 > /proc/sys/vm/dirty_background_ratio
echo 95 > /proc/sys/vm/dirty_ratio

# Enable SATA ALPM link power management via:
echo min_power > /sys/class/scsi_host/host0/link_power_management_policy

# Disable 'hal' from polling your cdrom with:
hal-disable-polling --device /dev/cdrom
# 'hal' is the component that auto-opens a
# window if you plug in a CD but disables SATA power saving from kicking in.

# Change the wireless power mode to Battery.

for x in $(/bin/ls -d /sys/class/net/*/wireless | /usr/bin/cut -d'/' -f5); do
    /sbin/iwconfig $x power on power period 2 power timeout 300u
    /sbin/iwpriv eth1 set_power 7

I worked a little more on plant sensing, trying a simple approach of testing the electrical resistance of parts of growing plants with a sensor boosted to extremely high sensitivity. This area is fairly rife with pseudoscience, but has some basis in reality. I was quite surprised to see some changes between the values from a real plant and a dead twig, or air, with distant electrodes – but this requires a scientific test in controlled conditions, and any variation is most likely due to changes in the temperature of the wood with sunlight changes.

Returning to power consumption, it was a good opportunity to build a solar engine, which is a device that collects low currents from small solar cells and periodically dumps them into a circuit which requires a higher current (usually a motor). It should be possible to use this approach to drive self powered microcontrollers for limited bursts of activity, making their state persistent and cleanly shutting down on the low power interrupt, waking up the program where it stopped when new power is available. This could be useful for a remote device running for months or years from a very small power source.

I could only attend the first couple of days, so I’m really looking forward to seeing the results from the other projects being worked on.

One thought on “m.a.r.i.n. hacklab at the sea”

Leave a Reply

Your email address will not be published. Required fields are marked *