Software
The board itself does not have a controller and therefore no firmware. Here you can find some useful hints and code snippets to control the board. Until now, I only used Bash scripts.
Bash Scripts
The direction of the I/O pins is already defined in the EEPROM. To make them usable by a bash script, we have to export them:
Then you can set and reset the pins like this:
Here you can also see how to generate pulses for the relays. The first sleep of two seconds guarantees that the storage capacitor is charged. Then we switch on the driver and generate the pulse time with a 50 ms sleep. Then we can switch off the driver again.
The timing via sleep is sufficiently accurate even in bash. For creating the measuring pulses and measuring the time, bash wont suffice. You would need a precise timing and resolution in a µs range. I did not try this until now and I don't know if thats even possible on a Pi, at least with raspbian.
It is important that only a single coil of a single relays is turned on and to wait two seconds before the next action to be sure the storage capacitor is fully charged again.
Cron Script
Being a system constant value, the NAS disk is defined by its UUID. This avoids to accidentally mount the wrong disk (/dev/sdx) as the NAS drive. But in /proc/mounts it will appear as sdx. $(/bin/readlink -e $d) helps finding the right match where $d is the UUID link (/dev/disk/by-uuid/<UUID>).
Backup Script
The backup script itself is kind a longer so I made a separate Page for it.