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

HttpClient hardlocks on GET-Request #1403

Closed
PascalMeusel opened this issue Apr 27, 2023 · 1 comment
Closed

HttpClient hardlocks on GET-Request #1403

PascalMeusel opened this issue Apr 27, 2023 · 1 comment

Comments

@PascalMeusel
Copy link

PascalMeusel commented Apr 27, 2023

Hi,

I am using the HttpClient library and I have an issue, where whenever i call the GET function my controller completly stops working. It does not actually crash, but rather it seems like it is locked. I am not able to reach the controller at that point or get any serial communication. The only way to get it back to working is to actually reset the controller.
I am using a Arduino Pico with a W5500 ethernet board, through which it is connected to the internet.

  HTTPClient http;
  if(http.begin(firmwareUpdateAddress))
  {
      Serial.println("begin worked");
  }
  int httpCode = http.GET();

This is the relevant code snippet. After this point no more code is executed. Is there a problem with using the HttpClient library using Ethernet?
I also tried to make an effort to understand where in the library the lock occurs and where i ende up was, that once the following line is executed the controller is in a lock:
tcp_pcb* pcb = tcp_new();
It is hard for me to say, whether the problem lies here, but this is where i ended up. If i am correct in my assesment, is this issue related to https://github.com/earlephilhower/arduino-pico/issues/775? Does this issue occur since the lwip_w5500 library is not ported yet?
If you need any additional information please let me know. Thank you

@PascalMeusel PascalMeusel changed the title HttpClient HttpClient hardlocks on GET-Request Apr 27, 2023
@maxgerhardt
Copy link
Contributor

maxgerhardt commented Apr 27, 2023

The HTTPClient library in this core only uses the WiFiClient object that goes through LWIP and ends up in the CYW... wifi chip driver. Thus works only on a Pico W. So yes it's exactly that issue #775.

If you want this to work right now, you'd either need to work directly with the EthernetClient class provided by Ethernet.h (example), or clone + modify the HTTPClient library to use a EthernetClient instead of a WiFiClient at its base.

If you are using HTTPS, you further need an EthernetClientSecure thing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants