luc-github / ESP3D

FW for ESP8266/ESP8285/ESP32 used with 3D printer
GNU General Public License v3.0
1.76k stars 466 forks source link

[BUG] cannot get the esp32 and the board to communicate #1038

Closed Reza-v closed 3 months ago

Reza-v commented 3 months ago

Describe the bug

the esp32 and the 3d printer mainboard do not want to communicate over serial, no matter the pins or uart i use. i am using a lolin esp32 s2 mini and a mega 2560 based board, using the rx0 and tx0 bootloader serial pins.

To Reproduce

  1. uploaded code to esp32
  2. connected the esp32 s2 to the mainboard using jumpers with a voltage divider on the tx pin coming from the mega (have confirmed the rx and tx pins used on the mainboard do work as intended and the problem is with the esp

i have tried using the default pins in pins.h as well as selecting another set of pins. Screenshots

Screenshot 2024-07-21 210134

ESP3D Firmware:

Target Firmware:

Board used (please complete the following information):

luc-github commented 3 months ago

that screen is not related to serial communication but communication between webUI and esp3D what EXACT version of webUI are you using ? what EXACT version of esp3d are you using ? type http:\\<your-IP>?forcefallback=yes to go to maintenance page and delete the current webUI which is either bad version or corrupted

Reza-v commented 3 months ago

I clicked on "latest development version" on the github page and downloaded that, built it and uploaded it. i will try doing it again today. thank you for the help.

luc-github commented 3 months ago

webui packages are already build in dist directory, what about esp3d version , it is visible in maintenance page

Reza-v commented 3 months ago

image this is the one

luc-github commented 3 months ago

ok this is latest version

Reza-v commented 3 months ago

Ok so the prebuilt webui worked like a charm and I'm past the connecting page but now I still can't communicate with the board, the gcodes I send are given no response. I tried reuploading the code to the ESP, using default pins, using serial0 and 1, both with default rx tx pins and different pins, nothing is working.

i have used pins 4 and 5 as the default rx tx pins for serial1 suggested by you in another issue thread, no dice,

also I must point out that sometimes when I connect the jumpers, the wifi just dies and I need to reset the board to get it working again. is that something you've seen before?

luc-github commented 3 months ago

connect the jumpers ? what jumpers are you talking about?

Reza-v commented 3 months ago

the jumpers to connect tx and rx pins to the 3d printer board. i am using a voltage divider on the tx pin coming from the 2560

luc-github commented 3 months ago

you hàve a picture of your wiring ? I do not understand what you mean

Reza-v commented 3 months ago

what's so hard to understand? i just don't know what pins on the esp32 s2 is the default serial1 pins and no one seems to know either, and nothing i try works. shouldn't you connect the esp board to the 3d printer board through serial in order for them to communicate with each other? that's my main issue. i cannot get them to communicate with each other no matter what pins i try or what pins i set the esp32 to recognize as tx and rx.

luc-github commented 3 months ago

looking at https://docs.espressif.com/projects/esp-idf/en/stable/esp32s2/_images/esp32-s2_saola1-pinout.jpg TX1 = GPIO17 / RX1 = GPIO18 is that what you use for serial 1 or do you use custom pins ? https://esp3d.io/esp3d/v3.x/hardware/esp_boards/esp32-s2/wemos-s2-mini/index.html

luc-github commented 3 months ago

what's so hard to understand? i just don't know what pins on the esp32 s2 is the default serial1 pins and no one seems to know either, and nothing i try works. shouldn't you connect the esp board to the 3d printer board through serial in order for them to communicate with each other? that's my main issue. i cannot get them to communicate with each other no matter what pins i try or what pins i set the esp32 to recognize as tx and rx.

well I do not understand why you have jumpers - sorry - I am not by your side I do not know what you are doing, I do not know what your board looks like because none of mega / esp32-s2 I know have jumpers - and having wifi down when doing wiring is not normal - I am not mind reader I just try to understand your wiring

Reza-v commented 3 months ago

oh you must be confused, i am talking about jumper wires not the other type of jumpers. i am using jumper wires temporarily for testing and i'll make proper connectors after it actually works.

unfortunately pins 17 and 18 did not work.

luc-github commented 3 months ago

then in configuration.h use Serial0 #define ESP_SERIAL_OUTPUT USE_SERIAL_0

and add these 2 lines

#define ESP_RX_PIN 37
#define ESP_TX_PIN 39

Like this you use custom pins and there will be no guess

Reza-v commented 3 months ago

what about the lines in esp3d_pins.h file? those don't matter? i've been changing those values to custom pins

luc-github commented 3 months ago

you do not have to edit this file everything is made to only use configure.h, so if you modified another file then I do not know what to say because I have no idea what changes you did

luc-github commented 3 months ago

in all case I suggest you to use this kind of device : https://www.amazon.com/HiLetgo-FT232RL-Converter-Adapter-Breakout/dp/B00IJXZQ7C/ref=sr_1_2_sspa

to check your esp board pins and also to check your mega wiring is correct - you will save time in debug be sure baudrate is same on both side

Reza-v commented 3 months ago

how do you change baud rate in your code? i could not find it

luc-github commented 3 months ago

in when UI not in code, in settings /features

Reza-v commented 3 months ago

oh that's interesting...

luc-github commented 3 months ago

or using direct commands : https://esp3d.io/esp3d/v3.x/documentation/commands/esp901/index.html

Reza-v commented 3 months ago

that worked. sorry i wanted to ask you how to change the baud rate but i totally forgot. i never got to the UI and just assumed it's stuck on connecting because i didn't get the serial hooked up correctly. thanks a lot for the help.

github-actions[bot] commented 2 months ago

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.