Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] MKS Robin Nano 1.2 reboots on file upload to SD #611

Closed
BaltasarParreira opened this issue Apr 6, 2021 · 86 comments
Closed

[BUG] MKS Robin Nano 1.2 reboots on file upload to SD #611

BaltasarParreira opened this issue Apr 6, 2021 · 86 comments

Comments

@BaltasarParreira
Copy link

BaltasarParreira commented Apr 6, 2021


name: Bug report / Problem
about: Create a report to help us improve and help you
title: "[BUG] MKS Robin Nano 1.2 reboots on file upload to SD "
labels: bug
assignees: ''


Describe the bug
Hi, I'm experience this problem every time I try to upload a file to the printer SD card.
The uploading message shoes on the MKS TFT35 but them screen pauses for a while and the board/printer reboots showing the MKS boot logo and beeps like if it was just powered on.

I'm running the latest Mks-Robin-Nano-Marlin2.0-Firmware that I just compiled and using the #define MKS_WIFI_MODULE.

Is this really a bug? Is there a solution?
Thanks.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Dashboard'
  2. Click on 'Files'
  3. Change to 'Printer SD.'
  4. Upload a file
  5. Wait uploading message on the printer screen for a while and them printer reboots.

Expected behavior
File should upload and stayed on printer SD to be printed after if need it.

Screenshots

ESP3D Firmware:

  • ESP core version: [3.0]
  • Version:[3.0.0.a94]
  • Web UI Version:[3.0.0.82 ]
  • Wifi mode:[e.g. STA]
  • Flash method: [Arduino Ide]

Target Firmware:

  • Name: [Mks-Robin-Nano-Marlin2.0-Firmware]
  • Version [2.0]

Board used (please complete the following information):

  • MCU: [ESP8266]
  • Name:[NodeMCU V3]
  • Flash size: [4M: 2M/2M]

Additional context

@github-actions
Copy link

github-actions bot commented Apr 6, 2021

Thank your for submiting, please be sure you followed template or your issue may be dismissed. if you deleted the template it is here

@luc-github
Copy link
Owner

as bot mentionned please fill information requested in template

@BaltasarParreira
Copy link
Author

Ok, I just done that on first post.

@luc-github
Copy link
Owner

luc-github commented Apr 6, 2021

I do not see the exact version of the Robin Firmware - I have no clue of what is the problem without knowing on what the problem happen
Especially when it is the printer FW which restart - not ESP3D

Additionnally using NodeMCU V3 is bad idea, you should stick to MKS WIFI module as upload use very high speed baude rate that does not support any EMI noise, which will corrupt communication, which will likely happen if you use another ESP board connected with wires

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 6, 2021

I have a couple of nodemcu's lying around so I was testing before I spend money buying the real MKS WIFI module.
Don't knew that EMI noise could interfere like you said, I never had problems with a lot of other things that I use them,

The M115 command just gives this:

ok
FIRMWARE_NAME:Robin_nano

Is there any other that I can test/use?

Also I have that problem whem on Page Settings clicking the Marlin bottom that I get the 2B code:
image

But them the error:
image

@luc-github
Copy link
Owner

luc-github commented Apr 6, 2021

EMI noise are not critical when using a baudrate at 115200 like commands use, but upload use
#define UPLOAD_BAUD_RATE 1958400 so it become very sensitive to serial data corruption as MKS protocol does not use checksum neither retry on failure
anyway the board which is restarting is your Robin so issue is in Marlin not ESP3D as it was working until now but I definitly think using NodeMCU with MKS protocol is bad idea

about the Marlin Tab and Robin also a Marlin MKS issue - #610 (comment)
M503 do not give any answer so ESP3D do not have anything to display

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 6, 2021

Ok I see, can I lower that baudrate like changing that setting to other lower value and compile?
Do I need to do some changes also on Marlin firmware side, like on Configuration.h or Configuration_adv.h?
I recall seeing there the possibility to declare port speeds.
Or could it be possible to use other MKS Robin Nano serial port instead the reserved to connect the WIFI module?

@luc-github
Copy link
Owner

luc-github commented Apr 6, 2021

in Marlin you need to change the speed in MKS code https://github.com/makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware/blob/master/Marlin/src/lcd/extui/lib/mks_ui/wifiSerial.h#L33

The MKS wifi port is not managed by Configuration.h or Configuration_adv.h

Also MKS WIFI use 6 pins - VCC / GND / RX / TX / and 2 flags pins for communications

