Closed AndyThirtover closed 1 year ago
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.
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. I was trying to find why the style sheet was not served on the first load.
I refactored the code to serve from static, removed the debug prints and set debug=False
on the app start. I also tried the nightly build of MicroPython 1.19.1 ( https://micropython.org/resources/firmware/W5100S_EVB_PICO-20220811-unstable-v1.19.1-273-g6c67fbc28.uf2 )
Sadly the issue is still present, although performance is great. I guess the Ethernet driver does not past on the second request if it is very close to the first.
Regards
Andy
@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.
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.
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