marxram / spidr

Privacy for Deye Microinverters using ESP 8266 / 32 module
13 stars 2 forks source link

Error while compilation the spidr.ino, 'OK' was not declared #9

Closed ollibaba closed 3 months ago

ollibaba commented 4 months ago

Hi marxram, i got an error message while compilation the spidr.ino: Code in .ino: 860 // Check parse result and update display accordingly 861 if (result == OK) { 862 action.params[2] = "Parsen: Fertig"; 863 action.result = "abgeschlossen"; 864 action.resultDetails = "OK"; 865 readHTML = true;

The message: C:\Users\Oliver\Documents\Arduino\libraries\spidr\spidr.ino: In function 'bool readInverterDataFromWebInterface(String, String, String)': C:\Users\Oliver\Documents\Arduino\libraries\spidr\spidr.ino:861:19: error: 'OK' was not declared in this scope 861 | if (result == OK) { | ^~ Mehrere Bibliotheken wurden für "Preferences.h" gefunden Benutzt: C:\Users\Oliver\AppData\Local\Arduino15\packages\esp32\hardware\esp32\3.0.0\libraries\Preferences Nicht benutzt: C:\Users\Oliver\Documents\Arduino\libraries\Preferences exit status 1

What´s the reason and could you please help here? Oliver

ollibaba commented 4 months ago

Update from 2.6.2024: I changed the line from: 861 if (result == OK) { in: 861 if (result == true) { NOW I got no compilation error. Is the sketch working with this change?

marxram commented 4 months ago

Hi @ollibaba: i try to test it soon. What ide Version did you use?

ollibaba commented 4 months ago

Hi marxram,

Many thanks,

IDE 2.3.2

Greetings

Oliver

Von: marxram @.> Gesendet: Sonntag, 2. Juni 2024 14:02 An: marxram/spidr @.> Cc: Oliver @.>; Mention @.> Betreff: Re: [marxram/spidr] Error while compilation the spidr.ino, 'OK' was not declared (Issue #9)

Hi @ollibaba https://github.com/ollibaba : i try to test it soon. What ide Version did you use?

— Reply to this email directly, view it on GitHub https://github.com/marxram/spidr/issues/9#issuecomment-2143820040 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6MVVRGNDUJH5VCW5VV353ZFMCTXAVCNFSM6AAAAABIS7CVWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTHAZDAMBUGA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AJ6MVVUJT7WLLIJ57GR34VLZFMCTXA5CNFSM6AAAAABIS7CVWSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT7ZAMQQ.gif Message ID: @. @.> >

ollibaba commented 4 months ago

Aktuelles Verhalten nach Upload und Start_

spidr Startbildschirm wird angezeigt.

Verbindung mit eigenem WLan wird hergestellt -> ok

Zeit Sync: Meldung in Arbeit -> dann: kein Server

Dann beginnt Schleife von vorn WLAN Verbindung, Zeitserver Sync, WLAN Verbindung ZeitServer sync…usw

Gruß

Oliver

Von: marxram @.> Gesendet: Sonntag, 2. Juni 2024 14:02 An: marxram/spidr @.> Cc: Oliver @.>; Mention @.> Betreff: Re: [marxram/spidr] Error while compilation the spidr.ino, 'OK' was not declared (Issue #9)

Hi @ollibaba https://github.com/ollibaba : i try to test it soon. What ide Version did you use?

— Reply to this email directly, view it on GitHub https://github.com/marxram/spidr/issues/9#issuecomment-2143820040 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6MVVRGNDUJH5VCW5VV353ZFMCTXAVCNFSM6AAAAABIS7CVWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBTHAZDAMBUGA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AJ6MVVUJT7WLLIJ57GR34VLZFMCTXA5CNFSM6AAAAABIS7CVWSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT7ZAMQQ.gif Message ID: @. @.> >

ollibaba commented 4 months ago

The issue depends not on the IDE version . I tried it with 1.8.15 and have the same result. Question: How can I start the web interface (IP ?) of spidr and to which WLAN SSID should I have a connection? I found no information (step by step) about: how to start and configure the module after switching on. At the moment (with the OK problem) I see only an ESP-xxx WLAN (no connection possible) and the module is always connecting/disconnecting to my home WLAN. Greetings Oliver

marxram commented 4 months ago

Regarding the original Problem of this

861 if (result == OK) {

Please replace the 'OK' with 'PARSE_OK' without the '' that is declared in Inverter.h

I created a branch for the fix. Can you check if it is compiling? https://github.com/marxram/spidr/tree/BugFix_Issue-PARSE_OK

Regarding the other issue The NTP is a little tricky/buggy as of the ESP. It is behaving strange. The general idea is, that I want to set the time of the inverter as soon as possible. So after boot and if NTP is activated in the config, I try to connect. (also for me this seems to not really work for some reasons, but it works after some minutes.

Maybe you can create another issue for thet and explain, if / how you have configured the device. Did you get it to go to the AP mode, or not? Normally after around 1-2 minutes it should go there.

The wifi AP Name and password are defined in the: config.h:

// Configurations that have been moved to the Preferences Manager and can be updated during Runtime // Only Defaults below

define DEF_WIFI_AP_NAME "SPIDR-net"

define DEF_WIFI_AP_PASSWORD "SPIDR-pass"

ollibaba commented 4 months ago

Oh no, Sorry ,

little short circuit in my head.

Connected to web interface via home LAN IP 192.168…

And not by searching the WLAN from the ESP Board.

Then corrected the Web Access Credentials to the correct values. This fields were filled with Standard admin admin and not with the correct values I put in the arduino_secrets.

NOW it works correct (hurra) and I see the values of the inverter. Display works also correct now.

Next step I will try to send the data via MQTT to fhem smart home.

Question: is the connection to the cloud now interrupted, or is to do something else in the inverter web interface?

Many thanks for your patience.

Oliver

Von: Oliver Weitz @.> Gesendet: Dienstag, 4. Juni 2024 15:15 An: 'marxram/spidr' @.>; 'marxram/spidr' @.> Cc: 'Mention' @.>; Oliver Weitz @.***> Betreff: AW: [marxram/spidr] Error while compilation the spidr.ino, 'OK' was not declared (Issue #9)

Thanks. I changed the line and got then no error while compilation, but the same behavior as before descripted with my (wrong) change in the line.

No something interesting: I changed also line 945ff as written in issue #10 from https://github.com/MaSylvester MaSylvester

And compiled then the code.

Now the behavior changed:

Still no time sync but module connects with AP_inverter (Status vebunden OK) with IP 10.10.100.149

Then try to fetch data: Hole Daten http://10.10.100.254 --> message: UNAUTHORIZED checken Zugangsdaten

But the Zugangsdaten are correct . I have changed it in the config.h

I changed also in config :

// so war es im git dann geändert in darunter

//#define SECRET_WIFI_RELAIS_SSID "EM_12345678"

//#define SECRET_WIFI_RELAIS_KEY "check-sticker"

define SECRET_WIFI_RELAIS_SSID "SPIDR-net"

define SECRET_WIFI_RELAIS_KEY "SPIDR-pass"

But no SSID SPIDR-net to see anytime

The module opens no own SSID . I see only a WLAN ESP_Exxx

So I have no chance to connect the the web interface of spidr

Greetings Oliver

Von: marxram @. @.> > Gesendet: Montag, 3. Juni 2024 21:54 An: marxram/spidr @. @.> > Cc: Oliver @. @.> >; Mention @. @.> > Betreff: Re: [marxram/spidr] Error while compilation the spidr.ino, 'OK' was not declared (Issue #9)

Regarding the original Problem of this

861 if (result == OK) {

Please replace the 'OK' with 'PARSE_OK' without the '' that is declared in Inverter.h

I created a branch for the fix. Can you check if it is compiling? https://github.com/marxram/spidr/tree/BugFix_Issue-PARSE_OK

Regarding the other issue The NTP is a little tricky/buggy as of the ESP. It is behaving strange. The general idea is, that I want to set the time of the inverter as soon as possible. So after boot and if NTP is activated in the config, I try to connect. (also for me this seems to not really work for some reasons, but it works after some minutes.

Maybe you can create another issue for thet and explain, if / how you have configured the device. Did you get it to go to the AP mode, or not? Normally after around 1-2 minutes it should go there.

The wifi AP Name and password are defined in the: config.h:

// Configurations that have been moved to the Preferences Manager and can be updated during Runtime // Only Defaults below

define DEF_WIFI_AP_NAME "SPIDR-net"

define DEF_WIFI_AP_PASSWORD "SPIDR-pass"

— Reply to this email directly, view it on GitHub https://github.com/marxram/spidr/issues/9#issuecomment-2146003270 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6MVVXPGEGVPFQFR72HVTDZFTCV5AVCNFSM6AAAAABIS7CVWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBWGAYDGMRXGA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AJ6MVVTRMCX2B2GSGZ2EY53ZFTCV5A5CNFSM6AAAAABIS7CVWSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTT75FUUM.gif Message ID: @. @.> >

marxram commented 4 months ago

Cool, if its working!

In the inverter you should now delete the wifi credentials for your hone WiFi as they are not longer needed.

Or you can also just Block internet access completely for the device in your Router.

What Board did you use?

Also one Thing might be that the esp still has some old values stored in Flash. This can be enforced to override during flashing, but is off by default in arduino IDE.

Greets Roland

marxram commented 4 months ago

Can this issue be closed then? I will merge the branch.

ollibaba commented 4 months ago

Many Thanks Roland,

I think you can close the issue.

It could be that I will have an issue concerning mqtt.

At the moment I see no data in smart home fhem.

I`m not so firm in mqtt and the naming in your solution and fhem is different.

So it’s a little bit a trial and error play

At the moment I use many Tasmota modules and these work fine.

Greetings

Oliver 😊

Von: marxram @.> Gesendet: Dienstag, 4. Juni 2024 20:00 An: marxram/spidr @.> Cc: Oliver @.>; Mention @.> Betreff: Re: [marxram/spidr] Error while compilation the spidr.ino, 'OK' was not declared (Issue #9)

Can this issue be closed then? I will merge the branch.

— Reply to this email directly, view it on GitHub https://github.com/marxram/spidr/issues/9#issuecomment-2148105512 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6MVVVUY32DBLC67Q2XRU3ZFX6DTAVCNFSM6AAAAABIS7CVWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBYGEYDKNJRGI . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AJ6MVVTNTDFRGWDPNABAOEDZFX6DTA5CNFSM6AAAAABIS7CVWSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUABF6SQ.gif Message ID: @. @.> >

ollibaba commented 4 months ago

Ich nutze ein HELTEC_WiFiKit_32_V3_OLED_128x64_ESP32

Von: marxram @.> Gesendet: Dienstag, 4. Juni 2024 20:00 An: marxram/spidr @.> Cc: Oliver @.>; Mention @.> Betreff: Re: [marxram/spidr] Error while compilation the spidr.ino, 'OK' was not declared (Issue #9)

Cool, if its working!

In the inverter you should now delete the wifi credentials for your hone WiFi as they are not longer needed.

Or you can also just Block internet access completely for the device in your Router.

What Board did you use?

Also one Thing might be that the esp still has some old values stored in Flash. This can be enforced to override during flashing, but is off by default in arduino IDE.

Greets Roland

— Reply to this email directly, view it on GitHub https://github.com/marxram/spidr/issues/9#issuecomment-2148104182 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AJ6MVVUSMU7W25VSKAWFIOLZFX6AVAVCNFSM6AAAAABIS7CVWSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBYGEYDIMJYGI . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AJ6MVVS3U2KTWQXCP57VJJLZFX6AVA5CNFSM6AAAAABIS7CVWSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUABF37M.gif Message ID: @. @.> >