@BaltasarParreira
Copy link
Author

Yes I know the extra 2 pins, but connecting those everything strangely stops working that give me thinking what could be the behavior of ESP3D with the real MKS WIFI module since all the pins are wired.
I don't recall seeing any setting to tell what type of ESP8266 we are using on ESP3D. right?

@luc-github
Copy link
Owner

Yes I know the extra 2 pins, but connecting those everything strangely stops working that give me thinking what could be the behavior of ESP3D with the real MKS WIFI module since all the pins are wired.

I do no not understand sorry

I don't recall seeing any setting to tell what type of ESP8266 we are using on ESP3D. right?

what do you mean ?

@BaltasarParreira
Copy link
Author

For my test with the Nodemcu I just use the TX and RX pins apart the power (GND + 3.3V) since if I connect the D3 and D2 (supposed the extra 2 pins) nothing works.
But since I'm connecting with wires I can do that.
The real MKS WIFI module has all ESP8266 pins connected so they are inserted on the board socket.
So unless I'm using some wrong pins for those 2 extra pins the MKS WIFI module will not work as well since it has them connected. Did you understand?

@luc-github
Copy link
Owner

The 2 extra pins are necessary and defined:
https://github.com/luc-github/ESP3D/blob/3.0/esp3d/src/modules/mks/mks_service.cpp#L33-L35

@BaltasarParreira
Copy link
Author

But ESP3D use them as well in this case?

@luc-github
Copy link
Owner

I just linked you esp3d FW code....of course, they are mandatory https://github.com/makerbase-mks/MKS-WIFI

@luc-github
Copy link
Owner

luc-github commented Apr 6, 2021

what is you [ESP420]plain output ?

@BaltasarParreira
Copy link
Author

I get this:

[ESP420]plain
chip id: 11547
CPU Freq: 160 Mhz
free mem: 23.68 KB
SDK: 2.2.1(cfd48f3)
flash size: 4.00 MB
size for update: 1023.00 KB
FS type: LittleFS
FS usage: 120.00 KB/1.98 MB
baud: 115200
sleep mode: none
wifi: ON
hostname: esp3d
HTTP port: 80
Telnet port: 23
sta: ON
mac: 84:F3:EB:EE:2D:1B
SSID: Balta-WIFI
signal: 88 %
phy mode: 11n
channel: 6
ip mode: dhcp
ip: 192.168.0.20
gw: 192.168.0.254
msk: 255.255.255.0
DNS: 192.168.0.254
ap: OFF
mac: 86:F3:EB:EE:2D:1B
serial: ON
notification: OFF
Serial: MKS
Target Fw: marlin
FW ver: 3.0.0.a94
FW arch: ESP82XX

@luc-github
Copy link
Owner

luc-github commented Apr 6, 2021

Ok so ESP3D settings are correct
so if your wiring is correct sending M105 or M115 should also work

@BaltasarParreira
Copy link
Author

M105
ok
T:25.7 /0.0 B:22.8 /0.0 T0:25.7 /0.0 T1:0.0 /0.0 @:0 B@:0

M115
ok
FIRMWARE_NAME:Robin_nano

@luc-github
Copy link
Owner

Upload works in exactly same way but using baud rate 1958400 instead of 115200, but rely more on pins GPIO0 and GPIO4 for notification and ack as it use several packets

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 6, 2021

Ok going to recheck those pins them, I think I was using others since on the MKS schematic for the module they are IO1 and IO2 that I have to check on the nodemcu mapping.
I let you know later after more tests with those wired too.
Thanks for the support, all the help and this amazing project !!!

@luc-github
Copy link
Owner

IO0 and IO2 do not refer to ESP8266 GPIO but MKS internal naming

@BaltasarParreira
Copy link
Author

Ok using the module pinout:
image

and the MKS Robin Nano board:
image

I can see that they map to D0 and D4 that you showed on:
https://github.com/luc-github/ESP3D/blob/3.0/esp3d/src/modules/mks/mks_service.cpp#L33-L35

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 6, 2021

Solved, uploads are working without any problems.
I used the following pin mapping:

  Arduino IDE code   |    Marked on Nodemcu
_________________________________________________
       0             |        GPIO 0 or D3
_________________________________________________
       4             |        GPIO 4 or D2
_________________________________________________

Now only the Marlin Tab and Robin also a Marlin MKS issue - #610 (comment) is not working, all the rest is ok.

Anyway, what is that tab suppose to do? Get some Marlin information only?

