GithubHelp home page GithubHelp logo

grbl_controller_esp32's Introduction

grbl_controller_esp32

This Grbl controller runs on a ESP32

This project allows to control a CNC running GRBL without having to use a pc.

This is an alternative to Marlin or Repetier for CNC.

Note: GRBL has to run on a separate micro computer (e.g. an Arduino Uno, Mega or a STM32 blue pill).
This project only intends to replace the PC by an ESP32 board, not to replace GRBL.

This application allows to:

  • select a file on the SD card (with Gcode) and send it to GRBL for execution
  • pause/resume/cancel sending the Gcode
  • send predefined set of GRBL commands (= macros)
  • unlock grbl alarm
  • ask grbl for homing the CNC
  • move X,Y, Z axis by 0.01, 0.1, 1, 10 mm steps
  • set X, Y, Z Work position to 0 (based on the current position)
  • forward GRBL commands from the PC (so you can still control your CNC using your pc with e.g. Universal Gcode sender).
    This is e.g. useful to configure GRBL from the PC with GRBL "$" commands.
    The Gcode/commands can be sent using or
    • the USB (serial) interface that exist on the ESP32 developement board.
    • a telnet protocol over Wifi (in this case, best is to use BCNC software on pc side because it support telnet connection)
  • let a browser session running on pc connect to the ESP32 over Wifi in order to upload/download files between the pc and the SD card. So you can avoid physical manipulation of SD card. This works currently only with the root directory on the SD card (not with subdirectory)

This application displays some useful GRBL informations like

  • the source of the Gcode being sent to GRBL (e.g. SD card, USB, Telnet)
  • the GRBL status (Idle, Run, Alarm,...)
  • the work position (Wpos) and the machine position (Mpos)
  • the last error and alert message.

Optionnally you can connect a Nunchuk (kind of joystick) in order to move the X, Y, Z, axis.
To move the axis, you have to move the joystick (up/down/left/right) and simultaneously

  • press the C button to move X/Y axis,
  • press the Z button to move Z axis Nunchuk is automatically disconnected when the source of Gcode USB or Telnet.

Hardware

To implement this project you need:

  • an ESP32 development board and
  • a display module combining 3 components:
    • a touch screen 320 X 240 a ILI9341 (display controller),
    • a XPT2046 (control the touch panel) and
    • a SD card support.

It should also be possible to use a separate SD card support.
Note: this configuration uses the ILI9341 with 4 wires (CLK, MOSI, MISO and CD).
Currently, this project works only with a TFT having a ILI9341 chip, a resolution of 320X240 and XPT2046 chip for the touch screen. If you are using another display, you should change the code yourself.

Software

This project compiles in Arduino IDE but it requires:

  • to add in Arduino IDE the software that support ESP32. The process is explained e.g. in this link https://randomnerdtutorials.com/installing-the-esp32-board-in-arduino-ide-windows-instructions/
  • to edit the file config.h from this project in order to specify if you plan to use the WiFi and if so if you are using the ESP32 in station mode or in access point mode. When using the WiFi, you must also specify the SSID (= name of the access point) and the password (in access point mode, it must contain at least 8 char)
    Note: the WiFi parameters can also be changed using the SD card. So you do not have to recompile and reflash the firmware. To change the WiFi parameter with the SD card, you have to put a file named "wifi.cfg" (respect the case) on the root of SD card. The file must contain 3 lines with:
    WIFI="ESP32_ACT_AS_STATION"
    PASSWORD="your password"
    SSID="your access point"
    You can only change: "ESP32_ACT_AS_STATION" (change by "NO_WIFI" or "ESP32_ACT_AS_AP") , "your password" and "your access point"
    Once uploaded from config.h or from file wifi.cfg, the parameters are saved inside the ESP32 and are reused until new parameters are uploaded via SD card.
    So you can remove the "wifi.cfg" file from SD card once the program runs once.

Take care that if you do not use my configuration, you can have:

  • to edit the file User_setup.h included in the TFT_eSPI_ms folder.
    This file specify the type of display controller and the pins being used by the SPI, the display and the touch screen chip select.
  • to edit the file config.h from this project in order to specify some pins being used (e.g. the chip select for the SD card reader)

Note: the pins used for the SPI signals (MOSI, MISO, SCLK) are currently hardcoded.
Please note that many ESP32 pins are reserved and can't ne used (reserved for bootup, for internal flash, input only,...). See doc on ESP for more details.

Note: the first time you let ESP32 run this program, the program should execute a calibration of the touch panel.
The screen should first display an arrow in a corner. You have to click on the corner.
When done, an arrow should also be displayed sucessively in the 3 others corners. Click each time on the arrow.
This should normally be done only once. The calibration data are stored automatically in the ESP32.

If you want to recalibrate your screen, you should replace, in the "config.h" file, "#define REPEAT_CAL false" by "#define REPEAT_CAL true".
Change it back to "#define REPEAT_CAL false" afterwards.
Alternatively you can force a recalibration from the SD card. To do so, you have to put a file named "calibrate.txt" in the root of the SD card. The content of the file does not matter (only the file name). Remove the file from SD card once calibration is done in order to avoid to do it at each power on.

Wiring the ESP32

