Closed Kernelhacker closed 1 month ago
Your log doesn't show any time info in the "I" lines.
Has the ESP a time set when this happens or not? (For more background see https://github.com/lumapu/ahoy/issues/1434#issuecomment-1960019949 and other linked issue there).
Your log doesn't show any time info in the "I" lines.
Has the ESP a time set when this happens or not? (For more background see [#1434 (comment)]
This is serial (USB) debug log. It doesn't contain timestamps there. In the weblog the time is shown and time is synchronised fine.
@Kernelhacker
hast du's schon mit dem neuen auth probiert, falls du ein passwort gesetzt hast ?
curl --header "Content-Type:application/json" --request POST --data '{"auth": "dein_passwort", "cmd": "power", "id": 0, "val": 1}' "http://192.168.3.195/api/ctrl"
(leichter lesbar in multi line):
curl --header "Content-Type:application/json" --request POST --data '{"auth": "dein_passwort", "cmd": "power", "id": 0, "val": 1}' "http://192.168.3.195/api/ctrl"
ps for nerds: --location braucht man bei ahoydtu nicht, der curl parameter dient nur, damit 302 redirects mancher webseiten verfolgt werden
Die Ursache ist gefunden: Der Body war falsch: Das JSON Objects war in einem Array gekapselt. Ohne das genau debugged zu haben, gehe ich davon aus, dass hier ein wenig Fehlerbehandlung gut wäre, um solche Fehler in Zukunft abzufangen:
In RestApi.h in "onApiPostBody":
DeserializationError err = deserializeJson(json, reinterpret_cast<const char*>(mTmpBuf), mTmpSize);
JsonObject obj = json.as<JsonObject>();
An dieser Stelle sollte erst geprüft werden, ob json wirklich ein JsonObject ist und falls nicht sollte eine entsprechende Fehlermeldung ausgegeben werden. Wenn ich das Projekt endlich übersetzt bekomme, kann ich ja einen Patch bauen.
@Kernelhacker
sehr cool, dass es wieder funktioniert, und danke dir für die zusatzinfo 👍
An dieser Stelle sollte erst geprüft werden, ob json wirklich ein JsonObject ist und falls nicht sollte eine entsprechende Fehlermeldung ausgegeben werden.
leider ist der sketch/flash von nutzbar ca 1.3mb auf esp32 schon bis auf wenige bytes ausgeschöpft, und wir kämpfen gerade, wie man alles auf einem 2mb total sketch unterbringen kann.
derzeit ist der dev task, den bestehenden code zu optimieren, damit man nicht die standard esp32 droppen muss, weil die neuen geplanten funktionen nicht mehr rein passen, und nicht allen sagen muss, sie sollen eine neue esp hardware mit mehr speicher kaufen.
ps: vielleicht kann es @lumapu in weniger worten besser erklären
thx & greetings, metachuh
@Kernelhacker
sehr cool, dass es wieder funktioniert, und danke dir für die zusatzinfo 👍 [..] leider ist der sketch/flash von nutzbar ca 1.3mb auf esp32 schon bis auf wenige bytes ausgeschöpft, und wir kämpfen gerade, wie man alles auf einem 2mb total sketch unterbringen kann.
Ja, das ist alles sehr knapp - ich habe im Moment zu wenig Zeit um wirklich viel beizusteuern und mein Pull-Request für diesen Fehler ist mit @lumapu's Fix auch schon wieder überholt ;) Habe früher mal ein paar Projekte auf PIC16 Basis mit Assembler gemacht. Im Vergleich zu diesen Prozessoren ist der Platz auf den ESPs schon extremer Luxus!
ja Luxus stimmt, trotzdem sehr schnell voll 😉
Platform
ESP32
Assembly
I did the assebly by myself
nRF24L01+ Module
nRF24L01+ plus
Antenna
external antenna
Power Stabilization
nothing
Connection picture
Version
0.8.83
Github Hash
GIT SHA: 5ebfe5a
Build & Flash Method
AhoyDTU Webinstaller
Setup
2 inverters (0: hm-800, 1: hm-1500)
Werte und Gesamtertrag um Mitternacht zurücksetzen ('Kommunikation während der Nacht pausieren' muss gesetzt sein) [X] Werte bei Sonnenuntergang zurücksetzen [ ] Werte zurücksetzen, sobald der Wechselrichter nicht erreichbar ist [ ] Maximalwerte mitternachts zurücksetzen [X] Kommunikation starten ohne gültige Zeit (sinnvoll im AP Modus) [ ] Grid-Profil auslesen [X] Ertragseffizienz (Standard 1.0) 0,959999979
No MQTT, NRF24 enabled and working fine.
Debug Serial Log output
Error description
Trying to POST a REST API command (e.g. power on inverter) leads to reboot of ahoy-dtu:
curl --location 'http://192.168.3.195/api/ctrl' \ --header 'Content-Type: application/json' \ --data '[ { "id": "0", "cmd": "power", "val": 1 } ]'