Ability to edit /boot/config.txt in HaOS directly (from RBi)

Since the recommended way to install Home Assistant on a Raspberry Pi is using HaOS (Raspberry Pi - Home Assistant) I think it should be possible to edit /boot/config.txt directly from the Web GUI (and then reboot for changes to take effect).

It would create a much smoother way to get things like Zigbee or Z-wave devices to work, since some require corrections to config.txt in order to work.
I say much smoother, because you wouldn’t have to shutdown the RB, take the SD card to another machine (presuming you have a machine that can mount it), make corrections, put SD-card back in the RB and boot up again, hopefully with a working config.
If editing was possible directly from HaOS, all you had to do was, open the editor, make corrections and reboot. done.
It could also be used to check the validity of the config before rebooting.

Best regards
Ian

Agree, in the meantime can someone point out how to mount /boot via the ssh/terminal add-on?
I read about the option of pulling the sd-card and editing it on another machine but I would rather not go down that road again.

Being a Macuser I did not have the choice of using another machine, so I found a rather technical solution described here: Debugging the Home Assistant Operating System | Home Assistant Developer Docs

  • I created a SSH key using ssh-keygen
  • Formatted an USB drive with FAT32, named it CONFIG and
  • Put the ssh-key into a file called authorized_keys (command: cat id_rsa.pub > authorized_keys)
  • put the file authorized_keys onto the USB drive as the only file.
  • Chose “Import from USB” from Supervisor system page
  • Could now ssh to device using “ssh [email protected] -p 22222”
  • Edit the config.txt file by command: “vi /mnt/boot/config.txt”
  • Pressed i to enter insert mode
  • Made my changes
  • Pressed ESC followed by :x (to save file and exit)
  • Reboot HA for config.txt changes to take effect.
2 Likes

Hello
Now with the new interface…I don’t find the place to import from usb.
Do you know where is?

Thanks

I find it
Is in Configuration/System/Host (3points)/Import from USB

Now works

Thanks

The connection works but is telling me “permission denied (publickey)”

I made the key with GIT in Windows and all looks fine
Just ask me the place to save the files and if I want a Paraphrase…I need Paraphrase? I made with it or without it but all the same

Thanks

Is this still working? every thing i try gives me an error “port 22222 is already in use on this host”
Do i need to use an extern ssh client?

EDIT: connect to port 22222, do Not set port 22222

Just in case someone else stumbles upon this and wants to try it an alternative way:

You can also edit the config.txt by mounting the sd card to another system. From my mac, I inserted the microsd into the adapter into the port. Then I used diskutil command to find which disk it was diskutil list. There will be a lot of partitions- but the first partition will be the one that has config.txt. In my case, this was /dev/disk4s1 (symbolizing disk 4, first partition)

diskutil mount /dev/disk4s1 will mount the disk so you can see it under “Locations” in finder. Double-click ‘config.txt’ and just edit the bottom of the file with the following:

dtoverlay=dwc2,dr_mode=host

Be sure to eject the disk at the end

diskutil eject /dev/disk4

I try your guide but it show:

Volume on disk4s1 failed to mount