Here the connections being used in my own setup.

Between ESP32 and TFT.

  • 5V - - - - - -> Vcc (on my TFT, it provides internally voltage to SD card)
  • Gpio13 - - -> CS(chip select)
  • Grnd - - - -> Grnd (on my TFT, it provides internally grnd to SD card)
  • Gpio12 - - -> Reset
  • Gpio14 - - -> DC (data/command)
  • Gpio25 - - -> CD
  • Gpio18 - - -> CLK
  • Gpio19 - - -> MISO
  • Gpio23 - - -> MOSI

Between ESP32 and touch screen

  • Gpio27 - - -> CS (chip select)
  • Gpio18 - - -> CLK
  • Gpio19 - - -> MISO(T_DO)
  • Gpio23 - - -> MOSI(T_DIN)

Between ESP32 and SD card

  • Gpio26 - - -> CS (chip select)
  • Gpio18 - - -> CLK
  • Gpio19 - - -> MISO
  • Gpio23 - - -> MOSI

Between ESP32 and GRBL computer

  • Gpio16 is the Serial port Rx from ESP32; It has to be connected to TX pin from GRBL
  • Gpio17 is the Serial port Tx from ESP32; It has to be connected to RX pin from GRBL Note : Grnd has to be common between ESP32 and GRBL computer.

Between ESP32 and Nunchuk

  • 3.3V => Vcc
  • Grnd => Grnd
  • Gpio21 => SDA
  • Gpio22 => SCL

Control of GRBL from the PC

In order to control GRBL from a PC, you can use the software bCNC on the PC.
It allows you to connect ESP32 using a com port (USB) or using wifi.
To install bCNC, follow the instructions from this site: https://github.com/vlachoudis/bCNC/wiki/Installation
For Windows, do not use the exe file (at march 2019 it did not work) but start intalling python2.7 and then install bCNC using pip.
At march 2019, this does not install the latest version of pyserial software.
So, you have to enter also (in the command windows): pip install --upgrade pyserial
Then, you can launch bCNC with the command: python.exe -m bCNC.
Note: if you already have a version 3 of python running on your PC, it could be that you have to type: python2.exe -m bCNC.\

In bCNC, select the "File" tab, and in the Serial part, in field Port, enter:\

  • for a USB connection : comX (where X is the com port assigned to ESP32 e.g. with Arduino)
  • for a Wifi (telnet) connection : socket://192.168.1.5:23 (where 192.168.1.5 has to be replaced by the IP adress assign to your ESP32)

In bCNC, in the serial part, in field Controller, enter the type of GRBL you are using, so probably it will be GRBL1.\

Then click on the "Open" button in bCNC.
And finally, on ESP32, select the Print button and then "USB" or "Telnet".
Once USB or Telnet is activated, you can't anymore use the ESP32 options (Setup, ...).
The only thing you can do on ESP32 side is to select the button "Stop PC" which will stop the flow of data exchanged with the PC.\

Control of SD card content from the PC

In order to manage the files on the SD card from the PC, you have to:

  • open a browser session (chrome, ...)
  • fill in the URL of your ESP32 e.g. //192.168.1.5 (the value is displayed on the setup screen on ESP32)
  • then click on the buttons Download, Upload , Delete, Directory Note: you can only interact with the root of the SD card (not the sub directories).

Informations on the TFT layout and functions

Info screen:

This is the first and main screen of the application. It displays:

  • line 1 left: a status saying if you are printing from SD card (and % of printing), in Pause or if GRBL is controlled via PC+USB or via PC+wifi
  • line 1 right: the GRBL status (Idle, Run, Alarm , Hold, Jog, ...) or "??" when GRBL is not responding (e.g. GRBL in alarm:1)
  • line 2: the last message (error or alarm) sent by GRBL. This message is automatically cleared when you go back from Setup screen to Info screen.
  • line 3: a wifi icon; it is red when there are no PC connected with telnet, green when a pc is connected with telnet
  • next lines: the X, Y, Z positions in Work coordinate and in Machine coordinate
  • last line: the current feed rate and spindle rpm.
  • there are also 2 buttons that depends on the current state (e.g. Setup, Print, Pause, Resume, Cancel)

Setup screen

It displays:

  • The IP address to be used if you want to
    • upload/download/delete/list files from the root directory on the SD. This IP has to be entered in a PC browsing session
    • use a telnet (=wifi) connection to control GRBL
    • The GRBL status
  • The last message from GRBL
  • some buttons to request from GRBL a Homing, an unlock or a soft reset
  • some buttons to access other screens

Print screen

It displays some buttons to select between

  • printing a file from the SD card; you will then get a screen with a list of files/directories on the SD card
  • printing/controlling GRBL from the PC using the USB connection.
  • printing/controlling GRBL from the PC using a telnet connection.
  • direct links to other screens (Setup, Cmd, Info) Note: with USB and Telnet, the ESP32 works in "passthrough". It means that it works just like the PC was directly connected to GRBL. So, Once USB or Telnet is activated, you can't anymore use the ESP32 options (Setup, ...).
    The only thing you can do on ESP32 side is to view the current position and status and to select the button "Stop PC" which will stop the flow of data exchanged with the PC.\

File list screen