@luc-github
Copy link
Owner

it show Marlin EEPROM settings:

image

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 6, 2021

Ok I see, so that is not working here.
I found now that temperatures even having polling enabled don't show nothing.
Also I switch the bed options and I can't see it, no fields or something for the bed:
image

image

@luc-github
Copy link
Owner

What poilling command did you put ?

@luc-github
Copy link
Owner

@Legsmaniac you should do a github with your extra panels ans share them - they also could be promoted here https://github.com/luc-github/ESP3D/wiki#nice-things-done-using-esp3d

@Legsmaniac
Copy link

Legsmaniac commented Apr 9, 2021

@BaltasarParreira I thought about doing that as, like you, I have loadza bitza kit. I was going to make my own Arduino WiFi SD but then I saw an offer for a FlashAir real cheap so I got one. It was a neater and tidy option because to use yet another ESP meant more wiring, more power to supply it and another box to make for it or somewhere to locate it. I just bought an extension microSD to SD and printed a holder for it that slots into the V Rails. Nice n neat n tidy.

@Legsmaniac
Copy link

@luc-github OK, I could do. Although three of them are just URL links to things - one for HomeAssistant, one for my camera and one for the WiFi SD, they're nothing technical really.

Three

The only one I have created using HTML (so far) is one for my LED lighting but again, it's nothing complicated and only good for anyone who might be using WLED like I am.

One

@luc-github
Copy link
Owner

@Legsmaniac my meaning is : you did nice job, be proud of it 😉
I am sure lot of people will benefit of your job

@Legsmaniac
Copy link

you did nice job, be proud of it 😉

Awwww, shucks, thank you kind sir. 😊
But it wouldn't have been possible without you and ESP3D so you, too did a nice, no, excellent job, be proud of it. 😉

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 10, 2021

Tonight tests update.

Ok for now I abandoned the MKS UI interface firmware and MKS WIFI, so I compiled the normal latest Marlin 2.0 Bugfix Branch and tested this using normal RAW_SERIAL protocol since the MKS Robin Nano 1.2 without the WIFI module uses that as a serial port.

So far success, everything is working, the pooling and even the Marlin information tab as you can see;
image

Only problem is that the upload files button disappeared so I can't send files to print them as you can see here:
image

Weird... did I messed up some configuration on settings or there is a bug for the 3-0 version using normal protocol?
I reupload the code to Nodemcu with the option "Erase all flash contents" just to star everything from fresh.

Waiting for you comments and help. ; )

@luc-github
Copy link
Owner

#540 (comment)
So you saw the status - not yet implemented
and not sure I will do
I will work on #575 instead

@BaltasarParreira
Copy link
Author

Sorry I just quick read in diagonal so I could say something wrong because of it and not made the total effort to full comprehend it.

1- If I move back to older version I can have the SD upload files working?
2- I can have an SD reader wired to the Nodemcu and upload files there that I use to print after?

Just say yes or no.
I promised in the morning I'll read everything from top to bottom carefully.

@luc-github
Copy link
Owner

luc-github commented Apr 10, 2021

1 - Yes
EDIT: reading again, I now guess you refer to ESP3D 2.1, so I will anticipate the question: #535
2 - if the SD is connected to ESP I do not see how printer can see it, so no

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 10, 2021

Great, all working perfect now !!!

I can now remote print without problems.
Everything super stable and Marlin 2.0 running like a pro.
I liked the MKS cool interface, but this one works and that's what it counts, maybe in the future they fixed it so I can change or other even better show up. ; )

Anything I can do to help, porting this (SD upload) or other things to the new version?

@luc-github
Copy link
Owner

if you want to work on #575 you are welcome - MKS is good candidate as it has all pins - so now it is just matter of software
1 - in Marlin to handle second serial port as MKS do but with improvement I have listed, :
a - by extracting MKS code and make it work with current ESP3D 3.0
b - by adding missing features when point 2 is done

2 - in ESP3D 3.0 - that part should be not too hard as based on MKS module, most of the code will be same, but adding checksum and retry / error management to handle marlin code,

point 1 - a would be awsome as it is a the base of the feature 575 - once done it will be only code improvement which this may would become a solid reference

@BaltasarParreira
Copy link
Author

Ok I'll take a look during the weekend and tell you later.

Just one question regarding this version I'm running now.
I can only see one temperature and no where to set or choose other options, it is suppose to be like this?
image

@luc-github
Copy link
Owner

on 2.1 nothing is automatic you need to go to webUI preferences and enable each controls

