I’ve been working on bringing support for file uploads into the Particle branch of Webduino. This relies on the SdFat library along with Webduino modifications by Matthijs shared on this page.
https://code.google.com/archive/p/webduino/issues/10
I’ve got it compiling with the latest Particle branch of SdFat, and removed unnecessary library dependencies. It’s finally at a point where it can upload files brilliantly, but after any uploads the web server becomes unresponsive. The Photon does not crash, and you can even interact with web pages that are already loaded, but you cannot load another web page. They all timeout. Interestingly, if you enable WEBDUINO_SERIAL_DEBUGGING
you can see that the page requests are processed and printed to the console, but just aren’t sent to the browser client anymore.
I’ve been spinning my wheels on this problem for a long time and I’m hoping someone can help out. I’ve boiled the problem down into a small project.
Here is a .ZIP of the project folder for Paticle Dev. Alternatively here are Gists of the sketch & modified Webduino sources.
You will need a Photon connected to an SD card (pins are commented in the source), and you’ll need to know your Photon’s ip address. Once you have those, upload the sketch, open a web browser and go to your Photon’s IP address. You’ll see a couple buttons at the top; one lets you toggle the blue LED on D7 and the other deletes all files in the root of your SD card (but not folders).
Below that you’ll see a form where you can upload files, and below that you’ll see some stats about your Photon and finally a list of files on the SD card. I recommend adding a folder or two to your SD so you can verify it’s being read when the file list appears (since the Delete button at the top doesn’t remove folders).
Try to upload some files to the SD card. Choose small files unless you want to wait, and you only need to upload one to make the problem appear.
Notice that the web server is unresponsive but you can still toggle the D7 LED, albeit with a ~1 second delay, as long as you have a second copy of the page open.
I would greatly appreciate any help on this. Perhaps @mdma would have some input since he ported Webduino to Photon. I don’t think the issue is related to SdFat, but perhaps @whg has some ninja ideas. Thank you!!