It allows to select a file in a directory from the Sd card

  • line 1 left: index of the first file name being displayed followed by "/" and the total number of files in the current directory
  • line 2 right: name of the current directory (/ for the root)
  • up to 4 buttons with file/directory names; text is blue on white background for a directory and the opposite for a file. Pressing one of those buttons goes into the directory (one level down) or start printing the file (= sending the Gcode to GRBL). Still printing does not start immediately because the controller is first set in Pause mode in order to let you eventually cancel the job. So, in order to really start printing you have to confirm pressing the Resume button on Info screen
  • button UP to move one level up in the directory hierarchy
  • button <- and -> to scroll in the list

Move screen

It allows to move the motors in the X, Y and Z axis.

  • It displays the current work positions and the distances moved since this screen has been entered.
  • there are 2 kinds of moves
    • when the button "Auto" is displayed, it means that the distances to move depends on the duration of pressing a X,Y,R button. When you keep pressing, the speed increases. When you releases, the motor stops)
    • If you press the "Auto" button, the button will be renamed "0.01". It means that each press on X, Y,Z will move by 0.01 mm (or inch depending on the GRBL setting). Button X,Y,Z has to be released and pressed again to move a new step. Pressing 0.01 button changes it to 0.1. Pressing again, it becomes 1, 10 and finally back to Auto.

Set XYZ screen

It allows to set the work coordinates X, Y, Z (or all 3) to zero at the current machine position.

Cmd screen

It allows you to execute some set of predefined Gcode commands. It is a kind of macros that you can define yourself (e.g. for probing, changing coordinates system, ...)

  • you can define up to 7 commands (the name and the Gcode commands)
  • to define/update a Cmd button, you have to fill in a file on your pc with one set of Gcode commands and save it under a name like Cmd5_name.xxx where
    • Cmd and _ are fixed
    • 5 is replaced by the digit of the Cmd (must be between 1 and 7)
    • name is replaced by the name given to the button (must be less than 16 char and begin with a letter a...z or A...Z)
    • xxx is the file extension and is discarded
  • this file has to be copied/uploaded on the SD card
  • you have to select this file with the Print from SD Card option. The file (due to the structure of the name) will not be printed but the Cmd button will be created and the Gcode commands will be saved in the ESP32.
  • So, later on, you can use the Cmd buttons even if the SD card is not present. Notes:
  • A button being added will be displayed only after the next reset of ESP32.
  • "Printing" a file having the same Cmd digit as an existing Cmd button will replace as well the name as the Gcode of the button
  • to delete a Cmd button, "Print" a file having a name equal to "delete" So, e.g. "Cmd2_delete.xxx" will delete the second button.

grbl_controller_esp32's People

Contributors

cotepat avatar mstrens avatar phiju5 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

grbl_controller_esp32's Issues

When WiFi is enabled STA & AP mode causes a pause in sending G code.

When I use it to send code to grbl controller, WiFi function is not turned on. It has no problem and can finish processing. However, after WiFi is turned on, processing the same G code will pause at a certain time and cannot be operated.

In the manual movement interface, one more button flickers on the left to switch the movement distance. It can also be clicked to switch the movement distance.

Hardware recommendations

Hello, I would like to implement your idea, and was looking at the hardware needs, do you have any links for the board, screen and pad?

No WiFi with last update

I updated my TFT with the newest firmware.
Of course I edited the config.h file.

My WiFi name consists of two words seperated by a space, such as:
word1 word2

The password consists of letters (big and small), numbers and special characters.

So my config.h looks like:

// If wifi is used, set the parameter to identify the access point (= the router when ESP32_ACT_AS_STATION or the ESP32 when ESP32_ACT_AS_AP)
#define MY_SSID "word1 word2" // replace by the name of your access point (when act as station) or the name you assign to your device (when act as acces point)

// Only for ESP32_ACT_AS_STATION , set the password to get access to your access point (router)
#define MY_PASSWORD "aBc1234?" // replace by the password of your access point (when act as station) or the password you want to use to protect your ESP32 (when act as acces point)
// in this last case, password can remains empty
// select your language between EN, FR, DE
#define LANGUAGE DE 

Of course this are fictitious values but it should show the situation.
Please mention the " in which each value is - is it correct so?

I thought it must work like this but when I start my TFT sometimes allways show an error.
Either Error 1 "Expected cmd letter" or Error 2 "Bad number format".
As my WiFi doesn't work (as showed on the TFT) I think the errors have something to do with the WiFi problem.

bluetooth

please add bluetooth connectivity feature

Problem with programming the ESP32 module for the TFT display

I am very exited about the RS-CNC32, I am building one myself. I now have a problem however when trying to upload the firmware to the ESP32 module (to be mounted to the TFT module).

All goes well until step 4, second bullet:

(!) Problem is now that there are "No programmers available for this board" when trying to select "USBasp" as instructed, I have tried to find out, but in the end I have no clue where this programmer should come from. Included in Arduino IDE, or, more likely, somewhere from the 'grbl_controller_esp32' code.

I am really stuck here and would appriciate help to resolve this. Most likely, it is an error on my behalf, but I can't get a grip on it. Happy to supply additional information when required.

Problem with TFT operation

