gnea / grbl

An open source, embedded, high performance g-code-parser and CNC milling controller written in optimized C that will run on a straight Arduino
https://github.com/gnea/grbl/wiki
Other
3.99k stars 1.59k forks source link

Arduino Uno + Serial ESP32 #1171

Open Zetta420 opened 1 year ago

Zetta420 commented 1 year ago

Hello. I made a cnc machine with an Arduino Uno & a CNC Shield V3. Everything working like a charm.

But, I'm actually trying to connect my esp 32 to the RX & TX pin in order to get a Serial communication. I got it working, but when the ESP32 is connected, I can't use my cnc through the Arduino USB. It saids that the machine is busy.

The only thing I've found is when the ESP32 is connected, TX led never stop blinking, and grbl console keeps sending: <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>

Antoine got an Idea ? I'm pretty new on Arduino development so, I probably missed something, but can't figure what.... Thanks!

asaelrios commented 1 year ago

Hello @Zetta420,

According to the arduino Serial section, https://www.arduino.cc/reference/en/language/functions/communication/serial/, the Arduino UNO has only one serial port, you can see other boards specifications on the site.

So while you are trying to connect your ESP32 to the arduino while it is connected to the PC through the USB cable, your ESP32 seems to be blocking the conection between the arduino and the PC, since it's occupying the connection and making it busy. If you want to use serial with two devices at the same time you will need something with more than 1 serial port, like an Arduino Mega.

You can explain with more detail your problem if you had any doubt about this, I hope this help you.