-
-
Notifications
You must be signed in to change notification settings - Fork 536
Compiling the firmware
The code should be compiled using the latest Arduino IDE and esp32 core. Seriously...the latest! Follow instructions here on how to setup ESP32 in the IDE. The choice was made to use the Arduino IDE over the ESP-IDF to make the code a little more accessible to novices trying to compile the code. Be sure to use the latest Arduino IDE and ESP files.
Bluetooth and all wifi options are now compiled into one large firmware. You need to select the Minimal SPIFFS (Large APPS and OTA) partition scheme under the Tools...Partition Scheme... menus or the firmware and WebUI will not fit.
Here are the settings you should use.
There are some libraries that must be added to the Arduino IDE. Copy the folders in the Libraries folder to the libraries folder in your Arduino folder on your computer. Typically some folder like "...\Documents\Arduino\libraries" (Windows computer).
Note: Even if you are compiling a branch, it is best to copy the libraries from the master branch. Fixes are often required to keep up with the latest Espressif Arduino Core. They would always be posted to the master branch.
TMC2130Stepper library: If you are using a cpu map with #define USE_TMC2130
, you will need to add the TMC2130Stepper library to the Arduino IDE. Do this with the following menu clicks sketch...include libraries...manage libraries. Then search for TMC2130Stepper and add the library.
The default firmware is setup in a test drive mode (#define CPU_MAP_TEST_DRIVE). This creates a virtual 3 axis machine that you can safely play with on an ESP32 dev module by itself or attached to any hardware. It does not actually change the state of any pins, so it is safe use without worrying about floating input pins or shorted output pins.
To use with actual hardware, you must use an existing pin map or create your own. These pin maps are defined in cpu_map.h. For examplethe Grbl_ESP32 Development Board uses pin_map CPU_MAP_ESP32. If you have a different hardware target, make sure the I/O pin mapping is correct. See this wiki page.
The USB serial port is established right away and will display a lot of useful information. It will also ride through a crash and display useful debugging information. If you want to know the Wifi settings being used, watch this port on startup.
When you first try to use the WebUI, you will get this screen.
The file, "index.html.gz". It is in this folder.
After loading the file, refresh your browser. If you reload firmware, check to see if "index.htnl.gz" has changed. If you need to upload a new version of "index.html.gz", use the green folder icon on the ESP32 tab of the WebUI.
You will get an error 7 on the first run of the code, if you happen to have a serial terminal open you will see it. It is normal behavior. It is trying to load saved settings, which don't exist yet, so it loads defaults. You should not see the error again.
It is common on some dev boards to fail to connected and give a message like "Connecting................." The Arduino IDE is having trouble putting the ESP32 in bootloader mode. Try holding down the boot button until it gets past the "Connecting..." phase. Be careful not to touch any of the pins near the button. That could interfere with the flash memory during upload.
You may also see flash errors. I have found that some dev boards have trouble being programmed while prugged in. Try removing the dev board from the shield while programming.
It is often easiest to upload new firmware via WiFi. After you have programmed the board once with Grbl_ESP32, this feature will be enabled. If you put the Arduino IDE compiler into verbose mode, via the the File...Preferences menu, you will see where the compiled (.bin) file has been put. On the WebUI...ESP3D tab you will find an firmware upload button (yellow cloud).
- Home
- Hardware
- ESP32 Dev Kit Versions
- Compiling with Arduino IDE
- Compiling with PlatformIO
- Using the Serial Port
- Grbl_ESP32 Settings
- Controlling Grbl_ESP32
- Setting Up the I/O pins
- Spindle Types
- Basic Kinematics
- Custom Machine Functions
- Home/Limit Switches
- Machine Work Space
- Stepper Motor Drivers
- Trinamic Drivers
- Axis Squaring and Ganging
- Settings
- SD Card
- Bluetooth
- Wifi
- WebUI
- Using Telnet
- Servo Axis
- Push notifications
- Switches
- Stepper Drivers
- Spindle options
- Other Ouputs
Testing public edit