Hassio crash when adding more then 5 Gpio Outputs

Greeting all,
I have only discovered HA about a month ago. Super awesome system.
My setup is as follow:

  • RPI 4 1GB
  • 16GB Class 10 Sandisk card
  • 3A RPI Power adaptor
  • Hassio 0.98.5
  • Connected through Cat5e

Addons:

  • Configurator
  • duckdns
  • SSH

I am trying to connect 2 x 8 way relay boards to the GPIO pins. Problem I have is that as soon as I add more then 5 ports in the configurator.yaml file and restart, HA crash. The pi starts up and network light flickers but can not get any access to the pi. No access to the WebUI or through SSH.

I can add 5 ports and restart with no problems. Set them up in lovelace and they work. Only after trying to add more. Just one more, then restart and then it crashes.

I then have to reformat the card and start again.

It gets added as a basic gpio switch, nothing fancy.

Has anyone else had a problem similar?

You could be exceeding the pi’s gpio current rating. It has a combined current limit of something like 50mA total for all gpios. If you are drawing 10mA per relay port that would do it.

Hi tom_I,
The problem is that it happens before I have the relay boards connected. Just the setup gives problems.
I currently have a Pi Zero W running the 16 relays using PiRelay without any problem.

Paste your correctly formatted config here.

If you have a spare SD card, try Raspbian on the spare card, and see if you can have more than 5 x GPIO’s

Raspbian even comes bundles with Node-RED if you want to quickly try out the GPIO’s :slight_smile:

Here is the current code:


# Configure a default setup of Home Assistant (frontend, api, etc)
default_config:

# Uncomment this if you are using SSL/TLS, running in Docker container, etc.
 http:
   base_url: https://xxx.duckdns.org:8123
   ssl_certificate: /ssl/fullchain.pem
   ssl_key: /ssl/privkey.pem

frontend:
  themes: !include themes.yaml

# Text to speech
tts:
  - platform: google_translate

group: !include groups.yaml
automation: !include automations.yaml
script: !include scripts.yaml

#GPIO Pins
switch:
  - platform: rpi_gpio
    ports:
      2: Relay1
      3: Relay2
      25: Relay3
      15: Relay4
      27: Relay5
    invert_logic: true

Keep in mind that no relay boards is connected yet.
I have tried with 3 different sd cards, one that is brand new.

Which pins are you attempting to use for more than 5 ports?

I’m trying to use GPIO 21, 22, 27, 28, 29, 25, 24, 23, 15, 16, 2, 4, 6, 5, 10, 11.

I have tried with 3 different sd cards, one that is brand new.

Have you tried Raspbian at all?

Looks ok to me.

Do you have an older pi you can try it on?

If you can prove it’s an issue with only the pi4 or all pi images it might help narrow the problem if you raise an issue on github.

Okay. Seems to be a rpi4 issue.
First I downloaded the latest version of hassio 0.99, and with no extra configurations tried to setup the gpio pins. No luck.
Tried it with a different sd card. No luck.
Reformated the sd cards and tried it in a different pi4. No luck.
Downloaded the pi3 version and loaded it on a pi3. Works perfect.
Seems to be an issue with either the pi4 or the image.
No i’ll just use the pi3 for ha.
Thank you all for the help.

1 Like

You should raise an issue so it gets fixed:

You could have a defectlive RPI4 - I would check if the GPIO’s are functional using Raspbian before jumping to conclusions. :slight_smile: