luc-github / ESP3D

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

ESP3D V2.0 Wifi disconnect #252

Closed shaddow501 closed 5 years ago

shaddow501 commented 5 years ago

Dear Luc

I have a strange operation with the version 2.0, it seems that after a hour or so the Wifi is disconnected and on the OLED display I see that the unit have been disconnected and the only way to reconnect is to disconnect from the power source and reconnect the power source. (or resetting the module)

luc-github commented 5 years ago

what board / fw are you using ? EP8266 ? ESP32 ?

shaddow501 commented 5 years ago

board Wemos lolin32 - ESP32, fw 2.0.0.c20

luc-github commented 5 years ago

Do you use latest Git Update of ESP32 core ? I remember there was some fix a for disconnection and auto reconnect a while ago but I see still an old open issue : https://github.com/espressif/arduino-esp32/issues/653

ESP3D do not do anything actually for auto reconnect, it rely on ESP32 to autoreconect - but notice the disconnection. That part is definitly area of improvement but I never had issue my ESP32 run 24h a day

shaddow501 commented 5 years ago

I have updated the git about a week ago.. Is it possible when the ESP3D notice the disconnection to retry to reconnect?

luc-github commented 5 years ago

Yes that is why I introduced the wifi event in 2.0 to improve that part you can try to add a simple WiFi.begin(); in Disconnect event to see if it solve your issue

luc-github commented 5 years ago

also ESP32-ARDUINO had new idf update 2 days ago that solve lot of issues

shaddow501 commented 5 years ago

I have checked and I have the latest version...

shaddow501 commented 5 years ago

Dear Luc

I have discovered that the module just freeze after a few min of operation. and that causes the disconnection..

luc-github commented 5 years ago

Do you have NetBIOS enabled ? If yes disable it to see if it stop the freeze - I saw some freeze with ESP32 NetBIOS

shaddow501 commented 5 years ago

Disabled it and now checking, by the way sometimes on the OLED the IP does not show after connection, but I see in the the serial terminal that it did get IP.

luc-github commented 5 years ago

well Serial and Oled are called in same time:

        case WIFI_EVENT_STAMODE_GOT_IP:
            ESPCOM::println (WiFi.localIP().toString().c_str(), PRINTER_PIPE);
#ifdef ESP_OLED_FEATURE
            OLED_DISPLAY::setCursor(0, 16);
            ESPCOM::print(WiFi.localIP().toString().c_str(), OLED_PIPE);
            OLED_DISPLAY::setCursor(0, 48);
            ESPCOM::print("", OLED_PIPE);
#endif
shaddow501 commented 5 years ago

Yes, that is why it is strange why it doesnt update the OLED.., I am not sure but maybe it prints with the wrong color (I mean print in black since maybe you use to print in black to replace the strings) so it doesnt change the color to white...

luc-github commented 5 years ago

need to add a log to check if Info reach function :

#ifdef ESP_OLED_FEATURE
    case OLED_PIPE:
        {
        if (!ESPCOM::block_2_oled) {
               //Add log here
            if(!(!strcmp(data,"\n")||!strcmp(data,"\r")||!strcmp(data,"\r\n"))) {
                OLED_DISPLAY::print(data);
                OLED_DISPLAY::update_lcd(); 
                }
            }
        }
        break;
#endif

if function is reached - then check the OLED functions - may be need time between print and update if OLED is slow

shaddow501 commented 5 years ago

Can you say where I should put those lines? (in which file?)

luc-github commented 5 years ago

espcom.cpp - the log depend of your choice

shaddow501 commented 5 years ago

It seems that disabling the NetBios fixed all those issues... also fixed the display IP address issue. I guess case closed. :)

luc-github commented 5 years ago

Ho really ? I reported the NetBIOS issue long time ago - and reported again with latest IDF update it happen with Webserver + Netbios only - hope it will be fixed

shaddow501 commented 5 years ago

Well the module doesnt crash, I dont have wifi disconnection anymore and the OLED display the IP with each reset. Now I will continue testing it before I install it on my printer.

shaddow501 commented 5 years ago

Dear Luc For the version 2.0 you need to use Web-Gui of 2x. In this version I dont see the Webcam option and I dont have the print configuration setting... Have you noticed that?

luc-github commented 5 years ago

you have a menu preferences all is there

shaddow501 commented 5 years ago

Yes, thanks found that, but I the page under printer configuration - ESP3D for Repetier for Davinci there is only refresh button and -

Label Value Help

and that is all.

is it suppose to be like that?

luc-github commented 5 years ago

When you refresh you do not have EEPROM content ?

shaddow501 commented 5 years ago

I dont know what you mean but this is what I get. image

this window is shown for marlin, but it show the same page also for Repetier for Davinci

luc-github commented 5 years ago

You wrote repetier for davinci but I see marlin on your page which printer do you have?

shaddow501 commented 5 years ago

This window is shown for marlin, but it show the same page also for Repetier for Davinci

My printer is Anycubic I3 Mega

luc-github commented 5 years ago

