Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unblobbing commit #7121

Merged
merged 1 commit into from
Feb 28, 2020
Merged

unblobbing commit #7121

merged 1 commit into from
Feb 28, 2020

Conversation

d-a-v
Copy link
Collaborator

@d-a-v d-a-v commented Feb 28, 2020

@dok-net
Copy link
Contributor

dok-net commented Mar 1, 2020

@devyte @d-a-v Please revert this commit ASAP, waveform testing has unstable timings (servo jitters audibly) and WDT hits periodically.

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 1, 2020

@dok-net This commit is only the recompilation of lwIP precompiled libraries.
You can first recompile them yourself and check whether timings are modified.

@dok-net
Copy link
Contributor

dok-net commented Mar 1, 2020

Why are you telling me this? The simple fact of the matter is that 0554d39 works just fine, but c61b70d doesn't. The binary diff between these commits is huge. I can't fix and verify everything, but I can manage to point out if something breaks, what's broken it. Forget about the timings in my waveform PR, but WDT'ing is serious.

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 1, 2020

By the words I'm telling you, it is meant that

  • only lwIP binaries are recompiled,
  • there is no source file change,
  • if you don't start network in your test,
    these binaries are not used,
  • if there is a side effect on pwm or core interrupts, or anything not related with network with this commit, I have no idea why right now,
  • It is a binary commit, resulting from lwIP's make install.
    Simply reverting such commit without understanding will bring the issue back on next lwIP's update.

Please try the make install yourself from 0554d39 and report if this is changing anything

  • if it's still working, then I'll have to remake them from a clean install, maybe,
  • if it does not work anymore but working again by checking out the binary files, then I'd have to be able to reproduce the issue and I'd need your help for that.

@dok-net
Copy link
Contributor

dok-net commented Mar 1, 2020

I can't just make install, it's not working on my system. I can only repeat, I've now retested, the commit with "blob" doesn't WDT reset, but master HEAD as of now resets every few seconds.

@dok-net
Copy link
Contributor

dok-net commented Mar 1, 2020

Here's an MCVE. Download to target and hit the webserver at least once, it starts WDT resetting:

#include <ESP8266WebServer.h>
#include <core_esp8266_waveform.h>
#include <ArduinoOTA.h>
#include <Servo.h>

//const char* ssid = "";
//const char* password = "";

// Create an instance of the server
// specify the port to listen on as an argument
ESP8266WebServer server(80);

Servo servo;

// 25kHz cycle == 40µs cycle time
const uint32_t TCYCLE = 40;

uint32_t fanspeed0 = 0;
uint32_t fanspeed1 = 0;

bool ota_started = false;

void StartOTAIfRequired()
{
    if (ota_started)
        return;
    // Port defaults to 8266
    // ArduinoOTA.setPort(8266);
    // Hostname defaults to esp8266-[ChipID]
    //if (ArduinoOTA.getHostname() && ArduinoOTA.getHostname().length())

    // No authentication by default
    ArduinoOTA.setPassword("abc");
    ArduinoOTA.onStart([]() {
        Serial.println("OTA Start");
        });
    ArduinoOTA.onEnd([]() {
        Serial.println("\nOTA End");
        });
    ArduinoOTA.onProgress([](unsigned int progress, unsigned int total) {
        Serial.printf("Progress: %u%%\r\n", (progress / (total / 100)));
        });
    ArduinoOTA.onError([](ota_error_t error) {
        Serial.printf("Error[%u]: ", error);
        if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed");
        else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed");
        else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed");
        else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed");
        else if (error == OTA_END_ERROR) Serial.println("End Failed");
        });
    ArduinoOTA.begin();
    ota_started = true;
    delay(500);
}

void HandleOTA()
{
    StartOTAIfRequired();
    ArduinoOTA.handle();
}

// The setup() function runs once each time the micro-controller starts
void setup()
{
    Serial.begin(115200);

    WiFi.mode(WIFI_STA);
    WiFi.begin();
    Serial.println("");

    // Wait for connection
    while (WiFi.status() != WL_CONNECTED) {
        delay(500);
        Serial.print(".");
    }

    Serial.println("");
    Serial.print("IP address: ");
    Serial.println(WiFi.localIP());

    StartOTAIfRequired();

    pinMode(D3, OUTPUT_OPEN_DRAIN);
    digitalWrite(D3, HIGH);
    pinMode(D7, OUTPUT_OPEN_DRAIN);
    digitalWrite(D7, HIGH);

    servo.attach(D8, 1000, 2000);

    uint32_t duty = 1 + (TCYCLE - 2) * fanspeed0 / 100;
    startWaveform(D3, duty, TCYCLE - duty, 0);
    duty = 1 + (TCYCLE - 2) * fanspeed1 / 100;
    startWaveform(D7, duty, TCYCLE - duty, 0);
    servo.write(90);

    server.on("/", []() {
        String content = "";
        content += "<html><body>\
            Hello</body></html>";
        server.send(200, "text/html", content.c_str());
        delay(100);
        });

    server.begin();
    Serial.println("HTTP server started");

    tone(D5, 440, 500);
}

// Add the main program code into the continuous loop() function
void loop()
{
    HandleOTA();
    // Listen for http requests
    server.handleClient();
}

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 1, 2020

