I have done with the greatest care the first 5 steps of your guide. In step 6, I run Putty from a second computer (port 22222) and the following message appears: "Network error: Connection refused".( port 22 connects correctly)
My doubts and questions:
1.- In step 3, I copied and saved all the characters of the window using a plain text processor (EditPad Lite) in a file authorized_keys.txt. I saved it in the root directory of a USB drive, formatted with CONFIG.
Is that correct?
2.- In step 5, when you click on the HARDWARE button, the disk section appears the following: /dev/sda and /dev/sda.
Is it correct?
The generated public key must be copied in a file called authorized_keys (without .txt or any other extension). Then copy the authorized_keys file to your USB flash root directory, after that connect this flash to the USB port of your Raspberry Pi and click Import from USB in your hassio WEB interface.
Once it is done, use your private key to ssh to your hassio’s port 22222.
If you use PuTTY, configuration should looke like this:
It is wonderful that in this forum there are people who dedicate their time to help and who have enough patience to attend the queries of newbies.
Following your instructions, I have corrected my mistakes and I have achieved a clear advance. Now I access the Hass.IO console, as you can see in the image.
My problem is that I don’t know how to navigate through the folders, to modify the config.txt file and add the rpi-i2c.conf file.
I’ve typed ‘help’, I’ve tested some commands, but I haven’t been able to find the solution. I resigned to avoid corrupting the whole system.
Do you still have the patience to keep helping?
In any case, thank you very much.
Nice! Now in this console you need to type the command login as it says in it and press the enter key.
After that change directory with: cd /mnt/boot
Then follow the steps #8 and #9 from my solution.
Unfortunately, my lack of Linux knowledge keeps me from moving forward. I’ve gone as far as you can see in the picture.
But, from here, I’m not able to modify the config.txt file or add the rpi-i2c.conf file. I typed help again, but I don’t know which commands to use.
Thank you very much for your patience and help.
I understand it is the right one. However, after rebooting the system, the following error still appears
Wed Feb 20 2019 17:53:29 GMT+0100 (hora estándar de Europa central)
Error while setting up platform bme280
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/smbus/smbus.py”, line 81, in open
self._fd = os.open(path, os.O_RDWR, 0)
FileNotFoundError: [Errno 2] No such file or directory: ‘/dev/i2c-1’
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
SLOW_SETUP_MAX_WAIT, loop=hass.loop)
File "/usr/local/lib/python3.6/asyncio/tasks.py", line 358, in wait_for
return fut.result()
File "/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/bme280.py", line 92, in async_setup_platform
bus = smbus.SMBus(config.get(CONF_I2C_BUS))
File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 56, in __init__
self.open(bus)
File "/usr/local/lib/python3.6/site-packages/smbus/smbus.py", line 83, in open
raise IOError(e.errno)
OSError: 2
The installed sensor is the original Adafruit sensor, which always uses the 0x77 address (I checked it in a direct installation in another Raspberry). I also checked the jumpers connections.
I think I will desist from enabling this sensor in Home Assistant. But your patience and help have allowed me to learn new things and move forward. Again, thank you very much.
Looks like there is a formatting issue - when you copy the command here, it copies another type of quotation marks. Actually - my bad, I just could have skipped using them in my example.
You can fix your added lines by removing these quotation marks like this:
sed -i ‘s/\“//g’ /mnt/boot/config.txt && sed -i ‘s/\”//g’ /mnt/boot/config.txt
sed -i ‘s/\”//g’ /etc/modules-load.d/rpi-i2c.conf && sed -i ‘s/\”//g’ /etc/modules-load.d/rpi-i2c.conf
Just tested and looks like the same problem is with these commands. You need to replace these “smart” single quotes with the straight ones in these 2 commands above. Hope you can manage it.
After this just make sure the quotes are gone and then reboot
Hello.
I’m trying to make a BME280 sensor work on HASS.IO, but I can’t do it in any way.
I wrote the files mnt / boot / config.txt and etc / modules-load.d / rpi-i2c.conf
but hassio on reboot eliminates them both.
I wrote them both through PuTTY (as ‘root’) and from Web UI of the confugurator in Hassio.
Can anyone help me?
thanks
hi vitaalz,
my PuTTY is configured on port:22222
pubblic and private keys works good, so i have access via SSH to Hassio as ‘root’ but as you can see i haven’t root’s privilege
I don’t know why on the SSH server the port is 22222, but in the log it says ‘… listening on port:22’
and after connection it says other ports… in the picture ‘49483’.
I tryed to see in the hardware with the usb pen ‘CONFIG’ inserted, but Hass.io don’t see the disc /dev/sda
I think you are digging in the wrong direction. You DO NOT NEED to change any network settings of the terminal on web interface. That is not the shell you need to login to. You can revert that setting back to default port (22).
The port 22222 is automatically opened when you successfully load your public key to your hassio. If you don’t see your USB drive as /dev/sda under Hass.io -> SYSTEM -> HARDWARE, you won’t be able to proceed with the key import. So work on that.
First make sure your keys are generated properly as it is described in my instruction. Then put the generated public key into the file called authorized_keys and copy this file to your FAT formatted USB stick named CONFIG. Plug it in your hassio and make sure USB appears in the Hardware list. If it is there, click on Import from USB.
After that use the private key to login to hassio via PuTTY on 22222 (see my PuTTY screenshots in this topic above)
hello vitaalz,
I reinstalled everything from the image ‘hassos_rpi3-2.12.img’,
I generated a new pair of keys with PuTTYgen,
I configured PuTTY on port 22222 with the private key.
I created the file ‘authorized_keys’ without the extension and copied it to the FAT formatted USB named ‘CONFIG’.
in the Hass.io> System> Hardware continues to not appear /dev/sda.
I anyway tried Hass.io>System>Import from USB, but at the connection, via PuTTY, it asks me to log in, and when I type ‘root’, it rejects me because it doesn’t recognize the key (obviously, since I didn’t load it).
according to you, can I write the public key directly on the microSD?
if it is possible, in which directory, or in which file?
A lot of thanks
Well yeah if your USB device does not appear as /dev/sda in the Hardware, then of course you won’t be able to import the public key and will fail to SSH with your private key.
What is your setup? Are you actually using raspberry pi3? What is your Hassio version?
This weekend I will try to check If I can reproduce your situation. Who knows maybe things have changed since HassOS 2.8 and Home assistant 0.87.1 when I was actually doing it myself.
Meanwhile another thing you could try if you are installing hassio from scratch from the image - after you download the hassos_rpi3-2.12.img image, modify its contents before flashing it to your microSD with Etcher. In the image there is a config.txt file. Uncomment/add the following lines to it:
dtparam=i2c1=on
dtparam=i2c_arm=on
Then flash the modified image to the your microSD. I have no idea if this will work. Never tried it that way. But maybe it’s worth trying. Let me know.
I will let you know about the results of my experiments on the weekend sometime soon.
yes, on the microSD I can modify the config.txt file, so I added only the first line that you recommend: dtparam=i2c1=on, because the second one was already without comment.
but on Hass.io owever i don’t see the bme280 sensor
in the configuration.yaml i have this lines
sensor: