Commit Graph

16 Commits

Author SHA1 Message Date
ms
7a03a794ba Add modb_orno_tester.c
program do testowania szybkości pobierania pomiarów tylko napięć z ORNO i SUN2K aby podjąć decyzję z którego urządzenia odczytywać napięcia
2026-02-17 13:15:46 +01:00
ms
fd8dce7535 Update modb_orno3.c
W trybie zwiększonej fluktuacji przyspieszamy wyłącznie odczyt napięc.
Poprawka wygenerowana przez qwen3_coder
2026-02-17 13:12:52 +01:00
ms
3078bbcf3f poprawka do odczytywania z orno 2026-02-15 23:08:33 +01:00
ms
7220d3e750 zmiana w modb_orno3.c i dodanie skryptu usuniecie_pola_highfluct.sh 2026-02-15 22:22:01 +01:00
ms
bc399e0044 Po upływie HIGH_FREQ_MODE_DURATION sekund od wykrycia fluktuacji napięcia:
- Wysyłany jest komunikat MQTT na topic /energy/orno/fluct z wartością "off"
  - Wysyłany jest zapis do InfluxDB z tagiem highfluct=end i wartością highfluct=0
  - Flaga jest resetowana, aby powiadomienie wysłało się tylko raz
2026-02-15 00:29:54 +01:00
ms
ae444a10fc Mapowanie rejestrów SUN2K do jednolitego formatu ORNO 2026-02-15 00:04:34 +01:00
ms
8f3756b1fe dodane logowanie wysyłanych danych do InfluxDB (przez --log)
wysylanie U_A, U_B, U_C do MQTT w formacie JSON podobnie jak dla innych pomiarów (np. Hz)
wysylanie U_A, U_B, U_C do InfluxDB w batchu razem z innymi pomiarami (nie osobno)
2026-02-14 23:08:04 +01:00
ms
0524e7284d Fix spike detection bug causing stuck values
When a spike was detected in voltage, current, power, energy, or frequency,
the code sent previous values but never updated the prev_* variables.
This caused the system to get stuck reporting old values indefinitely
after any significant measurement change.

Now all prev_* variables are always updated after spike detection,
ensuring values can change again after being filtered.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 21:09:30 +01:00
ms
2b16211ef2 Fix sprintf overflows, integer sign handling, and clean up dead code
- Replace all sprintf with snprintf for buffer safety
- Fix rgI32/rgI16 sign extension using int32_t/int16_t casts
- Fix rgU32/rgU16 to use proper uint types and %u format
- Remove unused mbReg_Orno[] array and individual influx_send_* functions
- Fix MQTT topic for voltage fluctuation to match /energy/orno/ convention

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 20:38:45 +01:00
ms
44aceebae6 jakis commit 2026-02-14 20:20:51 +01:00
ms
912878d6e6 modyfikacje przez claude 2026-02-14 19:40:38 +01:00
ms
aa31532d8c Fix multiple bugs and harden modb_orno3.c
- Fix NULL pointer dereference: move modbus_set_slave after ctx validation (ORNO)
- Fix InfluxDB line protocol: remove stray comma in voltage measurement
- Move InfluxDB token to env variable INFLUX_TOKEN with fallback to default
- Fix spike detection for negative power values using fabs()
- Read and validate HTTP response from InfluxDB after writes
- Replace all sprintf with snprintf to prevent buffer overflows
- Batch ORNO InfluxDB writes into single TCP connection (5→1)
- Fix non-portable absolute include path for modbus-rtu.h

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-14 19:32:04 +01:00
ms
886cecf523 gtignore 2026-02-08 21:24:03 +01:00
ms
cec575c435 dodatkowe modyfikacje dla zapobieżenia zarowym odczytow 2026-02-08 21:17:40 +01:00
ms
46dcd48309 dodaje plik gitignore 2026-02-08 18:16:22 +01:00
ms
3fd3951aa8 Pierwszy commit - inicjalizacja projektu 2026-02-08 17:31:44 +01:00