Translated from Türkçe by AI ·
I don’t think it’s power, it’s exactly the situation you described. At startup the Pi initialises GPIO0-8 with the internal pull-up (HIGH) and GPIO9-27 with pull-down (LOW). Your pins are all in the 9-27 range, so until the script runs they are LOW. The board is active-low, so LOW = relay energised = valve open. We had the same thing happen on the test rig in our lab.
There are two fixes, doing both together is the most robust:
1. Add a line to /boot/firmware/config.txt that sets the pins as outputs driven HIGH early in boot, without waiting for the script:
gpio=22-25=op,dh
This is applied at firmware stage, but a very short LOW may still occur at the very first moment of power-up. So:
2. Put a 10k pull-up resistor from each relay input to 3V3. That way the input stays HIGH even when the Pi is not driving it at all.
Also, on the Hermetry side, have the script send the valve states as telemetry such as valve1_open: 0, so after an outage you see the real state on the dashboard.
Güç değil bence, tam tarif ettiğin durum. Pi açılışta GPIO0-8’i dahili pull-up ile (HIGH), GPIO9-27’yi pull-down ile (LOW) başlatıyor. Senin pinlerin hepsi 9-27 aralığında, yani açılıştan script çalışana kadar LOW. Kart aktif-low olduğu için LOW = röle çekik = vana açık. Bizim lab’daki deney düzeneğinde aynısını yaşamıştık.
İki çözüm var, ikisini birlikte yapmak en sağlamı:
1. /boot/firmware/config.txt dosyasına pinleri boot’un erken aşamasında çıkış + HIGH yapan satır ekle, script’i beklemez:
gpio=22-25=op,dh
Bu firmware aşamasında uygulanıyor ama yine de güç verildiği ilk anda çok kısa bir LOW kalabilir. O yüzden:
2. Her röle girişinden 3V3’e 10k pull-up direnci koy. Böylece Pi hiç sürmezken bile giriş HIGH kalır.
Bir de Hermetry tarafında script açılışta vana durumlarını valve1_open: 0 gibi telemetri olarak göndersin, kesintiden sonra panoda gerçek durumu görürsün.