Good afternoon

I'm trying to assemble the device you designed. ESP32 successfully firmware through Arduino IDE.

If after loading ESP 32 to include without connected TFT, the serial monitor works according to the program.
1

If I connect a TFT, a cyclic error appears in the serial monitor.
2

Tried different versions of boards and memory volumes. Tried other boards as well. The result is the same. TFT 3.2" 320x240 ILI9341.
Connection according to the following scheme
readme
image share

SDcard write problem

Hello, first please your work and your effort.
I have problems when uploading a file, a "sdcard protect?" Message appears on the web interface, I have looked at the code but it is difficult for me, I have seen that if there is a file with the same name it first deletes them, and that it does ok, but there is some problem with writing the file, the sd card is sd hc 4gb fat32 format, I have checked the wiring and it seems correct, when I download a file from the sd it works correctly.
Any suggestion?

Thanks in advance

Unsupported command

Unsupported commands should be ignored after prompting, not abandoned running!
Other software does the same! For example: candles

'File' does not name a type - Error when compiling

Hi,

I tried to compile the project with Arduino 1.8.13. At first I didnt have the SdFat library which I installed, but now I get this error and i dont know how to make it work. Do you have some ideas?

Here is the output I get:

Thank you!!

menu_file.cpp:53:1: error: 'File' does not name a type
 File fileToShow ;   // this contains the file being sent from SD
 ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp: In function 'uint16_t fileCnt(uint8_t)':
menu_file.cpp:138:3: error: 'File' was not declared in this scope
   File file ; 
   ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp:138:3: note: suggested alternative:
In file included from C:\TEMP\arduino_build_855381\sketch\TFT_eSPI_ms/TFT_eSPI.h:114:0,
                 from C:\TEMP\arduino_build_855381\sketch\config.h:4,
                 from C:\TEMP\arduino_build_855381\sketch\menu_file.cpp:13:
C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS\src/FS.h:47:7: note:   'fs::File'
 class File : public Stream
       ^
