Giter Site home page Giter Site logo

Re: Using the SD Card about grbl_esp32 HOT 20 CLOSED

bdring avatar bdring commented on June 9, 2024
Re: Using the SD Card

from grbl_esp32.

Comments (20)

terjeio avatar terjeio commented on June 9, 2024

Got my first job running off a card now and discovered another potential issue, the FILE and SIZE elements are separated by a comma which is a legal character in filenames, IMO it would be better to use the vertical bar instead which is not. Simpler to parse.

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024

We have not done anything with a quit feature yet.

Grbl reset "mc_reset()" is the normal way to stop a streaming job or in process move. The proper sequence is Feedhold to stop motion, then Grbl Reset. This will clear out the current move and the buffer, but not affect the machine position or state. Ideally, quitting an SD job would be similar.

We have been talking about implementing some "rules" in the code to avoid danger, but right now it is "trust the user". I agree that restricting access to the primary loop might be a good start.

I'll do some experiments using the reset method soon.

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024

Ref: [FILE:/tesla.nc,SIZE:1023467]

The comma was suggested by Sonny (of Grbl) @chamnit

Due to the current way incoming text is parsed, there are some other valid characters that can't be used also. The hope was to keep major parts of this port as close to stock Grbl as possible.

from grbl_esp32.

terjeio avatar terjeio commented on June 9, 2024

The vertical bar is used to separate the main elements in the realtime report, so there is a precedence for its use in Grbl. Should I raise an issue over at the master branch to adress it?

I am aware of the other characters reserved by Grbl and I filter out the files containing them. Presenting unusable filenames to the user is bad practice - or perhaps adding an optional third field to the report that indicates so is a better way? Just thinking aloud...

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024

The only thing right now that is affected is WebUI. We would have to coordinate that before a change.

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024

I updated mc_reset() with this...

#ifdef ENABLE_SD_CARD
  // do we need to stop a running SD job?
  if (get_sd_state(false) == SDCARD_BUSY_PRINTING) {
    closeFile();			
  }
#endif

It seems to work great. If you feed hold and then reset while running a file from the SD. It stops and resets, but no position is lost. It works the same as streaming with no new commands.

closeFile() takes care of all the flags.

from grbl_esp32.

luc-github avatar luc-github commented on June 9, 2024

The web ui does not rely on SD $ commands but direct SD API so changing $ commands output should not affect it

from grbl_esp32.

terjeio avatar terjeio commented on June 9, 2024

Is the web ui using the SD API for listing the files as well? If so, does that mean that no senders using the [FILE... report exists yet?

IMO to not confuse users, files with invalid names should be listed in the UI but flagged as such, thus avoiding questions about why they do not show up.

Valid files:

[FILE:/tesla.nc|SIZE:1023467]
[FILE:/tesla,file.nc|SIZE:1023467]

Invalid file:

[FILE:/tesla file.nc|SIZE:1023467|INVALID]

Next step for me now is to write an UI control in C# for handling the SD card.

from grbl_esp32.

luc-github avatar luc-github commented on June 9, 2024

Yes it was my meaning
Also in web ui, invalid names are displayed but print command is not available

from grbl_esp32.

luc-github avatar luc-github commented on June 9, 2024

IMHO instead of displaying Invalid the file should not be displayed at all

from grbl_esp32.

terjeio avatar terjeio commented on June 9, 2024

IMHO instead of displaying Invalid the file should not be displayed at all

Adding the INVALID flag means that the decision to show them or not is up to the UI designer. I would prefer to show them, perhaps with a tooltip explaining why they are not usable.

from grbl_esp32.

luc-github avatar luc-github commented on June 9, 2024

In that case why not keeping same logic to all files and displaing all files present on SD ?

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024

I am OK with changing to the vertical bar.

I am not a fan of the INVALID labeling. I think it implies more than just file extension checking. Even files with a matching file extension could have internal reasons for being invalid. I am OK with displaying all files.

This allows the sender to decide what types to show. If the sender wants to allow .luc files, there is probably a good reason for it.

BTW: I will work look into a good way to terminate an SD card job if the gcode is not valid in the file.

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024
  • I have changed the directory listing to use the vertical line. WebUI seems to be OK with that.
  • I have removed all file filtering. It is up to the sender to determine what to allow the user to do.
  • If you feed hold and then reset, the job will stop and close the file. The last line read will be reported.
  • If your SD file has bad gcode, the job will stop and report the bad line number.

While everything seems to be OK, the WebUI is not displaying the error messages.

I will push the code to the WebUI branch soon.

from grbl_esp32.

luc-github avatar luc-github commented on June 9, 2024

Which error messages are not displayed by Web ui ?

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024

Sorry @luc-github I was wrong about that. It appears to work fine. The changes have been pushed to the WebUI branch

from grbl_esp32.

luc-github avatar luc-github commented on June 9, 2024

cool ^_^ great add

from grbl_esp32.

terjeio avatar terjeio commented on June 9, 2024

@bdring

Thanks.

I got hold of an ESP WROOM module yesterday and have started tinkering with a driver for my Grbl port. I am currently abroad with no access to motors or oscilloscope so I am not able to verify stuff other than with LEDs and UART reports. Also, I am using the ESP-IDF libraries with Eclipse as the IDE (no Arduino stuff).

What migth interest you that it seems I am able to use RMT for generating the stepper pulses, both with delay (not able to verify yet) and signal inversion. So perhaps not impossible after all? Did you give up because of the Guru beeing unhappy?

Also switch debouncing seems to work for me, I am using a RTOS timer for the delay - starting the timer from the ISR.

from grbl_esp32.

bdring avatar bdring commented on June 9, 2024

I was able to get the RMT to work without panics, but I was seeing inconsistent timing on the o'scope. The single step timing was fine, but time between steps was not as good. I also saw inconsistent timing with the direction pin.

I think there should be a way to make it work. I think the API might need to be looked at to optimize it for Grbl.

Please start a new issue on this, if you have more to share.

from grbl_esp32.

terjeio avatar terjeio commented on June 9, 2024

@bdring

I think there should be a way to make it work. I think the API might need to be looked at to optimize it for Grbl.

I only use the API when setting up the pulse (on init and setting changes), to start the pulse I write registers (bits) directly;

    if(step_outbits.x) {
        RMT.conf_ch[0].conf1.mem_rd_rst = 1;
        RMT.conf_ch[0].conf1.tx_start = 1;
    }

    ...

Please start a new issue on this, if you have more to share.

I will do if I can verify with an oscilloscope, but have to wait until I get access - not until early November.

from grbl_esp32.

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.