openlumi / homeassistant_on_openwrt

Install Home Assistant on your OpenWrt device with a single command
MIT License
157 stars 43 forks source link

No space left on device #15

Closed dsultanr closed 2 years ago

dsultanr commented 2 years ago

Trying to install on a fresh OpenWrt and getting an error: No space left on device. But there is more than 6 Gb free space. Any thoughts?

here is the full log

image

devbis commented 2 years ago

Hi! pip downloads files to the /tmp dir on install and it is mapped to RAM. You have 64MB available which could be not enough for installing and running Home Assistant. If you are sure you can try this suggestion http://naoko.github.io/pip-install-no-space-left/

export TMPDIR=/root
wget ...
dsultanr commented 2 years ago

Thanks for a quick reply!

My board is KN-1710. I believe it has 128 MB RAM. But I have flashed a firmware for Keenetic Extra II because only that model is available in OpenWrt. Could this be the case of 64 megabytes only RAM available?

пн, 9 мая 2022 г., 23:24 Ivan Belokobylskiy @.***>:

Hi! pip downloads files to the /tmp dir on install and it is mapped to RAM. You have 64MB available which could be not enough for installing and running Home Assistant. If you are sure you can try this suggestion http://naoko.github.io/pip-install-no-space-left/

export TMPDIR=/root wget ...

— Reply to this email directly, view it on GitHub https://github.com/openlumi/homeassistant_on_openwrt/issues/15#issuecomment-1121542311, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAM3AFBKC5GICOJJBQ6T4L3VJFYBFANCNFSM5VOIA7KQ . You are receiving this because you authored the thread.Message ID: @.***>

devbis commented 2 years ago

I think /tmp uses 50% of RAM, but as the limit. So it could work with your setup. But I'm not sure, the latest versions require more memory for installation.

dsultanr commented 2 years ago

I have already installed HA and planning to use this install as a central unit to control home automatics. Mostly for Temperature sensors and relays. Is the HA on a such boards reliable? Do you have any long term experience?

devbis commented 2 years ago

It has some restrictions, usually memory limits and you have to control memory consumption, like enabling history only for specific devices. But basically, it works as a 'big' standalone installation.

dsultanr commented 2 years ago

Thanks. Do you have ocassionaly an experience with a Node-Arduino-Firmata on OpenWRT? It could be a less consuming alternative to HA

lmahmutov commented 2 years ago

for install on small ram device first increase tmpfs mount -t tmpfs -o remount,size=1G tmpfs /tmp

AapoTahkola commented 2 years ago

I had to use this because there were some odd looking errors in home-assistant.log . I have already destroyed all evidence so someone else with a fresh install is going to have to try. If there is need for future options during install just cut 'n' paste. I crafted the scripting style with that in mind. Busybox shell switch syntax burns my eyes.

#from https://stackoverflow.com/questions/40395894/calculate-percentage-of-free-memory-using-bash-scripts-in-linux

memtotal=`cat /proc/meminfo | grep MemTotal | awk '{print $2}'`;
min_mem=$(( 256 * 1024 ));
ram_resize_cmd="mount -t tmpfs -o remount,size=1G tmpfs /tmp";

if [ $memtotal -lt $min_mem ]; then
        echo "Looks like you have less or equivalent to $min_mem kb of RAM memory."
        echo "Installation will most likely fail unless /tmp is resized."
        echo "Select y to resize /tmp. This change will be effective until next reboot."
        echo "This will run '$ram_resize_cmd'"
        echo "Select n to continue without resizing."
        echo "Select q to quit."

        read reply
        #echo "$reply"

        if [ $reply == "y" ]; then
                eval "$ram_resize_cmd"
        fi

        if [ $reply == "n" ]; then
                echo "Continuing."
        fi

        if [ $reply == "q" ]; then
                exit 1
        fi

fi
AapoTahkola commented 2 years ago

I actually think first running HA might cause some more pip commands to propagate needing more /tmp mem so it might still fail. Having /tmp resized in /etc/rc.local sounds like a bad idea so I think it would be better if HA would start immediately after installation instead of asking to reboot. Asking users to reboot is so lame on linux anyway as there is almost never actual need for it.