embassy-rs / embassy

Modern embedded framework, using Rust and async.
https://embassy.dev
Apache License 2.0
5.47k stars 761 forks source link

Webrequests failing in example wifi_webrequest.rs for pi pico w #3361

Open Argonlifesee opened 1 month ago

Argonlifesee commented 1 month ago

After pulling the newest version of this repo the example "wifi_webrequest.rs" for the pi pico w no longer properly makes the webrequest and fails to make it both as an https and http request. Sadly I cannot say in which version it exactly broke, I will add that as soon as I get a version to work again, will probably take it's time as I currently don't have alot of time.


Here is the output an excerpt of the example being run as an https request:

4.417604 INFO  DHCP is now up!
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:112 
4.417624 INFO  waiting for link up...
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:114 
4.417646 INFO  Link is up!
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:118 
4.417666 INFO  waiting for stack to be up...
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:120 
4.417691 INFO  Stack is up!
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:122 
4.417993 INFO  connecting to https://worldtimeapi.org/api/timezone/Europe/Berlin
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:142 
4.419090 DEBUG address 192.168.178.1 not in neighbor cache, sending ARP request
└─ smoltcp::iface::interface::{impl#2}::lookup_hardware_addr @ /home/argon/.cargo/git/checkouts/smoltcp-d6a83fd2b0891566/dd43c8f/src/macros.rs:18  
4.541044 DEBUG start_record(Handshake(false))
└─ embedded_tls::write_buffer::{impl#0}::start_record @ /home/argon/.cargo/registry/src/index.crates.io-6f17d22bba15001f/embedded-tls-0.17.0/src/fmt.rs:122 
5.027986 DEBUG received a keep-alive or window probe packet, will send an ACK
└─ smoltcp::socket::tcp::{impl#9}::process @ /home/argon/.cargo/git/checkouts/smoltcp-d6a83fd2b0891566/dd43c8f/src/macros.rs:18  
5.035234 DEBUG received a keep-alive or window probe packet, will send an ACK
└─ smoltcp::socket::tcp::{impl#9}::process @ /home/argon/.cargo/git/checkouts/smoltcp-d6a83fd2b0891566/dd43c8f/src/macros.rs:18  
5.079520 DEBUG received a keep-alive or window probe packet, will send an ACK
└─ smoltcp::socket::tcp::{impl#9}::process @ /home/argon/.cargo/git/checkouts/smoltcp-d6a83fd2b0891566/dd43c8f/src/macros.rs:18  
5.084640 ERROR Failed to make HTTP request: Tls(IoError)
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:147 
5.305916 DEBUG === EVENT TXFAIL: EventMessage { version: 2, flags: 0, event_type: 20, status: 2, reason: 0, auth_type: 0, datalen: 0, addr: [2c, 91, ab, 66, b9, 14], ifname: [77, 6c, 30, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], ifidx: 0, bsscfgidx: 0, }  []
└─ cyw43::runner::{impl#1}::rx @ /home/argon/Desktop/Pico-Stuff/Rust/embassy/cyw43/src/runner.rs:492 

And here as a simple http request: (using the commented alternative in the example)

8.001315 INFO  DHCP is now up!
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:112 
18.001336 INFO  waiting for link up...
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:114 
18.001360 INFO  Link is up!
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:118 
18.001382 INFO  waiting for stack to be up...
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:120 
18.001408 INFO  Stack is up!
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:122 
18.001707 INFO  connecting to http://worldtimeapi.org/api/timezone/Europe/Berlin
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:144 
18.002779 DEBUG address 192.168.178.1 not in neighbor cache, sending ARP request
└─ smoltcp::iface::interface::{impl#2}::lookup_hardware_addr @ /home/argon/.cargo/git/checkouts/smoltcp-d6a83fd2b0891566/dd43c8f/src/macros.rs:18  
18.280797 DEBUG received a keep-alive or window probe packet, will send an ACK
└─ smoltcp::socket::tcp::{impl#9}::process @ /home/argon/.cargo/git/checkouts/smoltcp-d6a83fd2b0891566/dd43c8f/src/macros.rs:18  
18.310916 ERROR Failed to send HTTP request
└─ wifi_webrequest::____embassy_main_task::{async_fn#0} @ wifi_webrequest.rs:157 
18.538394 DEBUG LOGS: 000018.018 wl0.0: wlc_send_bar: seq 0xb tid 0
└─ cyw43::runner::{impl#1}::log_read::{async_fn#0} @ /home/argon/Desktop/Pico-Stuff/Rust/embassy/cyw43/src/runner.rs:255 

Any help as to why this happens is greatly appreciated

1-rafael-1 commented 2 weeks ago

Hi, is this still faulty today? I had stability issues with worldtimeapi.org roughly in the timeframe you sent this issue. Testing their endpoints now seems to work fine. I have no rp2040 with wifi with me right now, so cannot test from that.