menu_file.cpp:140:11: error: 'file' was not declared in this scope
   while ( file.openNext( &aDir[level] ) ) {
           ^
menu_file.cpp:145:3: error: 'file' was not declared in this scope
   file.close();
   ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp: In function 'boolean updateFilesBtn()':
menu_file.cpp:165:3: error: 'File' was not declared in this scope
   File file ;
   ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp:165:3: note: suggested alternative:
In file included from C:\TEMP\arduino_build_855381\sketch\TFT_eSPI_ms/TFT_eSPI.h:114:0,
                 from C:\TEMP\arduino_build_855381\sketch\config.h:4,
                 from C:\TEMP\arduino_build_855381\sketch\menu_file.cpp:13:
C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS\src/FS.h:47:7: note:   'fs::File'
 class File : public Stream
       ^
menu_file.cpp:168:12: error: 'file' was not declared in this scope
     if ( ! file.openNext( &aDir[dirLevel] ) ) {       // ouvre le prochain fichier dans le répertoire courant ; en cas d'erreur, retour à la page info avec un message d'erreur 
            ^
menu_file.cpp:174:5: error: 'file' was not declared in this scope
     file.close() ;
     ^
menu_file.cpp:182:12: error: 'file' was not declared in this scope
     if ( ! file.openNext( &aDir[dirLevel] ) ) {
            ^
menu_file.cpp:189:10: error: 'file' was not declared in this scope
     if ( file.isDir() ) { 
          ^
menu_file.cpp:193:12: error: 'file' was not declared in this scope
     if ( ! file.getName( pfileNames , 21 ) ) {   // Rempli fileNames avec le nom du fichier
            ^
menu_file.cpp:203:5: error: 'file' was not declared in this scope
     file.close() ;
     ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp: In function 'boolean setFileToRead(uint8_t)':
menu_file.cpp:257:3: error: 'fileToShow' was not declared in this scope
   fileToShow.close() ;
   ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp: In function 'void setShowBuffer()':
menu_file.cpp:376:3: error: 'fileToShow' was not declared in this scope
   fileToShow.seek( sdMillPos ) ; // set the same position for the file used for display
   ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp: In function 'void setPrevShowBuffer()':
menu_file.cpp:421:3: error: 'fileToShow' was not declared in this scope
   fileToShow.seek( sdShowBeginPos ) ; // set this position for the file used for display
   ^
C:\TEMP\arduino_build_855381\sketch\menu_file.cpp: In function 'void setNextShowBuffer()':
menu_file.cpp:432:3: error: 'fileToShow' was not declared in this scope
   fileToShow.seek( sdShowBeginPos ) ; // set this position for the file used for display
   ^
browser.cpp:38:1: error: 'File' does not name a type
 File root ; // used for Directory 
 ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp: In function 'void DownloadFile(String)':
browser.cpp:327:7: error: 'File' was not declared in this scope
       File download ;
       ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp:327:7: note: suggested alternative:
In file included from C:\TEMP\arduino_build_855381\sketch\TFT_eSPI_ms/TFT_eSPI.h:114:0,
                 from C:\TEMP\arduino_build_855381\sketch\config.h:4,
                 from C:\TEMP\arduino_build_855381\sketch\browser.cpp:12:
C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS\src/FS.h:47:7: note:   'fs::File'
 class File : public Stream
       ^
browser.cpp:328:7: error: 'download' was not declared in this scope
       download = sd.open( filename.c_str() );
       ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp: At global scope:
browser.cpp:356:1: error: 'File' does not name a type
 File UploadFile;
 ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp: In function 'void handleFileUpload()':
browser.cpp:366:9: error: 'UploadFile' was not declared in this scope
         UploadFile.close() ;
         ^
browser.cpp:372:12: error: 'UploadFile' was not declared in this scope
         if(UploadFile) { 
            ^
browser.cpp:381:12: error: 'UploadFile' was not declared in this scope
         if(UploadFile && ( errorWhileUploading == false) )          // If the file was successfully created
            ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp: In function 'void sd_dir()':
browser.cpp:403:5: error: 'root' was not declared in this scope
     root.close() ;
     ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp: In function 'void printDirectory(const char*, uint8_t)':
browser.cpp:428:3: error: 'File' was not declared in this scope
   File root1 = sd.open(dirname);
   ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp:428:3: note: suggested alternative:
In file included from C:\TEMP\arduino_build_855381\sketch\TFT_eSPI_ms/TFT_eSPI.h:114:0,
                 from C:\TEMP\arduino_build_855381\sketch\config.h:4,
                 from C:\TEMP\arduino_build_855381\sketch\browser.cpp:12:
C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS\src/FS.h:47:7: note:   'fs::File'
 class File : public Stream
       ^
browser.cpp:431:7: error: 'root1' was not declared in this scope
   if(!root1){
       ^
browser.cpp:435:7: error: 'root1' was not declared in this scope
   if(!root1.isDir()){
       ^
browser.cpp:439:3: error: 'root1' was not declared in this scope
   root1.rewind();
   ^
browser.cpp:441:8: error: expected ';' before 'file1'
   File file1 ;
        ^
browser.cpp:442:9: error: 'file1' was not declared in this scope
   while(file1.openNext(&root1)){
         ^
browser.cpp:468:3: error: 'file1' was not declared in this scope
   file1.close();
   ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp: In function 'void SD_file_delete(String)':
browser.cpp:482:5: error: 'File' was not declared in this scope
     File dataFile = sd.open( filename.c_str() ); //  
     ^
C:\TEMP\arduino_build_855381\sketch\browser.cpp:482:5: note: suggested alternative:
In file included from C:\TEMP\arduino_build_855381\sketch\TFT_eSPI_ms/TFT_eSPI.h:114:0,
                 from C:\TEMP\arduino_build_855381\sketch\config.h:4,
                 from C:\TEMP\arduino_build_855381\sketch\browser.cpp:12:
C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS\src/FS.h:47:7: note:   'fs::File'
 class File : public Stream
       ^
browser.cpp:483:9: error: 'dataFile' was not declared in this scope
     if (dataFile) {
         ^
Mehrere Bibliotheken wurden für "WiFi.h" gefunden
 Benutzt: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi
 Nicht benutzt: C:\Program Files (x86)\Arduino\libraries\WiFi
Bibliothek SPI in Version 1.0 im Ordner: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SPI  wird verwendet
Bibliothek FS in Version 1.0 im Ordner: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\FS  wird verwendet
Bibliothek SPIFFS in Version 1.0 im Ordner: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\SPIFFS  wird verwendet
Bibliothek Wire in Version 1.0.1 im Ordner: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\Wire  wird verwendet
Bibliothek SdFat in Version 2.0.2 im Ordner: C:\Users\pkleesse\Documents\Arduino\libraries\SdFat  wird verwendet
Bibliothek Preferences in Version 1.0 im Ordner: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\Preferences  wird verwendet
Bibliothek WiFi in Version 1.0 im Ordner: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WiFi  wird verwendet
Bibliothek WebServer in Version 1.0 im Ordner: C:\Users\pkleesse\AppData\Local\Arduino15\packages\esp32\hardware\esp32\1.0.4\libraries\WebServer  wird verwendet
exit status 1
'File' does not name a type

Error when setting axis to zero

Hi ! first of all thanks for this awesome work! I'm having a strange issue, I use the firmware to control a 4 axis hotwire machine, when I set all axis to zero(XYZA) mpos don't become zero and sometimes it affect when I load a file to run, what could I do to zero everithing ?

Does not compile on Mac without some tweaks

Hi. It does not compile on my Mac (and on somebody else I know). Not sure it matters but it is a M1 Macbook.

The error has to do with the spaces in the name of the .h files of the icons.

Once I replaced every ".h " by ".h", it was solved

Temporary force USB mode

Is it possible to temporary force USB mode so I can use the CNC without a working touchscreen? I'm waiting for a replacement and need to use the CnC asap.

Z-axis stops due to Alarm-1

So I have a few issues going on. Any insight on how to resolve them would be greatly appreciated.

My alarm code is "Alarm-1" reset with homing
Also on startup sometimes I get a Door:0 error , but it goes away when I reset the power.

This is my main issue. While using the nun chuck or the touchscreen the x-axis and y-axis move correctly, but the Z-axis will move only a little bit then trigger the alarm. It was working properly, but now I can barley get it to move without triggering the alarm.

This is another issue I am having. When I hit home all of the axis will move in the correct order and stop when triggering end stops. However, sometimes the x-axis will stop before any of the end stops are reached. Once the y-axis is reached the x-axis will move toward the end stop. Most of the time it will trigger the ends stop, but sometimes it will give up.

support for 4 Inch HD 480x320 TFT Display with Touch Screen (for Rapberry Pi)

Hello, thank you for such a good project,
I have 4 Inch HD 480x320 TFT Display with Touch Screen for Rapberry Pi and I guess it is possible to use for your controller. This display does not have sd card option, so needed a seperate module. Maybe also some other Raspberry owners will be interested using their LCD hardware for cnc.
Could you tell or publish any solution?

Interface: SPI
Touch panel control chip: XPT2046
"https://www.elecrow.com/wiki/index.php?title=4_Inch_HD_480x320_TFT_Display_with_Touch_Screen_for_Rapberry_Pi"
image
image

Switching to platformIO

I think it will be a good think to move from ArduinoIDE to PlatforIO.

The depencies management is a lot better and i think it will be easier for user to build and flash the card with PlatformIO.

It also support natively the esp32.

Serial2 causes reboot

Sorry I probably missed something, but Serial2 communication keeps restarting my ESP. I use Arduino CNC shield (on GRBL side) so I use logic level shifter, I tried several of them , I tried various power sources. I tried UART com between PC and shield, without conflict. Any thoughts? The Idea is brilliant, execution great so I love to make it work.

Card mount errors

Sd card give card mount error randomly. Remounting did not solve the issue. Switching to different sd card sometimes works but when I reboot the system it will give the same mount error. Is there a debug mode for it how can I resolve it?

2.8inch_ESP32-2432S028R display support

I purchased this 2.8inch_ESP32-2432S028R display as it had esp32 wroom, ILI9341 TFT driver and XPT2046 touch screen driver as well as sdcard reader on one board. The screen is 2.8" 240x320. When I received it I found the io pin routing are different as the tft, touch and sdcard are all hard wired to different mosi, moso ,sck pins. I was able to get the tft and sdcard working but not the touch. I set the config.h to TFT_CARD_VERSION 2 as this allowed for vspi and hspi to be used. The user_setup. h and config were also changed to the pin assignments for the board. Everything compiled properly and the screen works but I get stuck on the calibration screen. I put a calibrate.txt on the sdcard and that is detected but no touch. I tried the touch test sketch but no input response when viewed in serial monitor. I am fairly new to esp32 programming but it seems that only 2 spi channels are available and this looks like it should require 3. I thought about cutting traces and rewiring but if a software solution was available I think this would make a great screen for this project. I hope to use it with my mpcnc running on a PandaZhu esp32 board running grbl.

From the User Guide / Sample Code / Schematic :
#define ILI9341_2_DRIVER // Alternative ILI9341 driver, see Bodmer/TFT_eSPI#1172
#define TFT_WIDTH 240
#define TFT_HEIGHT 320
#define TFT_BL 21 // LED back-light control pin
#define TFT_BACKLIGHT_ON HIGH // Level to turn ON back-light (HIGH or LOW)
#define TFT_MOSI 13 // In some display driver board, it might be written as "SDA" and so on.
#define TFT_SCLK 14
#define TFT_CS 15 // Chip select control pin
#define TFT_DC 2 // Data Command control pin
#define TFT_RST 12 // Reset pin (could connect to Arduino RESET pin)
#define TFT_BL 21 // LED back-light
#define SPI_FREQUENCY 55000000 // STM32 SPI1 only (SPI2 maximum is 27MHz)
// Optional reduced SPI frequency for reading TFT
#define SPI_READ_FREQUENCY 20000000
Touch Screen:
#define XPT2046_IRQ 36
#define XPT2046_MOSI 32
#define XPT2046_MISO 39
#define XPT2046_CLK 25
#define XPT2046_CS 33
// The XPT2046 requires a lower SPI clock rate of 2.5MHz so we define that here:
#define SPI_TOUCH_FREQUENCY 2500000

SD CARD READER:
IO 5 - CS
IO 23 - MOSI
IO 18 - CLK
IO 19 - MISO

text section exceeds available space in board

Trying to compile hits me with the following message:

text section exceeds available space in boardO sketch usa 1543542 bytes (117%) de espaço de armazenamento para programas. O máximo são 1310720 bytes.

Variáveis globais usam 86476 bytes (26%) de memória dinâmica, deixando 241204 bytes para variáveis locais. O máximo são 327680 bytes.
Sketch too big; see https://support.arduino.cc/hc/en-us/articles/360013825179 for tips on reducing it.
Erro compilando para a placa DOIT ESP32 DEVKIT V1

Am I doing something wrong?

No movement in Auto mode

"Move" screen...
The button "Auto" is displayed, but if i press any button (X,Y,Z) there are no movements. In other modes (0.01/0.1/1/10) cnc moves correctly
What will i have to change in my script (maybe delays somewere) to fix it.

Telnet connection to GRBL does not work.

Hello,

I was not able to make telnet connection to GRBL through TFT work using the current code in master branch.
After some investigation, I managed to have it work with the following fix :

diff --git a/grbl_controller_esp32/com.cpp b/grbl_controller_esp32/com.cpp
index fe49de0..d2499b1 100644
--- a/grbl_controller_esp32/com.cpp
+++ b/grbl_controller_esp32/com.cpp
@@ -454,7 +454,7 @@ void sendToGrbl( void ) {
           case PRINTING_FROM_TELNET :
             while ( telnetClient.available() && statusPrinting == PRINTING_FROM_TELNET ) {
               sdChar = telnetClient.read() ;
-              sdChar = Serial.read() ;
+              toGrbl( (char) sdChar ) ;
               //Serial2.print( (char) sdChar ) ;
             } // end while       
             break ;

The procedure to apply it is as follow:

  1. Apply the fix in Arduino IDE
  2. Compile and upload the new firmware to the TFT Screen
  3. Unplug your usb cable
  4. Telnet into the TFT Screen, you should see machine status report printing continuously.
  5. On the TFT screen, go the print menu and choose telnet connection
  6. The status report should stop printing on the computer telnet console
  7. You can now type some GRBL commands, for example $$

I hope this will help others !

Can I cancel the key function of SD grbl?

Hello:
Can I cancel the key function of SD grbl? Or can you tell me where to modify the program.
Or it can be modified to read the grbl sd card period, if it exceeds the set time, it will end the read and return.

IMG_1735-cut

When I connect to grbl (arduino uno) without sd card, it will stay waiting and not work

IMG_1736-cut

Wifi Bridge trobles

Hello!

I try to use esp8266 as SerialBrige to connect on Arduino Nano (Grbl). It not works with bCNC.

can you explain me, that's the difference between your Software and https://github.com/arkypita/ESP8266-SerialTelnet ?

Both do not implement rfc2217 ? It likes similar to yours

your url looks like this : socket://ip:23 or rfc2217:// or some thing else?

can you help me to find/write a library for my purpose? Thank you.

TFT problem

Hi! I'am using a 2.8 inches 320x240 display, same hardware and wiring of the code here.
I can't see anything on the screen, for testing the hardware I used the original TFT_eSPI library and works as expected. When I tried to replace the library I noticed that there are some differences and the code don't compile.
Any idea on what is happening?
Thanks!

2.8inch_ESP32-2432S028R cannot get any menus

Well I thought I had some luck with this all in one display with a built in ESP32 Wroom 32 when I changed the pins for the xpt2046 MOSI,MOSO and CLK to share with sdcard. I do have it set to TFT_Card_Version 2. I get the calibration coming up and touch works but then the screen just goes black with no menus. I do have calibrate.txt on the sdcard and it reads it fine. I also get the wifi working and can access the webpage and can upload files. I just cannot get anything to the screen after the calibration is done or if the card is ejected.; I have tried everything I can think of so here is a zip file with the modified schematics, user_settings.h and config.h as well as the manual for the display assembly. Any help would be wonderful and thank you for the work on this project.
GRBL_Controlller_esp32_settings.zip

Screen freeze when accessing GRBL sd card via telnet and telnet does not work

lorsque, à partir de l'écran tactile, tu essaies de voir ce qu'il y à sur la carte sd de la carte grbl et que tu es en telnet (mais je penses que ça doit le faire aussi en bluetooth), s'il n'y à pas de connexion d'établie (problème wifi, ...) le tft reste bloqué sur la recherche et on n'a pas d'autre choix pour annuler que d'éteindre le tft et de le rallumer.
Je ne sais pas si ça peut se corriger avec une tempo ou avec un bouton retour.

can not flash

Arduino:1.8.10 (Mac OS X), 开发板:"ESP32 Dev Module, Disabled, Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS), 240MHz (WiFi/BT), QIO, 80MHz, 4MB (32Mb), 921600, None"

"Wire.h" 对应多个库
已使用: /Users/jasing/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/Wire
"SPI.h" 对应多个库
grbl_controller_esp32:61:19: error: SdFat.h: No such file or directory
已使用: /Users/jasing/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SPI
compilation terminated.
"FS.h" 对应多个库
已使用: /Users/jasing/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/FS
"SPIFFS.h" 对应多个库
已使用: /Users/jasing/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/libraries/SPIFFS
exit status 1
SdFat.h: No such file or directory

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

expect your help:)

Thank you~

Compilation error

Hi I got these errors:

image

Can someone help me?
I tried downgrading SdFat to 1.1.4 but more errors appeared.

platformio.ini

[env:esp32dev]
platform = espressif32
board = esp32dev
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries
lib_deps =
 SdFat
src_filter =
    +<*.h> +<*.s> +<*.S> +<*.cpp> +<*.c> +<*.ino> +<src/>
    -<.git/> -<data/> -<test/> -<tests/> -<Fonts/> -<Extensions/>
upload_speed = 921600
monitor_speed = 115200
monitor_flags =
	--filter=esp32_exception_decoder

my arduino libraries folder
image

Thanks in advance

bCNC Telnet connection

Hello,
thanks for your great work! I really like the project.

I designed my own PCB, uploaded the newest firmware (12.5.) and installed it on my Woodpecker CNC board.

Manual Jog works, Nunchuck works, Direct USB seems to reset the ESP32 but also works after reboot and Print -> USB

But:
I can’t connect bCNC via telnet (saw your issues on the bCNC project. So I used socket:// like in the readme described).
I can connect, the WiFi logo turns green. Then I switch to print -> telnet and try to jog manually (in bCNC) but nothing happens.

This happens on the release version and also on the current master.

I use the current bCNC installed via Pip on my Mac.

Any ideas why?

FD0AC6C6-1673-4201-B510-B4901ABFF0D9
4542113E-DD98-4123-B62A-612B0EC3A2D9

Multi-Use for Pendant

Hello!
I found this repo as per someone else's recommendation. I am working on a motion-controlled camera & miniature rig that has a total of 6 axes. I'd prefer to create my own custom cnc pendant using 24 custom buttons an lcd and a rotary encoder.

I want to have this pendant wired to an esp32 and have it both wirelessly control the cnc grbl_controller but also send it's data to my pc where the commands will control a blender simulation. To simplify, I want to control my rig in realtime, while also recording those inputs in blender, where I will refine the keyed scene and send out a finished gcode file from the PC to the cnc grbl controller.

So my question really is, if I use an esp32 with my custom cnc pendant, can I both control the cnc grbl-controller in realtime and also send that data at my computer? If so, how would I go about doing that?

Thanks

Suggestion to use M5Stack ESP32 with built in 3 buttons and touch screen etc

Hi, have you seen the M5STACK esp32 units, very nicely packaged ready to program. I have one running esp32 port of GRBL but I would like to put a simple stack on top with the gcode sender built in for headless operation.

I'll have a look at your code and see if I can work out how to help.

The screen in the M5 stack is ILI9342C
The touch screen is described as "10x capactive touch interface"

Have a look at www.m5stack.com its a very cool product I recon nicely packaged.

They do actually have a 328p module preconfigured with GRBL 8 bit which would mean an entire GRBL and gcode sender and stepper drivers in a package not much bigger than a match box. Coupled with a decent 24 volt lithium power pack you then have a portable laser solution which is what I am looking for.

cheers
Rich

Parser issue, not catching wposOrMpos correctly, breaks handleLastNumericField()

Referring to

if ( getGrblPosState == GET_GRBL_STATUS_WPOS_HEADER ) { // separateur entre field name et value
getGrblPosState = GET_GRBL_STATUS_WPOS_DATA ;
wposOrMpos = strGrblBuf[0] ; // save the first char of the string that should be MPos or WPos
strGrblIdx = 0 ;
strGrblBuf[strGrblIdx] = 0 ;
wposIdx = 0 ;
} else if ( (getGrblPosState == GET_GRBL_STATUS_START || getGrblPosState == GET_GRBL_STATUS_CLOSED || getGrblPosState == GET_GRBL_STATUS_MESSAGE )

Traced the issue though to the linked code above

If I just add Serial.print to debug, I can see why it fails: Just havent yet dug in deep enough into your code to fashion a fix (edit: see reply below)

Added my serial.println's:

case ':' :
      if ( getGrblPosState == GET_GRBL_STATUS_WPOS_HEADER ) { // separateur entre field name et value 
         getGrblPosState = GET_GRBL_STATUS_WPOS_DATA ; 
         wposOrMpos = strGrblBuf[0] ;       // save the first char of the string that should be MPos or WPos

         // lets see if it gets stored correctly
         Serial.println("");
         Serial.println(strGrblBuf);
         Serial.println("");

         strGrblIdx = 0 ;
         
         strGrblBuf[strGrblIdx] = 0 ;
         wposIdx = 0 ;
      }

And I can see

<Idle|WPos:

Idle

0.000,0.000,0.000|FS:0,0>

That at that point where you store wposOrMpos = strGrblBuf[0] ; that strGrblBuf still contains Idle/Jog/Hold/etc string, and not the expected wPos/mPos

Subsequently, handleLastNumericField() breaks the calculation as it checks:

 if ( wposOrMpos == 'W') {                  // we got a WPos
            wposXYZA[wposIdx] = temp ;
          } else {                                   // we got a MPos
            wposXYZA[wposIdx] = temp - wcoXYZA[wposIdx] ;
          }

But wposOrMpos = "I" (in my current Idle state) so we always hit the "else" calculation (:

Picked up that wpos/mpos data isnt coming though correctly if I use coordinate offsets, along with $10=0 (wpos reporting)
With the default $10=1 it "works" mPos reporting gets handled by the "else" section of handleLastNumericField. But if reporting is not set to $10=1, then we still hit "else" even though it shouldnt. The section of code in handleLastNumericField clearly intends to handle both reporting settings, its just that earlier it gets stored the wrong character (:

Tips go wrong. Expect your help.

Hello, I'm a novice in ARDUINO. I am burning this program until esp32 is unsuccessful, showing whether "'Serial2' was not declared in this scope" is the problem of "change Serialx.flush() and number of Rx bytes before interrupt occurs"? If not, where would it be? I look forward to your help. Thank you!!!!

Wifi ip options

Hello i will sugest for the wifi settings to set by yourself the ip address (Dhcp or fix ip)
thank you

License ?

Hi,
Seem to be nice project,
What is license for this ?

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.