I’ve setup emonSD on a raspberry pi3 i had laying around here to use instead of using the emoncms cloud version. Reason was that i created too many feeds and even have more now on the local version so i switched to a local install.
But i attached a 16GB usb stick to the pi and I (re)mounted /dev/sda1 (usb stick) to /var/opt/emoncms by editing fstab as i know SD Cards can fail. I did that by also creating an EXT2 file system on the usb stick and copying the initial contents of /var/opt/emoncms/ of the clean “install” to it and applying same ownerships to the directories and so on. Initially i used FAT32 but i noticed certain parts of backup (like restore) failed then so eventually went on with EXT2 as well and that seems to be working fine.
I also edited settings.ini (settings.php did not exist at all) of emoncms to make the redisbuffer be 30 seconds instead of the default 300 seconds since an usb stick is less or not even prone at all to wear out.
I wonder if i can do anything else besides lowering the feedwriter sleep to be 30 seconds (or can i set it even lower ?) since i don’t really need the low write anymore because of the usb stick. The reason i did this was to make sure in case of power loss that i still got most of the datapoints written to the feed files, with the default 300 seconds i guess data could be lost in case of a power outage.
or is there are a reason i should have left it at the default 300 seconds mark ?
You’d be surprised - with the screen off, they are really efficient. I combined the systems from several Pis onto my PVE setup.
Right now, my work laptop (i5) is drawing 10W with screen on (spinning disc). I did measure my PVE laptop when I first set it up (it replaced an HP Micro Servr that was a power hog) and power draw was in single figures with 6 containers running. That was with a spinning disc. I fitted an SSD a while back.
10 Watt is indeed not much was not aware they draw so little, can’t remember exactly how much my nuc drew will have to attach it again some time but i think it was more than that. The problem will be to find a good old laptop that does not draw much power. After work i’ll check my nuc again and maybe install linux on it. I was running an old emoncms install on windows before but i got a feeling a linux install would draw a little less i also had plenty of external harddisks attached to them so that could have increased the power draw as well. I’ll do some testings after work but it’s good to know old laptops can be a good replacement for it
I was lucky I had a couple of old ones here and some spare memory chips.
If you are going to use it, I’d just install PVE, then run emoncms in an LXC container. Some one pointed me to this guy recently - Proxmox Helper Scripts | Proxmox Scripts For Home Automation for easy to use scripts - install Ubuntu then use the OEM emonscript to install emoncms. Running PVE will draw much less power than Windows (even if in a container or VM). Spinning Discs draw a surprising amount of power as well.
I installed it on my nuc and i already switched out one raspberry pi which was running pi-hole for a LXC container, it also runs a twitter bot and my python script to read out my wall plugs (wemo insights + meross plugs) and send it to emonpi. I still have to create an LXC container for emoncms and do its install but i’m just wondering how much ram and space did you assign for your container for emoncms ?
Ps on a side note power usage of nuc is really good, in windows it was hoovering around 10-15 Watt idle (but it was never really idle) with PVE it’s hoovering around 7-10 with one container running. Here is a small graph where the lower values are running the raspberry pi and the higher values the PVE, ignore the huge gaps i was having problems with my monitoring script and SSDP but i managed to fix it by disabling igmp snooping on the PVE. This is just a simple, very old nuc 5 i5RYH. So the power usuages i had seen under windows before was from having attached 4-6 extra (platter) disks, so i can replace 2-3 pi’s with it and i get about the same power usage and it’s in line with what you saw on your laptops.
For installing pihole and home assistant yes from the site you gave me.
Yes i did all that already actually, could not wait i more or less have the same config except i assigned 1 GB of memory to use but i might lower it to 512MiB as well then and might have overdone it on the space requirements i assigned about 24GiB total.
I also noticed judging from the picture above the swap is not needed yet or not being used not sure if thats an error or it’s just not needed (yet) with 1 GB assigned
But will see i currently have 3 containers running emoncs, pihole (where also a twitter bot and my wemo + meross polling script is running on to send data from those plugs to emoncms) and home assistant and its hoovering around 7-9 Watt constantly, but there’s still plenty of cpu resources to use and i’m not sure i’ll install anything else.
initialy i tried ubuntu-22.10-standard_22.10-1_amd64.tar.zst but during creation of the pxt i’ve gotten error that said unsupported system so then i tried ubuntu-20.04-standard_20.04-1_amd64.tar.gz and that went fine for creating the pxt. The OEM script also worked fine as far as i could tell, it did not report any errors. The only difference i noticed compared the version that was running on the pi is this screen
on the pi it showed selections all set to master, i still can choose master / stable for some reason it does not seem to remember it when going back to that page. So not sure if it that could be related to the install script or something else.
I also got the emoncms sensors (which i initially created a very long time ago) working in home assistant, its crazy how much home assistant has improved (i was still using a very old version before). So i can use the energy thing in home assistant as well (all i provided it was a cumulating KWH feed which i grabbed using the emoncms component from the local emoncms instance)
One benefit of using a large partition with a relatively small amount of data is your USB stick will last
longer. Wear leveling will spread the writes over all of the allocated space, thus avoiding repeatedly writing data to the same part of the storage medium.
I actually am not using the usb stick setup anymore but the same system as borpin is using proxmox pve to be able to setup vm’s and linux containers. I replaced all my raspberry pi’s with just a single nuc running proxmox pve and there i created multiple containers to do what my rapsberry pi’s used to do (including one for emoncms / oem) it’s also easy to make backup of these containers. We kinda veered of to a switch from usb stick install to containers under proxmox pve
But yes you are right a bigger file system might improve things for usb sticks.