Note that I had to WiFi.begin(STASSID, STAPSK) for wifi to connect, then I got this:

$ while true; do curl 10.0.1.101; echo;echo "another request:"; done
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
another request:
<html><body>            Hello</body></html>
...

ESP is still running fine:

21:10:56.697 -> SDK:2.2.2-dev(38a443e)/Core:2.6.3-86-gc61b70de=20603086/lwIP:STABLE-2_1_2_RELEASE/glue:1.2-30-g92add50/BearSSL:5c771be
21:10:56.697 -> scandone
21:10:56.697 -> 
21:10:56.829 -> scandone
21:10:56.829 -> state: 0 -> 2 (b0)
21:10:56.829 -> state: 2 -> 3 (0)
21:10:56.829 -> state: 3 -> 5 (10)
21:10:56.829 -> add 0
21:10:56.829 -> aid 1
21:10:56.829 -> cnt 
21:10:56.862 -> 
21:10:56.862 -> connected with xx, channel nn
21:10:56.862 -> dhcp client start...
21:10:56.862 -> ip:10.0.1.101,mask:255.255.255.0,gw:10.0.1.254
21:10:57.194 -> .
21:10:57.194 -> IP address: 10.0.1.101
21:10:57.724 -> HTTP server started
21:11:06.843 -> pm open,type:2 0

That being weird, I suggest you try with another git master cloned from scratch.
May I suggest you to try beta releases ?

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

An rm -rf *; git checkout -- . shall suffice.
About the diagnostic output you pasted, that's not on USB serial, right?

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 2, 2020

Glad you sorted this out.
The above output is the arduino console on USB serial (wemos d1), with timestamp enabled.

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

No idea what "with timestamp enabled" means :-(
I think there's a misunderstand, I was just reporting my latest step, I didn't imply that the WDT problem is gone. In fact, right now, my MCVE without the latest master commit works, but with the lwip2 commits, it keeps crashing. It's definitely something in those lib binaries.

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

All it takes to make my MCVE work well s to revert the *.a, tcp_priv.h, and lwip-git-hash.h files.

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 2, 2020

About the diagnostic output you pasted, that's not on USB serial, right?

No idea what "with timestamp enabled" means :-(

That was USB Serial. Timestamp is added by arduino console. The output is your sketch's.
(edit: with debug on serial enabled, if that's worth to be mentioned)

An rm -rf *; git checkout -- . shall suffice.

I think there's a misunderstand, I was just reporting my latest step, I didn't imply that the WDT problem is gone.

Sorry for the misunderstanding.
I hereby ask someone else to try your MCVE to confirm in either way.
The beta release has the same library as git master and the one I have on my PC

$ md5sum liblwip2-536-feat.a
f27b0c56379610ffc24a92a0e3f8aad7  liblwip2-536-feat.a

All it takes to make my MCVE work well s to revert the *.a, tcp_priv.h, and lwip-git-hash.h files.

I understand that.
That's why I wonder whether I am alone to be able to make git master working with lwIP.

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 2, 2020

@dok-net
Which version of lwIP do you select ?
I may not have tested with the same version as the one you're using.
The one above is "v2 / lower memory / with features / no IPv6".

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

lwIP Variant: v2 Lower Memory

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

Just very short test durations (1-2min), the one with IPv6 seems to be better.

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

Also tested v2 Lower Memory (no features), no WDT resets within 1-2min after flashing.
But, v2 Higher Bandwidth, and v2 Lower Memory (the default?):

ets Jan  8 2013,rst cause:4, boot mode:(3,6)

wdt reset
load 0x4010f000, len 3456, room 16 
tail 0
chksum 0x84
csum 0x84
v3e56b42b
~ld

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 2, 2020

Can you give the md5 sum of your liblwip2-536-feat.a ?
It is "v2 Lower Memory (the default)".

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

For the liblwip2-536-feat.a, same as yours above.
Please remember, I am reporting a regression against my waveform branch here - merging with master - latest commit stuff works, if I merge the HEAD commit of master, the WDT resets occur. You will likely not see the issue without the whatever extra stress the waveform lib produces.
One thing that seems unrelated, I cannot OTA update currently with master.

@dok-net
Copy link
Contributor

dok-net commented Mar 2, 2020

For what it's worth, these are the options:
Upload Speed: 921600
CPU Frequency: 80 MHz
Flash Size: 4MB (FS:1MB OTA:~1019KB)
Debug port: Disabled
Debug Level: None
lwIP Variant: v2 Lower Memory
VTables: Flash
Exceptions: Legacy (new can return nullptr)
Erase Flash: Only Sketch
SSL Support: All SSL ciphers (most compatible)

@d-a-v
Copy link
Collaborator Author

d-a-v commented Mar 2, 2020

You will likely not see the issue without the whatever extra stress the waveform lib produces.

This is the +19th message after your first one to learn that

  • you did not test your MCVE against master
  • you have issues with an unmerged PR
  • you never insisted on that information after I successfully tested your MCVE on master and tried to understand your concern that nobody else has.

I would be glad to know where I missed this capital information in the above messages.

This is a merged PR.
Please open a new issue with all the needed informations to understand your specifics.

@esp8266 esp8266 locked as too heated and limited conversation to collaborators Mar 2, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants