ivmarkov / rust-esp32-std-demo

Rust on ESP32 STD demo app. A demo STD binary crate for the ESP32[XX] and ESP-IDF, which connects to WiFi, Ethernet, drives a small HTTP server and draws on a LED screen.
Apache License 2.0
784 stars 105 forks source link

Having issue with example and pinging gateway times out #97

Closed Squirrelcoding closed 2 years ago

Squirrelcoding commented 2 years ago

This is probably more suited for a discussion than an issue but there isn't a discussions page so I'll describe my issue here!

I got most of the example running just fine, except for when it comes to the wifi part. On the monitor section of the readme, towards the end you can see that there are messages like this:

(8551) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=1 ttl=64 time=14ms bytes=64
I (9531) esp_idf_svc::ping: Ping success callback invoked
I (9531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=2 ttl=64 time=1ms bytes=64
I (10531) esp_idf_svc::ping: Ping success callback invoked
I (10531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=3 ttl=64 time=2ms bytes=64
I (11531) esp_idf_svc::ping: Ping success callback invoked
I (11531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=4 ttl=64 time=0ms bytes=64
I (12531) esp_idf_svc::ping: Ping success callback invoked
I (12531) esp_idf_svc::ping: From 192.168.10.1 icmp_seq=5 ttl=64 time=1ms bytes=64

However, when I do it I get messages like this:

I (9489) esp_idf_svc::ping: Ping timeout callback invoked
I (9489) esp_idf_svc::ping: From ??? icmp_seq=1 timeout
I (10489) esp_idf_svc::ping: Ping timeout callback invoked
I (10489) esp_idf_svc::ping: From ??? icmp_seq=2 timeout
I (11489) esp_idf_svc::ping: Ping timeout callback invoked
I (11489) esp_idf_svc::ping: From ??? icmp_seq=3 timeout
I (12489) esp_idf_svc::ping: Ping timeout callback invoked
I (12489) esp_idf_svc::ping: From ??? icmp_seq=4 timeout
I (13489) esp_idf_svc::ping: Ping timeout callback invoked

And it finally displays the message

Error: Pinging gateway <my IP> resulted in timeouts

Instead of using the network at my house due to other issues, I am using my computer's hotspot as a wifi source.

To recap

Squirrelcoding commented 2 years ago

Ok, I found the solution; the issue wasn't with the ESP32 itself but rather with my computer's firewall, just as I had suspected. I am running WSL so the issue was with Window's firewall. All I did was add a new rule in Windows to allow incoming connections, but instead of only TCP I selected the options for all protocols, which probably isn't the best idea but it works!