Skip to content

Conversation

@cretep
Copy link

@cretep cretep commented Jun 1, 2025

Summary

An empty file was being written by cat to:
/config/rtl_433/rtl_433.conf.template

When using cp the contents is present.
Hopefully more multi-arch/futureproof.

Observed in latest add-on image running on HA OS "Generic x86_64":

  • io.hass.base.image: alpine:3.21
  • io.hass.base.arch: amd64
  • io.hass.base.version: 2025.05.0

Alternatives Considered

I haven't dug into bashio scripts to root cause. It's a weird issue as executing the cat section of run.sh with pure bash works fine.

Reproduction Steps of Original Issue

  1. Clean /config/ (ie. no rtl_433/)
  2. Install & start latest rtl_433 add-on (ie. at 037c802 "0.6.0")
  3. Observe rtl_433 binary starts without any config; /config/rtl_433/rtl_433.conf.template directory and file is created but file is empty.

Testing Steps

  1. Clean /config/ (ie. no rtl_433/)
  2. Install, local build, & start rtl_433 add-on
  3. Observe /config/rtl_433/rtl_433.conf.template populated and rtl_433 binary immediately consumes config and logs [rtl_433] MQTT: Publishing MQTT data ...

An empty file was being written by cat to:
  /config/rtl_433/rtl_433.conf.template

When using cp the contents is present.
Hopefully more multi-arch/futureproof.

Observed in latest:
  io.hass.base.image: alpine:3.21
  io.hass.base.arch: amd64
  io.hass.base.version: 2025.05.0
@PaulSD
Copy link

PaulSD commented Jul 18, 2025

The root cause is that the $1 at the end of this comment needs to be escaped as \$1:
# rtl_433 -R help 2>&1 | grep -i tpms | sd '.*\[(\d+)\].*' 'protocol -$1'

Without the escape, bash tries to evaluate that variable while reading the text block (before passing the text block to cat), and because bashio runs set -o nounset, this causes bash to fail/exit.

You can fix this simply by escaping that $1 in run.sh.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants