-
Notifications
You must be signed in to change notification settings - Fork 39
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB host support #42
Comments
It seems the SD card library already supports USB drives. I guess sdcard.c needs to be changed to mount the USB drive instead of the SD card to make it work. More changes is likely needed to make it work alogside the SD card. |
Ok. Will try it. Thanks. |
Hi @terjeio sorry I couldn't find what needs to be changed in sdcard.c to mount USB drive instead of SD card. Will you please point me? |
I believe it is the device name set here. Perhaps this snippet from one of the uSDFS examples is a clue for what to use?
|
Thanks for hint. I got the definition in driver.c changed it to 2:/ and USB opens through FTP. But there are some weird files along with. I have formatted it with FAT32 but the www directory has some different name like WW~1 I think it should be related to FS or FTP permissions. my webUI doesn't open inspite I have put the www directory in root of USB drive. |
Long filename support is not enabled for FatFs for some reason? You may also try WebDAV via WinSCP - this does not keep track of current working directory that may mess things up with ftp.
What about ESP3D WebUI - same? |
I am not using ESP3D webUI. But will check with it. I am using grblTouch which is not gzipped, so simple to work with. I also don't use any webUI backend (actually I don't understand what do you mean by backend) but I can surely tell you that I have not used any of the code which is inside ESP3D webUI. Will try with Luc's webUI and post the results here as I get time. |
Ok, this may explain it - I have removed support for fetching index.html from the www directory if no backend is present. You will have to move it too the root directory or implement a mini backend the redirects the request. A backend is code that processes http requests in different ways depending on the url provided, it is set up by registering url handlers with the http server. It may also register a file redirector with the server that get called when a file is not found - this can be used to look up the file elsewhere in the filing system. The iMXRT1062 driver has gotten littlefs support, this is for storing files in flash. You may use this to store the grblTouch code, with file redirection you can check if the code is present on the sdcard, if not fall back to littlefs. |
Ok. That sounds interesting. Actually I am using server.c but my code is little older and there may be lots of changes by you. Will play around with your suggestions. BTW, will you point me on how to save my grblTouch web app to flash? I can see the path you have mentioned in server.c is /embedded for it. |
The actual file system path is /littlefs - the /embedded file system path is read-only and files are stored in a .c file. The WebUI index.html.gz stored in this file is for updating the WebUI image in littlefs, either when index.html.gz is not found in the / or /www directories or when http:///forcefallback=yes is opened. All this is handled via file redirection in server.c - and you may redirect whatever filenames you want. With WinSCP I open /littlefs mount via WebDAV by specifying /littlefs as the remote directory in advanced settings. ftp access to mounts other than the root mount is not yet working - I'll fix this later. A bit more complicated than before I know, but the http server daemon is a lot more flexible now. If storing grblTouch in flash you really should minimize the javascript and gzip the result- you will save a lot of flash that way. It might not even be possible to store it in flash if not doing so. |
Hi @terjeio
I was wondering if I can activate native USB host of teensy4.1 and use it as secondary source to read programs from a usb pen drive in addition to sd card. I hope it should be easy. I use PIO for compilation. Can you guide me through the process on which library to include for it and how to host its space alongwith sd on server (including ftp).
Thanks in advance and a big salute for whatever you have done for the DIY CNC community.
Regards,
Ravi
The text was updated successfully, but these errors were encountered: