Microdot serving over Ethernet (Same Switch) #108
Replies: 5 comments
-
I don't see why the request coming from the same switch would make a difference, and also why only the css file is affected. Any ideas on why that happens? Also as a side note, why does the css file has its own route and all other static files have a generic endpoint? Finally, note that the static file endpoint that you are using does not have any protections regarding returning internal files stored in your device. For example, it would not prevent someone from requesting main.py or any other file you have stored in your device. |
Beta Was this translation helpful? Give feedback.
-
Fair Play, I've been bashing it around all afternoon trying to work out what the difference between the project on an ESP32 and on the RP2040. I'm trying to built a replacement for the SitePlayer so I'm probably spike this on a few other platforms. |
Beta Was this translation helpful? Give feedback.
-
I refactored the code to serve from static, removed the debug prints and set Regards Andy |
Beta Was this translation helpful? Give feedback.
-
@AndyThirtover Make sure you are using the latest microdot.py from this repo. I wonder if this is related to an issue I fixed recently related to multithreading. The RP2040 can only spawn one thread, so multithreading isn't really useful from a web server perspective. The current version runs multiple requests back to back instead of in threads. |
Beta Was this translation helpful? Give feedback.
-
I just got delivery of the W5500-EVB-Pico and I can confirm the same issue. Perfect over two switches - very slow or failed refreshes when connected to the same switch. |
Beta Was this translation helpful? Give feedback.
-
Hi - I wonder if you can shed some light on an issue I've found.
I have Microdot running on a W5100S-EVB-Pico which is a RP2040 with built-in Ethernet.
Here's the stripped down start-up:
This is avoid getting caught up with the rest of my code. If I test from a system that is on another switch to Microdot all is well. However, if I test from a device that is on the SAME switch I get these issues:
You'll see that the style.css file is pending - and is finally served after 6 mins.
I've noticed this sort of issue on a older technology (NetMedia Siteplayer), so I wonder if the request is arriving so fast it is not registered, and the extra switch adds a tiny delay as therefore all is good.
Regards
Andy
For reference here's the web_gen.py:
The networking is all 1Gb/s switches. The local switch is a NetGear.
Regards
Andy
Beta Was this translation helpful? Give feedback.
All reactions