Since for whatever reason, this code beats the snot out of the SD card in the pi, I first thought I'd simply use a huge SD card so as blocks wore out - it would last a long time anyway.
I went crazy - I used a 64gb microSD card (this is a pi B+ that likes the micro size). On reflection, that was dumb. Most of the work was setting all this up in the first place, and copying 64 gb with dd like so:
doug@BigNuc ~/Public $ sudo dd if=/dev/sdd of=picam.img bs=4M
takes quite awhile....calender time to be sure, not my time so much if I've got other things to do, but it seems more reasonable to me to just use 8gb cards (cheap), make a couple copies and tape one into the box for instant recovery when one wears out (while also keeping a copy of the image on various big-computer backups just in case). So, what I'm doing now is making an image file (see above quote), which I plan to copy to a far faster USB3 stick, do gparted games with to shrink it down below 8gb, make another smaller image, and use that to burn a couple of smaller SD cards for this. By doing it this way, if it doesn't work, I still have my huge SD card that
does work, and I can try again - for as long as it takes and the original image file on my BigNuc hangs on (it's on a seagate 2tb drive I use for beating on instead of the Crucial 480 gb mSata I use for read-mostly software and stuff).
So, now that the SD image has been copied bitwise (that's what dd does, it's super dumb and literal) - I'm now copying it back to a far faster USB3 64gb stick to play games on, hopefully shrinking the largely unused partition down to where I can burn a resulting shrunken image back to 8gb (or even smaller) SD cards. To do this part of the copy, the original big SD card was removed from the machine and the big USB stick substituted, and the if and of parameters to DD switched. In this case, it's the spinning rust drive that is the speed limit...still a lot faster.
doug@BigNuc ~/Public $ sudo dd if=picam.img of=/dev/sdd bs=4M
is what that looks like on my box. OK, that step is now done, and this time it happened at 104 mb/s....nice.
I'll now use gparted on the big USB stick to try and shrink that comparatively empty partition down to where it will fit on a smaller SD card - might even get it down below 4gb (though my bet is that like other things that seemed big at the time, 4gb cards will slowly disappear from the market. Just try getting 1-2 gb ones for old uP projects that don't support big filesystems...).
Gparted is now telling me it can't keep everything in sync without a reboot, so that I will do - I want this to work (it probably would anyway), and finish this post after I do.
Well, I tried this first, but it still resulted in a 64 gb file after resizing the partitions on the USB stick. It would probably work (we'll see) but I sure am glad I have huge storage on a new and fast machine...
doug@BigNuc ~/Public $ sudo dd if=/dev/sdd of=picams.img bs=4M
So I also tried this:
doug@BigNuc ~/Public $ sudo dd if=/dev/sdd of=picamss.img bs=4M count=1024
Which resulted in the file manager showing a 4.3 gb file (there's all this Gib vs GB junk, even in linux...GiB are the real power of two kind, the others use 1 billion = 1 gb, so this might actually still fit on a 4 gb card if it's really 4 GiB...which I doubt. The whole reason for this crazy unit stuff is marketing so they can sell you a smaller drive and claim it's larger.
Now, we'll see which one works with the Pi, the object of the excercise (and then delete all the big junk off my main machine just for being parsimonious).
No guts, no glory, so I'm trying this first. I should then be able to run raspi-config and take this 4.3 gb image and expand it back out to the full size of the 8gb card, assuming it all works...
doug@BigNuc ~/Public $ sudo dd if=picamss.img of=/dev/sdd bs=4M
It should run out of file before it runs out of SD card. Fine. It seems to be going a little slower than with the larger card, which is no surprise. The way they make these big is to use more flash chips, and the controller in the card uses the more chips in parallel to speed things up. Hopefully, it'll still be fast enough in use (if it works). After all, most use the 4gb flash that most buy along with the Pi...and this is twice that size.
Well, that took awhile...
doug@BigNuc ~/Public $ sudo dd if=picamss.img of=/dev/sdd bs=4M
1024+0 records in
1024+0 records out
4294967296 bytes (4.3 GB) copied, 796.326 s, 5.4 MB/s
And things kept blinking for quite awhile after that. I ran sync just to be sure and waited for it to return, un and replugged in the SD card, and now it looks "right" as far as I can see.
Here's what the smaller SD card now looks like in gparted:
![Screenshot--dev-sdd - GParted.png (47.25 KiB) Viewed 9146 times Screenshot--dev-sdd - GParted.png](./download/file.php?id=1886&t=1&sid=7dd3697d6e6d8430a058efa4076b868c)
- Pre expansion of the last partition, which I may just do here instead of on the Pi, as raspi-config is one of those that doesn't fit on the LCD screen on the pi.
So, it probably worked. I'll test it, but then put it back in the big machine to expand the partition, I think. OK, it works unmodified. Now to expand that partition....and get at least the 8gb on the Pi.
So, I put it back in the NUC and did gparted to expand the main partition and now it looks like this:
![GParted_afterResize.png (42.39 KiB) Viewed 9146 times GParted_afterResize.png](./download/file.php?id=1887&t=1&sid=7dd3697d6e6d8430a058efa4076b868c)
- After expanding to the full SD card size as seen on linux on the NUC.
And now for a test of the thing, and if it works, another copy to tape (carefully avoiding putting adhesive on the contact pins) in the box for quick repairs later. I could have saved myself all this by just starting with the right size SD card, I suppose, but we'll see how things do in practice.
Ok, it works! Here's a test image. Now to make a spare and be medium-bulletproof in real life.
![piTestScaled.jpg (97.63 KiB) Viewed 9146 times piTestScaled.jpg](./download/file.php?id=1888&t=1&sid=7dd3697d6e6d8430a058efa4076b868c)
- Test pic, but this does huge videos too...neato
So, I'm going to declare this one complete at this point, barring the minor tweak here and there. I'm still working with IR block filters for use with the fusor, but that's it's own topic - in fact, the pic above was taken with one in place, since it was a bother to remove it. I now have a standalone box, with wireless, that serves video live, can record that or pictures (also timelapse) on its own card, then allow you to download them from the same webpage. It will also let you change almost everything about the camera - exposture, white balance, frame rate...it won't fit on a single page in my web browser without scrolling there's so many options. And it doesn't need a login or keyboard, or even that fancy LCD screen except to see if there's some error on boot. You don't even have to login for apache to serve all this stuff - but you can either at the pi, or remotely with ssh. Someone asked me just now why I'm not a gamer with so many hot machines. That's because this IS my game...I get more value I believe by creating cool toys than just killing imaginary foes.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.