Giter Site home page Giter Site logo

USB host support about imxrt1062 HOT 10 OPEN

grblhal avatar grblhal commented on August 17, 2024
USB host support

from imxrt1062.

Comments (10)

terjeio avatar terjeio commented on August 17, 2024

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.

from imxrt1062.

karoria avatar karoria commented on August 17, 2024

Ok. Will try it. Thanks.

from imxrt1062.

karoria avatar karoria commented on August 17, 2024

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?

from imxrt1062.

terjeio avatar terjeio commented on August 17, 2024

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?

#if TEST_DRV == 0
  const char *Dev = "0:/";  // SPI
#elif TEST_DRV == 1
  const char *Dev = "1:/";  // SDHC
#elif TEST_DRV == 2
  const char *Dev = "2:/";  // USB
#endif

from imxrt1062.

karoria avatar karoria commented on August 17, 2024

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.

from imxrt1062.

terjeio avatar terjeio commented on August 17, 2024

the www directory has some different name like WW~1

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.

my webUI doesn't open inspite I have put the www directory in root of USB drive.

What about ESP3D WebUI - same?
And do you use the webui backend?
If so then you may try WEBUI_ENABLE 2 instead of 1 to force the v2 protocol - if set to 1 I try to auto detect which one to use. Also be aware that the webui backend is in a somewhat fluid state now due to v3 support beeing finalized.
Oh, and your webui code is gzipped (index.html.gz)?

from imxrt1062.

karoria avatar karoria commented on August 17, 2024

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.

from imxrt1062.

terjeio avatar terjeio commented on August 17, 2024

(actually I don't understand what do you mean by backend)

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.

from imxrt1062.

karoria avatar karoria commented on August 17, 2024

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.

from imxrt1062.

terjeio avatar terjeio commented on August 17, 2024

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.

image

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.

from imxrt1062.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.