Fresh HA Core Installation on ARMv7

Damn, I actually managed to do it! :woozy_face: :rofl: I installed a package (first line under), and then rebuilt Python 3.10.9 and made a new virtual environment. Here is my full Python 3.10.9 build (the -j 4 is nice, it makes the Pi use all cores, so the build takes a lot less time):

sudo apt install libsqlite3-dev
sudo apt install libssl-dev libncurses5-dev libsqlite3-dev libreadline-dev libtk8.6 libgdm-dev libdb4o-cil-dev libpcap-dev
wget https://www.python.org/ftp/python/3.10.9/Python-3.10.9.tgz
tar -xf Python-3.10.*.tgz
cd Python-3.10.*/
./configure --enable-optimizations
make -j 4
sudo make altinstall
reboot

Then I did the steps from your tutorial, with one extra step for cargo (to make building cryptography work):

sudo apt-get install -y python3 python3-dev python3-venv python3-pip bluez libffi-dev libssl-dev libjpeg-dev zlib1g-dev autoconf build-essential libopenjp2-7 libtiff5 libturbojpeg0-dev tzdata libncurses5-dev libsqlite3-dev libreadline-dev libtk8.6 libgdm-dev libdb4o-cil-dev libpcap-dev

sudo apt-get install python3-dev cargo
sudo mkdir /srv/homeassistant
sudo useradd -rm homeassistant -G dialout,gpio,i2c
sudo chown homeassistant:homeassistant /srv/homeassistant
sudo -u homeassistant -H -s

Then, finally, as home assistant user:

cd /srv/homeassistant
version=3.10
python$version -m venv .
source bin/activate
python3 -m pip install wheel
pip install --upgrade pip
pip install sqlalchemy
pip install fnvhash
pip3 install homeassistant
hass

And that seems to have done the trick, the only error message I get now is that ZWaveJS is too old, which should be easy to remedy. I will now fix that with a new install of that. Then I’ll go back to the image I did before this, follow my own instructions and see if it works twice. In case it doesn’t I’ll of course keep an image backup of this working setup.

Second attempt gave the same result, so it seems like this is a working method, at least for me! :+1: :grin:

This is what I was able to get to work

I see. I didn’t really look at that one, because I don’t need touchscreen or kiosk. I just saw in your main tutorial post that the core regular installation for Rapsberry Pi didn’t yet work.

The kiosk doesn’t effect headless installation

Actually I’m not doing headless, I’m doing VNC and GUI. I just checked your thread Home Assistant Core install and upgrade instructions

And I saw Clean install HA Core on Raspberry pi OS (NOT WORKING YET)

So you have monitor mouse and keyboard board connected to the raspberry pi? The instructions should still work

No, VNC, as I said. I use that from my PC and work in the GUI on the Pi. I just meant that I thought you hadn’t managed to get it working yet since the main community guide thread says “not working yet”.

Fair enough glad you got it working

1 Like

Didn’t work long, though… A few days on, and I am back to an old “friend”, which forced me to go Docker on most of my Pi’s last year:

2023-02-01 11:41:06.544 ERROR (SyncWorker_1) [homeassistant.util.json] Could not parse JSON content: /home/homeassistant/.homeassistant/.storage/core.entity_registry
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.10/site-packages/homeassistant/util/json.py”, line 39, in load_json
return orjson.loads(fdesc.read()) # type: ignore[no-any-return]
File “/usr/local/lib/python3.10/codecs.py”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf8 in position 2248: invalid start byte

And that line, 322, is " “translation_key”: null,". I guess I’ll have to go back to Docker. This time I have set up the Car Pi with the new network manager system, so maybe I won’t have to struggle with the access point now.

Are you on a SD card?

Yeah. I did use USB SSDs a while back, but I dropped them because the newer Endurance cards are very reliable, compared to older stuff.

Hmmm I think I would try a new card

I can try that now. I have come to the point on yet a new setup where I was going to install Docker, but I have made an image backup so I can first try to repeat the installation of core, with Python 3.10. I have the bash files, so I don’t have to copy in the commands from scratch, I can do it in batches, which saves a lot of time.

