Fix writing to sd card every second

Fix writing to sd card every second.
Change pid and dat file locations from /var to /run.
Add info on build dependencies.