wilsonmaker
@wilson-m · Temmuz 2025 tarihinde katıldı
Maker · home automation · Nottingham · new to IoT
- Konular
- 14
- Yanıtlar
- 71
- Puan
- 0
Oluşturulan forum yanıtları
Yapay zekâ tarafından English dilinden çevrildi ·
Ha, geçen Ocak ayında sera sensörümle tam olarak bunu yaşamıştım, bu sefer cevap verebilirim!Arduino int değerini iki tümleyen biçiminde saklar. -0,5 °C çarpı 100 eder -50, ve -50 değeri 16 bitte 0xFFCE olur. En üst bit işaret bitidir. İşaretsiz okunursa 65486 eder, 0,01 ile çarpınca 654,86 çıkar. İşaretli okunursa -50 eder, 0,01 ile çarpınca -0,5 çıkar. Baytlar aynı, codec’in bunların işaretli olduğunu bilmesi yeterli.Bu durumda codec’inizde formatı u16be‘den i16be‘ye değiştirin, ölçeği koruyun. Negatif bir değer için bir test vektörü ekleyin ki bu hata geri gelmesin:
{ "at": 0, "field": "temperature", "fmt": "i16be", "scale": 0.01, "unit": "°C" }
"tests": [
{ "name": "positive", "fport": 1, "hex": "0960", "expect": { "temperature": 24.0 } },
{ "name": "below zero", "fport": 1, "hex": "FFCE", "expect": { "temperature": -0.5 } }
]
Arduino tarafında, 32 bitlik bir karta geçerseniz 2 bayt kalsın diye int yerine int16_t kullanın. Sonra Check ve Publish’e basın. Anahtar adı ve birim aynı kaldığı için aynı codec’in yeni bir revizyonu olarak yayınlanabilir. Referans: Write your own codec
Ha, I had exactly this with my greenhouse sensor last January, so I can answer for once!
The Arduino stores int as two’s complement. -0.5 °C times 100 is -50, and -50 in 16 bits is 0xFFCE. The top bit is the sign. Read as unsigned that’s 65486, times 0.01 gives your 654.86. Read as signed it’s -50, times 0.01 gives -0.5. Same bytes, the codec just has to know they’re signed.
So in your codec change the format from u16be to i16be, keep the scale. Add a test vector for a negative value so it never sneaks back:
{ "at": 0, "field": "temperature", "fmt": "i16be", "scale": 0.01, "unit": "°C" }
"tests": [
{ "name": "positive", "fport": 1, "hex": "0960", "expect": { "temperature": 24.0 } },
{ "name": "below zero", "fport": 1, "hex": "FFCE", "expect": { "temperature": -0.5 } }
]
On the Arduino side use int16_t instead of int, so it stays 2 bytes if you move to a 32-bit board. Then Check and Publish. The key name and unit stay the same, so it can go out as a new revision of the same codec. Reference: Write your own codec
Yapay zekâ tarafından English dilinden çevrildi ·
Sonoff Basic’in içinde bir ESP8266 bulunur. 4 pinli başlık üzerinden ve bir USB-seri adaptör ile kendi yazdığınız sketch’i (3.3 V, 5 V değil!) bu çipe yükleyebilirsiniz. Bundan sonra o, sadece başka bir Hermetry cihazı olur.
The Sonoff Basic has an ESP8266 inside. You can flash your own sketch on it through the 4-pin header with a USB-serial adapter (3.3 V, not 5 V!). Then it’s just another Hermetry device.
Yapay zekâ tarafından English dilinden çevrildi ·
Tek kanallı bir ağ geçidi ile normal bir ağ geçidi arasındaki fark nedir? Sadece daha ucuz mu?
What’s a single channel gateway vs a normal one? Is it just cheaper?
Yapay zekâ tarafından English dilinden çevrildi ·
Bugün 1’den 4’e kadar yaptım. Wi-Fi/BT/HDMI kapalı, GPS sabitlemeler arasında kapalı, hareket halindeyken 30 s, park halindeyken 30 min, her 5 dakikada bir gönderim. Ölçüm şu an ortalama yaklaşık 95 mA gösteriyor. Yaklaşık dört gün sürmeli. Ayrıca profili Recent message olarak değiştirmek zorunda kaldım; her gece çevrimdışına düşüyordu, bunu bir hata sanmıştım. Bir sonraki sürüm için TPL5110 sipariş ettim.
Did 1 to 4 today. Wi-Fi/BT/HDMI off, GPS off between fixes, 30 s when moving, 30 min when parked, sending every 5 min. Meter now reads about 95 mA average. Should be roughly four days. Also had to switch the profile to Recent message, it was flipping to offline every night, which I thought was a bug. TPL5110 ordered for the next version.
Yapay zekâ tarafından English dilinden çevrildi ·
Evet, ikisi de açık. Betik, time.sleep(30) içeren bir döngü, başka bir şey yok.
Yes, both on. The script is a loop with time.sleep(30), nothing clever.
Yapay zekâ tarafından English dilinden çevrildi ·
Önce SG90 modifikasyonunu inatçılıktan denedim: dönüyor, bende durma değeri 1.47 ms çıktı. Perdeyi zar zor kaldırabildi, bu yüzden Laura’nın dediği gibi 28BYJ-48’e geçtim; başlangıç konumunu bulmak için en üstte bir mikro anahtar var. Kaydırıcı çalışıyor, Current value blind_pct’yi takip ediyor. SG90 artık masamda kağıttan bir yel değirmenini döndürüyor.
Did the SG90 mod first because I’m stubborn: it spins, stop value was 1.47 ms on mine. It could barely lift the blind though, so I switched to the 28BYJ-48 like Laura said, with a microswitch at the top for homing. Slider works, Current value follows blind_pct. The SG90 now spins a paper windmill on my desk.
Yapay zekâ tarafından English dilinden çevrildi ·
Serial.write + flush ile sayaç ilk denemede yanıt verdi! 9 bayt, 233.1 V. print’in bunu metne dönüştürdüğünü hiç bilmiyordum. Sırada güç (register 0x000C) yazmak var, sonra ESP32’ye geçeceğim.
Serial.write + flush and the meter answered first time! 9 bytes, 233.1 V. I had no idea print turned it into text. Writing power (register 0x000C) next, then it goes over to the ESP32.
Yapay zekâ tarafından English dilinden çevrildi ·
Sayacın menüsünü kontrol ettim, 2400 8N1 ve Serial.begin(2400, SERIAL_8N1) ayarım. Yani sorun bu değil.
Checked the meter menu, 2400 8N1 and my Serial.begin(2400, SERIAL_8N1). So that’s not it.
Yapay zekâ tarafından English dilinden çevrildi ·
Haha, demek ki uyuyan Wi-Fi’ymiş, Pi değil. Ben de kendiminkine bakıyorum.
Ha, so the Wi-Fi was asleep, not the Pi. Checking mine now.
Yapay zekâ tarafından English dilinden çevrildi ·
Bence raspi-config içinde bir ekran kararma seçeneği var, belki de Pi’yi uykuya sokan bu olabilir? Benimkinde HDMI 10 dakika sonra kapanıyor.
I think there’s a screen blanking option in raspi-config, maybe that’s putting it to sleep? Mine turns the HDMI off after 10 min.
Yapay zekâ tarafından English dilinden çevrildi ·
takipteyim, intercom işim için de bunu istiyorum lol
following, I want this for my intercom thing too lol