Different card, slightly diferent error, same problem. Core has gotten a real mess the last half year, amost like they are trying to force people to Hassio or Docker.

hass
2023-02-01 20:41:47.872 ERROR (SyncWorker_1) [homeassistant.util.json] Could not parse JSON content: /home/homeassistant/.homeassistant/.storage/core.area_registry
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.10/site-packages/homeassistant/util/json.py”, line 39, in load_json
return orjson.loads(fdesc.read()) # type: ignore[no-any-return]
File “/usr/local/lib/python3.10/codecs.py”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf8 in position 795: invalid start byte
2023-02-01 20:41:47.881 ERROR (SyncWorker_3) [homeassistant.util.json] Could not parse JSON content: /home/homeassistant/.homeassistant/.storage/core.entity_registry
Traceback (most recent call last):
File “/srv/homeassistant/lib/python3.10/site-packages/homeassistant/util/json.py”, line 39, in load_json
return orjson.loads(fdesc.read()) # type: ignore[no-any-return]
File “/usr/local/lib/python3.10/codecs.py”, line 322, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xf8 in position 2225: invalid start byte

Edit: I deleted the storage folder and copied everything else to the new setup, this time it worked. Maybe there was an error in the core.entity_registry format, or something?

Nah, a few reboots, and it complains about another file:

feb. 01 22:05:03 mastiffmobilen hass[1429]: File “/srv/homeassistant/lib/python3.10/site-packages/homeassistant/helpers/storage.py”, line 143, in _async_load_data
feb. 01 22:05:03 mastiffmobilen hass[1429]: data = await self.hass.async_add_executor_job(
feb. 01 22:05:03 mastiffmobilen hass[1429]: File “/usr/local/lib/python3.10/concurrent/futures/thread.py”, line 58, in run
feb. 01 22:05:03 mastiffmobilen hass[1429]: result = self.fn(*self.args, **self.kwargs)
feb. 01 22:05:03 mastiffmobilen hass[1429]: File “/srv/homeassistant/lib/python3.10/site-packages/homeassistant/util/json.py”, line 45, in load_json
feb. 01 22:05:03 mastiffmobilen hass[1429]: raise HomeAssistantError(error) from error
feb. 01 22:05:03 mastiffmobilen hass[1429]: homeassistant.exceptions.HomeAssistantError: ‘utf-8’ codec can’t decode byte 0xf8 in position 25384: invalid start byte
feb. 01 22:05:03 mastiffmobilen systemd[1]: [email protected]: Main process exited, code=exited, status=1/FAILURE
feb. 01 22:05:03 mastiffmobilen systemd[1]: [email protected]: Failed with result ‘exit-code’.
feb. 01 22:05:03 mastiffmobilen systemd[1]: [email protected]: Consumed 2.749s CPU time.

And this is yet another card. So this is just about the same I had in this thread:

Docker next, I’m afraid.

Try doing a. Clean install using tutorial including the python update

do a clean image of raspberry pi and do all the updates reboot

then do this

reboot

then do this follow carefully

I just fired up my test raspberry pi and it is running core installed via the instructions I posted and I just updated it to the latest HA 2023.2

and it is working wants to configure a bunch of my smart home stuff

I did notice that it takes a while to load up from the update but I am use to running on a I7 PC so the pi performance may be normal

Yeah, but I’m pretty sure you don’t use any Norwegian characters, æøå, in it. 0xf8 is ø. I have a sneaking feeling that it may be the problem. It’s not reacting to the lines it says, but to lines with special characters in. But I will give it one more try, with the clean image I have saved. Probably won’t have time for that until the weekend, though. I have spent far too much time on this on workdays (but because I work for myself the boss isn’t too much of a problem).

Edit: Even if the errors comes from the storage files, it doesn’t originate there. I can use the installed config when I copy that back. But if I put in a special character in an entity friendly name, an automation or anywhere else, this happens after from one to several reboots. And I’m not going to bow down to “Aapne doerlaas” (Åpne dørlås - Open door lock) and similar names, I’ll go Docker before I do that. I work as a translator, and using Norwegian as it is written is a principle I refuse to drop. :grin:

Ah I understand but the docker version may not like the special characters either as once up and running the interface is the same