Code Monkey home page Code Monkey logo

esp32's Introduction

ESP32 grblHAL driver

Important:
If enabling ftp upload to the SD card then ffconf.h in the ESP SDK has to be edited, #define FF_FS_RPATH must be changed to 2 or you will get a compiler error.
ffconf.h is located in the subfolder esp-idf\components\fatfs\src in the ESP32 SDK installation. The ESP32 SDK is typically installed in the user folder.

This driver can be built with the Web Builder.

How to build using ESP-IDF v4.3:

While this manual briefly describes basic build process on Linux OS, you can find more details as well as differences for building on other OS at this webpage:

https://docs.espressif.com/projects/esp-idf/en/latest/esp32/get-started/index.html#step-2-get-esp-idf

First you have to prepare esp-idf v4.3:

#Create directory and clone esp-idf into it:
mkdir -p ~/esp
cd ~/esp
git clone -b release/v4.3 --recursive --shallow-submodules https://github.com/espressif/esp-idf.git

#Prepare build environment and toolchain:
cd ~/esp/esp-idf
./install.sh
. ~/esp/esp-idf/export.sh

Then get the grblHAL driver code:

#Create directory and clone the ESP32 grblHAL driver into it:
git clone --recursive https://github.com/grblHAL/ESP32.git

Go into the ESP32/main directory and modify settings in grbl/config.h and CMakeLists.txt as needed. Pin assignments and board specific config is in *_map.h files for each individual board.

Run idf.py build from the ESP32 directory. This will build the firmware image which can be later flashed into ESP32 device.

Note that idf.py command is only available in terminal window which was previously configured using the . ~/esp/esp-idf/export.sh command.

After build is completed you will be instructed on how to flash firmware into the device. Typically you can use command similar to this: idf.py -p /dev/ttyUSB0 flash

Once flashing is complete, your CNC controller is ready to be configured and used.

Using Docker

If you're familiar with Docker, you can use it to build grblHAL in a self-contained environment without installing the complete toolchain on your system:

  • prepare and configure the codebase as described above
  • build with docker run -it --rm -v $(pwd):/grbl -w /grbl espressif/idf:release-v4.3 idf.py build
  • flash with docker run -it --rm -v $(pwd):/grbl --privileged -v /dev:/dev -w /grbl/drivers/ESP32 espressif/idf:release-v4.3 idf.py -p /dev/ttyUSB0 flash

Building with user defined plugin

The file containing my_plugin_init() has to be added to CMakeLists.txt in the SRCS list and grbl/my_plugin.c has to be removed from it to be linked correctly.

Changelog/Notes:


NOTE: grbl/config.h or CMakeLists.txt may need modification before compilation. If needed an #error (with instructions) will be generated when compiling.

NOTE: Configuration has been simplified a bit, primarily change options in CMakeLists.txt to enable/disable. Configuration of options in my_machine.h is turned off in CMakeLists.txt by default due to this.


Credits:

index.htm.gz is Copyright (c) 2019 Luc Lebosse - from his ESP3D-WEBUI, I may have pulled a few lines from his backend code too.

dns_server.c is Copyright (c) 2019 Tony Pottier - from his ESP32 WiFi Manager

Snippets of code is extracted from Espressif ESP-IDF examples which are public domain.


2023-09-20

esp32's People

Contributors

terjeio avatar t4kuuy4 avatar kdomanski avatar henrikastro avatar petervanderwalt avatar shaise avatar

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.