Which FW your printer use ?

shaddow501 commented 5 years ago

In Repetier I select Marlin

luc-github commented 5 years ago

..... What is the output of command M115 ?

shaddow501 commented 5 years ago

M115 Invalid command

in Repetier-Host: 20:38:40.948 : FIRMWARE_NAME:Marlin 1.1.0-RC8 (Github) SOURCE_CODE_URL:https://github.com/MarlinFirmware/Marlin PROTOCOL_VERSION:1.0 MACHINE_TYPE:3D Printer EXTRUDER_COUNT:1 UUID:cede2a2f-41a2-4748-9b12-c55c62f367ff echo:DEBUG:INFO,ERRORS echo:Active Extruder: 0

Just to update, I run at the moment all those tests without having the ESP3D connected directly to the printer.

luc-github commented 5 years ago

So it is not Marlin FW Neither Repetier FW

M115 give FW capability in Marlin/Repetier yours seems not supporting this command

Marlin use M503 command to display configuration Repetier use M205 command to display configuration

You tried both and none fit what ESP3D expect, so you cannot edit FW settings in ESP3D

shaddow501 commented 5 years ago

Dear Luc As I said the ESP3D is not connected to the printer yet, I run all those test as stand alone. So maybe it need to be connected to the serial port.

This is what I get in the Repetier when I run the command M503: Steps per unit: M92 X80.00 Y80.00 Z400.00 E92.60 Maximum feedrates (mm/s): M203 X500.00 Y500.00 Z6.00 E60.00 Maximum Acceleration (mm/s2): M201 X3000 Y2000 Z60 E10000 Accelerations: P=printing, R=retract and T=travel M204 P3000.00 R3000.00 T3000.00 Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s) M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.40 E5.00 Home offset (mm) M206 X0.00 Y0.00 Z0.00 Z2 Endstop adjustment (mm): M666 Z0.00 Material heatup parameters: M145 S0 H180 B70 F0 M145 S1 H240 B110 F0 PID settings: M301 P16.43 I1.04 D61.37 Filament settings: Disabled M200 D1.75 M200 D0

So from that I understand that in order to get this info the ESP3D has to be connected to the printer and read the values. I am now at debugging stage before I will connect it to the printer.

luc-github commented 5 years ago

I see you edited and now have FIRMWARE_NAME:Marlin 1.1.0-RC8 man it is really painful to debug with you

luc-github commented 5 years ago

So you printer is Marlin 1.1.0-RC8 so in ESP3D it is Marlin that you need to choose for FW target and if you want to edit Marlin Settings in ESP3D, your ESP must be connected to your board

shaddow501 commented 5 years ago

I guess we both got confused, I didnt know that it is a firmware setting page and the printer has to be connected, It wasnt clear what is this page for... and when looking at the pictures you added in the install page I was thinking that it is something that related to the ESP3D printer settings. Not actual the printer firmware...

luc-github commented 5 years ago

In Marlin there is : #define DISABLE_M503 usualy it is commented but if not commented the command won't work and so the editor feature

shaddow501 commented 5 years ago

maybe it was more clear if instead "Printer configuration" it should be "Printer Firmware Settings"

about the #define DISABLE_M503 it is not commented out since when I run it in the Repetier host I get: Steps per unit: M92 X80.00 Y80.00 Z400.00 E92.60 Maximum feedrates (mm/s): M203 X500.00 Y500.00 Z6.00 E60.00 Maximum Acceleration (mm/s2): M201 X3000 Y2000 Z60 E10000 Accelerations: P=printing, R=retract and T=travel M204 P3000.00 R3000.00 T3000.00 Advanced variables: S=Min feedrate (mm/s), T=Min travel feedrate (mm/s), B=minimum segment time (ms), X=maximum XY jerk (mm/s), Z=maximum Z jerk (mm/s), E=maximum E jerk (mm/s) M205 S0.00 T0.00 B20000 X10.00 Y10.00 Z0.40 E5.00 Home offset (mm) M206 X0.00 Y0.00 Z0.00 Z2 Endstop adjustment (mm): M666 Z0.00 Material heatup parameters: M145 S0 H180 B70 F0 M145 S1 H240 B110 F0 PID settings: M301 P16.43 I1.04 D61.37 Filament settings: Disabled M200 D1.75 M200 D0

luc-github commented 5 years ago

for ESP3D settings there is a tab already: image

Printer Settings is for Printer

shaddow501 commented 5 years ago

Well, if I did not understand that it is not related to the ESP3D settings but was related directly to the printer firmware I guess that there might be more that will do that mistake...

luc-github commented 5 years ago

There will be always people who do not understand what ever it is writen - cannot have 100% success this is life.

Even the read me describe each part : https://github.com/luc-github/ESP3D-WEBUI
I know screen shots are not updated yet for 2.0 but no one read the read me.... so if at the end always have questions I do when I have time

shaddow501 commented 5 years ago

Cool thanks

luc-github commented 5 years ago

I guess issue can be closed

github-actions[bot] commented 4 years 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.