[SOLVED] Send GRBL to CNC Shield through ESP32

Hello,

I recently made a laser CNC runing with an Arduino UNO & CNC Shield.

I was wondering if there is any known way to send grbl code to cnc machine with an ESP 32.

In order to get a bluetooth and/or wifi control of the machine.

Thanks for the reply !

Invent what free I/O You have on the UNO and check if they can handle the communication with the ESP 32.

Do you men the "G" CNC lines of code or the GRBL operational program code?

If you mean the actual CNC lines of code, you had better plan for someway of getting feedback from your machine so you don't cause it to physically crash the mechanism.

If you just want to control the CNC machine via Bluetooth you can connect a HC05 to the Uno hardware serial (so that you can get the 115200 baud rate). Then use an app like Grbl Controller to control the machine. I have a 2D plotter set up that way and it works great.

If you provide a better description of what you want to do, we can give better advice.

What is the source of the G code? Is the ESP just a middle man between the G code source and the CNC machine?

Hello.
Before all, thanks for the replies.

So,
the machine is controlled by an arduino uno with GRBL firmware & CNC Shield.
The GCode sender is a computer.

What I want to do is to be able to control this Arduino Uno through ESP32 (or any bluetooth system). And, I want to send GCode through this arduino.

I'm using LightBurn as CNC Software, and I've seen I can export my LightBurn project to "gcode file". I do not want to control my CNC through bluetooth with lightburn, I just want to be able to send these GCode files to my arduino. (EDIT : And also be able to send custom gcode lines, in order to for example, set the machine origin through bluetooth). I've seen similar projects, but pretty much all the time it's an arduino MEGA with RAMPS Shield. There is more pins availables...

And I'm trying to know how to do this. Because I do not have many usable pins with my CNC Shield, so I don't really know if it's possible like that.

@groundFungus That's exactly what I need. Just trying to know how to wire everything on the CNC Shield.
I will take a look to this HC05 when I will be back from work !
Thanks !

The hardware serial RX and TX pins are broken out on the CNC shield (in the white box).

cnc shield rx tx

Connect the HC05 as shown in Martyn Curries tutorials. The voltage divider on the HC05 RX pin is important to avoid damaging the HC05. HC05 inputs are not 5V compatible though it is powered by 5V.

You will need to put the HC05 into AT mode and set the baud rate to 115200 to match grbl. See post #4 of this thread.

How will you know when to send the NEXT G-code line if you do not have any feedback from the Arduino running GRBL?

Thank you so much for all these informations. This is exactly what I was looking for !

I will try this soon, and send a little update on this thread to show it :wink:

Hey ! I tryed this out with an ESP32 (same wiring). And it's working like a charm. Thanks for the wiring process :slight_smile:

Sorry for double post. The only little problem is, if the ESP32 is wired to CNC Shield, I can only control my CNC through the ESP32, no more through LightBurn directly. If you have any idea.

Matbe something like this will help?

Sadly it didn't helped me.

I found that when ESP32 is wired to the Arduino UNO, GRBL console of my CNC returning me

<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0|WCO:0.000,0.000,0.000>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0|Ov:100,100,100>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0>
<Idle|WPos:0.000,0.000,0.000|Bf:15,128|FS:0,0>

in loop. And I think this is why the machine is maked as busy on LaserGRBL... But can't find why, or how I can change this. I searched a lot on the web, didn't found something about this...

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.