ESP32_CNC_Pendant icon indicating copy to clipboard operation
ESP32_CNC_Pendant copied to clipboard

connection to CNC machine

Open MohammadSalehi72 opened this issue 3 years ago • 5 comments

Hi, Thanks for an amazing project. I want to have this pendant for my CNC machine just for jogging the moving axis. How could I connect this pendant to my CNC machine (equipped with Arduino UNO and CNC shield that runs Grbl? And can you please give me more information on how to upload source codes and UI files into ESP32?

MohammadSalehi72 avatar Apr 25 '22 12:04 MohammadSalehi72

Hi.

The device should be connected to Arduino with Grbl firmware via UART. My firmware just sends gcodes to grbl and reads back responses via UART. On ESP32 side you need to use Serial2 pins, i.e. GPIO16(RX) and GPIO17(TX).

Uploading firmware is done as usual, via USB cable. Your ESP32 board most probably has a USB port and a USB-UART converter. PlatformIO uploads the compiled binary automatically. If you have more than one esp8266/esp32 connected to your PC, consult PlatformIO docs on how to select where to upload the firmware.

As for UI files, there are none. A simplest HTML file is generated on-the-fly in the code (InetServer.cpp).

positron96 avatar Apr 26 '22 09:04 positron96

Hi, I understand about the connection. But still I don't figure out how should I upload the code into esp32. May I ask you please explain for me the process of uploading codes onto eap32? Best regards

MohammadSalehi72 avatar Apr 26 '22 12:04 MohammadSalehi72

Ok, if I understand your question correctly, you might need to get a grip on how to use VS Code and PlatformIO within VS Code. The topic is extensive and I definitely can't cover it in the format of github discussion. I believe you'll find YouTube videos about this pretty informative and educating. Quick googling suggests this series of videos: https://www.youtube.com/watch?v=5edPOlQQKmo Of course, there are hundreds of similar-themed videos that you might find more informative.

I can try to do a quick introduction: F1 opens command menu, select "PlatformIO: Upload" there. If that doesn't work, then you'll still need to study the PlatformIO workflow.

positron96 avatar Apr 27 '22 15:04 positron96

Hi, Thank you for the link. It was very useful. Regarding to your comment about the connection, you said "On ESP32 side you need to use Serial2 pins, i.e. GPIO16(RX) and GPIO17(TX)." but I don't see this connection in your schematic uploaded.

MohammadSalehi72 avatar Apr 27 '22 18:04 MohammadSalehi72

Yes, you are right, I totally forgot that. Will update that sometime soon.

positron96 avatar Apr 28 '22 04:04 positron96