@BaltasarParreira
Copy link
Author

So stupid, dahhhhh.
Sorry I didn't noted the small icon on the corner that brings extra menus and that one you are saying.

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 11, 2021

Ok more good news, feeling lucky with this morning success I decided to start from scratch since my ESP12S module arrived and I can do tests without using the Nodemcu. Like this I have a full MKS WIFI electronics.

1- Another success on compiling the latest Marlin 2.0 Bugfix Branch wit the MKS UI.
It's working on normal printing (SD or by USB cable) and no more resets when WIFI is connected.
I achieve this successful compilation just wiping everything from Visual Studio and PlatformIO and really start from zero, sometimes nothing like a full reset on things. ; )

I tested with the Nodemcu since it was still connected to the printer and using WIFI I can transfer files without the printer crashing or rebooting but for big files they sort arrive corrupted or something since I have an error on display saying "upload fail". Also I can't connect or do nothing with the ESP3D. He doesn't recognize the printer.
Could it be they changed something on the serial communications on this recent version?

Now I just finishing my MKS WIFI clone module and going to do further tests to see if if it was something related of using the Nodemcu before as it has more electronics than the real one.

Here is my assembled clone version and I just hope they don't really use the SPI as they show on the chemotic but they don't refer them on the git page and I quote:

"Hardware
Mks wifi has two types so far: mks robin wifi and mks tft wifi, actually they are the same eletronic connect with mcu of the host-board, just using different sockets. The wifi module is designed to connect to host-board with the following signals:

Uart Tx/Rx : for uart data transferring
Reset : for reseting the wifi by the host-board
GPIO4 : for the wifi module to read whether the host-board is ready to receive data on serial(low level valid)
GPIO0 : for switching the wifi module to boot mode(high level) or firmware flash mode(low level) by the host-board "

PHOTO_20210411_021800
PHOTO_20210411_021707
PHOTO_20210411_021658

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 11, 2021

Test results, WIFI is stable but not working 100%.
It looks like only works with small files, all the big ones I get error uploading.

image

PHOTO_20210411_061218

@luc-github
Copy link
Owner

is your screen ok ? looks garbage due to communication issue
on bigger file error rate to get communication issue is higher if electronic is not 100% full proof - as you do your how board and not using the original MKS, I only see this as root cause,

decrease the upload transfer speed on esp3d and Marlin may solve the issue for you

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 11, 2021

Yes screen is ok on normal operations, becomes like this when this type of upload file errors happens.

My home made module is 100% ok if I go back to Marlin 2.0 UI instead of the MKS one and off course using your esp3d v2.x since 3.x doesn't support file upload on normal serial protocol yet.

All the WIFI problems are really related on using MKS UI on the firmware, looks like they're adaptation to Marlin 2.0 is not 100% stable yet with this as in the older MKS and even the stock brand firmware works perfect.
The advantage to me of moving to new Marlin 2.0 is able to use new things, like UART mode on my new 2209 drivers and so on, otherwise I stayed with the older 100% working firmware's. ; )

@luc-github
Copy link
Owner

on my robin v2 screen is fine when wifi is working and uploading big files.
So I have no idea what issue you have, but still decrease upload speed

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 11, 2021

Ok I can try that, you mean at the Configuration.h change this?
#define BAUDRATE 250000

By the way, what firmware you use and from what source?

@luc-github
Copy link
Owner

no, MKS protocol use its own way to configure the wifi port

@luc-github
Copy link
Owner

you need to dig in Marlin lcd mks code

@BaltasarParreira
Copy link
Author

Ok I'll search for that.
So but what firmware are you using on your robin v2?

@luc-github
Copy link
Owner

mks one from december

@BaltasarParreira
Copy link
Author

Ahh... the V1.0.4 Release looks like the latest I could find from MKS.
But on those versions there is no way of using UART mode and those new things, right?
At least I never found any info on that on my intensive searches everywhere.

@luc-github
Copy link
Owner

@BaltasarParreira
Copy link
Author

BaltasarParreira commented Apr 11, 2021

But that one it was the first I tried and I had the reboot problem just by having the WIFI module connected even not doing any operation using it, And that one is already based on Marlin 2.X.
They say it is a well know problem for some time: makerbase-mks/Mks-Robin-Nano-Marlin2.0-Firmware#224 (comment)

Probably it doesn't happen with you because you have the Robin v2 and not the v1.2 as me.

@github-actions
Copy link

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.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants