Pi-lapse part 2

By | March 19, 2014

This is mostly meant as a tracker for issues I’m seeing and/or solving. Sorry for the poor format and randomness

Unstable USB and feeble wifi
So the wifi on my pi seems to be unstable at best. My current suspicions are all centered around power on the bus. Since I have not only a fairly hi-res usb cam, but also the wifi, and no powered hub for it all, I’m guessing that the bus just gets unstable. I tried a bunch of tricks for things like tweaking power management, similar to what they are talking about here:

None of this seemed to work really. My ultimate solution was to run a cat6 cable to the thing, which sucks. But the results are exponentially better. The Pi is much more stable (it was often unresponsive, and logs showed it just died every 12-30 hours). I can’t say I’m elated, but at least the setup seems stable now. In the future maybe I’ll experiment with a powered hub instead, but tech in Europe is 2x the cost, and with all the challenges of finding the “right” kind of powered hub, I don’t wanna bother

One other item I haven’t even really looked at is the USB cam occasionally disappearing. I’m not sure if it’s related to the device being damaged by weather given my poorman’s lame weather proofing, or if it’s USB power related, but it occasionally vanishes from the known device list. Recovery often includes both a reboot and/or unplugging/replugging the device.

Immense number of files
I always forget how bad filesystems fall down with lots of files. It’s much more obvious given a single proc, low memory “slow” system. 🙂 Even with all the instability I’ve experienced (meaning shots lots for hours, or even days) and this project only being a couple months old, I still have 6400 photos from the picam, and about 17k from the logitech. Not only is a simple command like “ls” challenged by this, but given so many photos a lot of the timelapse construction tools seem to struggle as well.

Today I decided to add a house keeping cron to make sure that files were sorted and divided up by date. It runs at *:55. Nothing amazing really, but it seems to work, and I don’t think I’ve lost any data yet. 🙂


@pi-bit ~/bin $ more timelapse-housekeeping.sh
#!/bin/bash

# sort and clean my multi-day time lapse stuff into buckets of more reasonable size
TopLevel="/mnt/AnselAdams/TimeLapse/Paris/AveDItalie/"
cd ${TopLevel}
for j in $(ls -1); do
cd $j
for h in $(ls -1 | sed 's/-.*//g'); do
if [[ ! -d $h ]]; then
mkdir $h
fi
done
for h in $(ls -1 ); do
if [[ ! -d $h ]]; then
dir=echo $h | sed 's/-.*//g'
mv $h $dir/
fi
done
cd ${TopLevel}
done