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

Using with MKS TFT Wifi - Any Success? #249

Closed
ZhuDaHai opened this issue Sep 11, 2018 · 121 comments
Closed

Using with MKS TFT Wifi - Any Success? #249

ZhuDaHai opened this issue Sep 11, 2018 · 121 comments

Comments

@ZhuDaHai
Copy link

Issue #206 was closed back in March concerning using the MKS TFT Wifi board with this ESP3D firmware.
I also have the MKS TFT28 display board and the MKS TFT Wifi board, and the default closed-source firmware from MKS is very limited. So I'd like to see if this could work.
And so was wondering if you'd made any progress on this and/or if there was anything I could do to help.
Thanks!
P.S. As a side note, I updated the MKS TFT WIFI board with the ESP3D firmware, but now I cannot go back. I don't know why, but while I can load the original MksWifi.bin file and set the mks_config.txt file on the SD card to update, and it does appear to update, the MKS TFT WIFI board will not switch out of AP mode no matter what I try. Thoughts?
Thanks!

@luc-github
Copy link
Owner

I have a module MKS TFT Wifi but did not have time to study / use it yet because busy with others projects - it is in 2.1 plan list but do not know when I can work on it

About your issue, I guess the bin is not enough may be some settings in EEPROM or SPIFFS was corrupted when flashed ESP3D - it is just a guess

@luc-github
Copy link
Owner

luc-github commented Sep 11, 2018

the best would be to dump the whole flash of working Module (not sure about size) and flash the full binary

@ZhuDaHai
Copy link
Author

That worked!
I flashed 'EraseFlash', then the stock MksWiFi.bin, then the mks_config.txt file and its back to stock.
Thanks! I can go back and forth now while I test.
Let me know if I can help with your firmware for the MKS TFT WiFi module. I'm a retired programmer of 30+ years. I don't know jack about this module, but I can still learn :)
Maybe point me to the correct code block...
Thanks again!

@ZhuDaHai
Copy link
Author

ZhuDaHai commented Sep 12, 2018

I littered your code with LOG command at every ESP_SERIAL_OUT.readBytes command I could find, but nothing I added appeared in the log.txt file - just your stuff. So apparently I haven't a clue where to look.
I did find these in the MKS TFT firmware. Maybe they'll help. Just wish I knew where to look for where that would be coming into your code:

at+netmode=%d
 at+dhcpc=%d
   at+wifi_conf=%s,auto,%s
   at+wifi_conf=%s,wpawpa2_aes,%s
    at+net_ip=%s,%s,%s
    at+net_dns=%s,8.8.8.8
 at+remotepro=tcp
  at+mode=server
    at+remoteport=8080
    at+uart=%d,8,n,1
  at+net_commit=1
   at+net_wanip=?
    at+wifi_ConState=?
    at+reconn=1
   at+dhcpd=%d
   at+dhcpd_ip=%s,%s,%s,%s
   at+dhcpd_dns=%s,8.8.8.8

P.S. those ending with ? appear to be queries to the Wifi module, while those with parameters (%s, %d) appear to be settings from the mks_config.txt being passed to the Wifi Module

@luc-github
Copy link
Owner

luc-github commented Sep 12, 2018

Yes as I suspected after few test MKS use AT commands - to query / set wifi parameters.
ESP3D does not know AT commands, so it do not answer to any query send by MKSTF,T so TFT thinks there is no wifi.

Need to connect RX/ TX /GND to RX/GND of Serial to USB adapter to visualize the exchange on a Serial Monitor
once the communication exchange is known - we can simulate the answers from ESP3D

@ZhuDaHai
Copy link
Author

I understand ESP3D doesn't understand at+ commands. Does that mean they are not even read by ESP3D? Which part of the code would be receiving data from the LCD firmware? I thought SP_SERIAL_OUT.readBytes would do it.
I guess I just don't get it. Sorry, just trying to help

@luc-github
Copy link
Owner

Yes ESP_SERIAL_OUT.readBytes just ignore the command as it does not know them
need to code proper answer like:
if it receive at+net_wanip=? it need to answer for example 192.168.1.4 but currently I do not know what command it could receive and what format it need to use to answer - it could be standard AT or custom AT

@ZhuDaHai
Copy link
Author

ZhuDaHai commented Sep 12, 2018

Well, I got 'something', but it appears the data, parity and/or stop bits don't match. I believe the defaults in serial.begin() are 8N1. So I have no idea what the MKS TFT28 display is expecting:

BRIDGE::processFromSerial2TCP: ø þ?¨�ÿ?¬�ÿ?G} @@�þ?¨�ÿ?€ÿÿ?J”!@¤$ÿ?t&ÿ?

Hex:

f8 00 fe 3f a8 02 ff 3f ac 01 ff 3f 47 7d 20 40
40 8d fe 3f a8 02 ff 3f 80 ff ff 3f 4a 94 21 40
a4 24 ff 3f 74 26 ff 3f

@luc-github
Copy link
Owner

Ok I have some time and checked what TFT is requesting:

at+netmode=2
at+dhcpc=1
at+wifi_conf=NETGEAR_2GEXT_OFFICE2,auto,blabla
at+net_ip=192.168.1.240,255.255.255.0,192.168.1.1
at+net_dns=192.168.3.1,8.8.8.8
at+remotepro=tcp
at+mode=server
at+remoteport=8080
at+uart=115200,8,n,1
at+net_commit=1
at+net_wanip=?
at+net_wanip=?
at+net_wanip=?
at+net_wanip=?

@luc-github
Copy link
Owner

This is the doc for the wifi module
HLK-RM04 user manual.pdf

@luc-github
Copy link
Owner

But my TTF screen seems not communicating well with the WiFi module the TX seems OK but not RX
I can see the above command sent by TFT

Modules communicated once got connected and right IP, then no more (Only got exception) so hard to continue

@ZhuDaHai
Copy link
Author

Thanks for the updates! I plan on working on it this weekend and let you know if I make any progress or not.

@luc-github
Copy link
Owner

Hi any update on this ?

@luc-github
Copy link
Owner

My MKS TFT seems not well communicate and no update for a while
I close topic - feel free to re-open if any update

@luc-github
Copy link
Owner

I have ordered a new MKS TFT a v4 this time,I hope this time it will work
https://www.aliexpress.com/item/MKS-TFT32-v4-0-touch-screen-MKS-Slot-module-extended-SD-card-reader-splash-lcds-touching/32946735899.html

@Valcob
Copy link

Valcob commented Mar 22, 2019

just posting in case it may help.
So it looks like the MKS WIFI has 2 UARTs setup for communication the one is a normal one UART0 setup on pin TX(label on the wifipcb) goes to RX0(IO3 of the ESP12s) and RX(label on the wifipcb) goes to TX0(IO01 of the ESP12s) and another one UART1 is on TX(mainboard <-> IO0 wifiboard) goes to IO0(ES12s) RX(mainboard <-> IO1 wifiboard) goes to IO4(ESP12s) looks like sw serial here.

So on UART0 when just wifi is connected to usbToSerial converter is
image
on RX pin of the wifipcb; on TX is nothing
, and on UART1 is some rubbish
image

And when connected to main board which is and MKS TFT 3.5 I have this on UART0 from RX wifiboard
image
the two black rectangles are SSID and pass
and at the same time the responses are from the TX pin on wifiboard
image

And while still connected to main board on UART1 TX pin of the main board
image

And for UART1 RX pin of the main board
image
with something being continuously written
also played with baud rates to get something useful but with no luck

If there is something I can help I would be glad to do so.

@luc-github
Copy link
Owner

luc-github commented Mar 23, 2019

@Valcob interresting what FW version do you have and what settings for wifi ?
I just got my MKS TFT32_L V4.0 looks like it has the latest FW 3.03

connector Aux1

? ? ? ?
TX RX GND +5V

connector WiFI

RST RX TX NC
TX RX GND VCC

Connector SD

CS DI
GND V
CLK GND
DO CD

Can you clarify which TX/RX you mentioned ? Thank you
Note: I did not connected any WiFi yet - I have the HKL and the ESP

MKS WIFI TFT V1.0

IOO IO1 GND VCC
RST RXD TXD NC

MKS HLK-WIFI V1.1

ES NC GND VCC
TX RX GND VCC

@luc-github luc-github reopened this Mar 23, 2019
@Valcob
Copy link

Valcob commented Mar 23, 2019

@luc-github
so WIFI pcb is MKS wifi module, TFT is MKS TFT 3.5 with 1.0.2 firmware connector used is WIFI
image
image

@luc-github
Copy link
Owner

luc-github commented Mar 23, 2019

Ok - will enable WiFi and see if it is better than my previous board MKS TFT32_L V2.0 which did not communicated well

@luc-github
Copy link
Owner

Ok using MKS TFT WIFI and updating with latest FW it seems working and now I even have a webserver which I did not have before
image

Communication with board according config is 250000 and I can see the M105 on Arduino serial
so my previous issues were FW and not hardware ...

image

I will dump the MKS WIFI firmware to have a backup - just in case

@Valcob
Copy link

Valcob commented Mar 23, 2019

can you please share your config for tft ?

#########  Printer type setting  ##################################

#mainboard firmware setting(marlin:1; repetier:2; smoothie:3)
>cfg_firmware_type:1

#machine setting (Normal:1; Delta:2)
>cfg_machine_type:1

#baud rate (9600:1; 57600:2; 115200:3; 250000:4)
>cfg_baud_rate:3

@luc-github
Copy link
Owner

luc-github commented Mar 23, 2019

But I cannot do any telnet action, I have tried different port and connection failed
I connected to 192.168.1.25:8080 - connection is accepted but no effect /feedback of any command
Here my file :
CONFIG.txt

@luc-github
Copy link
Owner

So I am not sure using wifi bridge is working or need additional setting

@Valcob
Copy link

Valcob commented Mar 23, 2019

also can you share what wifi binary you are using I cant get a normal output(M105) for some reason (

@luc-github
Copy link
Owner

I use the one present in https://github.com/makerbase-mks/MKS-TFT

@luc-github
Copy link
Owner

luc-github commented Mar 23, 2019

Version 3.03, the latest

@luc-github
Copy link
Owner

Looks like they build a cura plugin. Will check it https://github.com/makerbase-mks/Software/blob/master/MKS%20Plugin/MKS%20Plugin3.5↑.rar

@luc-github
Copy link
Owner

Also be noted MKS TFT wifi need 5V and it is 4MB flash

@ETE-Design
Copy link

@luc-github MKS TFT Firmware is also open source now, so mabye it is possible to remove the part who Block the WiFi :-)
https://github.com/makerbase-mks/MKS-TFT28-32-Firmware

@luc-github
Copy link
Owner

luc-github commented May 3, 2020

I know but because they ignored me when I contacted them to make ESP3D compatible I won't spend time on this when there is already a working Firmware, also there is a disclaimer about ESP3D on their github (https://github.com/makerbase-mks/MKS-WIFI) so I don't think they will take any PR to change things

If you look at the TFT github there are no instructions how to build the FW so they give the sources not the toolchain/process to build the FW

@ETE-Design
Copy link

I know, they have been hard to work with, asked them a couple of things about some boards, and like you they just ignored me... But in the last Month they have answered me about stuff I asked :-) And why not just use BBT firmware now that it is working ;-)

@luc-github
Copy link
Owner

there is a big work to make btt mks compatible with all mks tft so I guess they try to retain people moving to BTT FW as they will loose service income linked to their FW

@ModMike
Copy link

ModMike commented May 3, 2020

The only reason I wanted to use this module is only because I had it. I also have a TFT32 coming in and wanted to add ESP3D to it. Mind, you, if I add it to the Fystec Cheetah then this becomes redundant and I can completely forget about MKS Module. I just like it's form factor and it being basically ready to go without adding hardware. I think the key to get it adopted by regular users is to make it as easy to install as possible.

@luc-github
Copy link
Owner

I have one too I use it with tft mks 32 flashed with btt fw

@ModMike
Copy link

ModMike commented May 3, 2020

I blew the voltage regulator on mine so I need to replace it. I may have also blown the ESP itself, it was getting 4.1V after "the incident". I guess I will know when I install a new 5V regulator.

After I removed voltage regulator I bridged the in and out to use with 3.3v but unfortunately that did not work. I think it was because the all the line levels were designed to work with 5V.

@iz3man
Copy link

iz3man commented May 3, 2020

I have one too I use it with tft mks 32 flashed with btt fw

So you say that MKS WIFI works together with MKS TFT if both are flashed with BTT firmware? And is this more capable then the original MKS WIFI implementation?

@luc-github
Copy link
Owner

mks wifi 1.0 + ESP3D
mks tft + btt FW
= full control

and today I have pushed a PR to BTT github to add support in ESP3D of TFT Sd and TFT usb

@iz3man
Copy link

iz3man commented May 3, 2020

Could you please define full control? Full control with the ESP3D webinterface like the panucatt device I have here, correct? But the SD wifi upload is still snail speed?

@luc-github
Copy link
Owner

yes same but sd upload speed

@iz3man
Copy link

iz3man commented May 3, 2020

Thanks for your reply, but the absence of punctuation marks leaves room for interpretation ;)
a) It has the same webfrontend yes/no
b) it has slow upload speed (like minutes for megabytes) yes/no
Sorry for being picky ...

@luc-github
Copy link
Owner

as wrote same but sd upload speed
bigtreetech/BIGTREETECH-TouchScreenFirmware#261

@davidm2m
Copy link

If I undestand I can control the printer with ESP3D on my MKS WIFI with BTT firmware on the MKS TFT, but until BTT upgrade de firmware I can't upload files to SD or USB, Am I correct??
(Is the same case of original FWs but with WEBUI and better suport)

@luc-github
Copy link
Owner

luc-github commented May 14, 2020

@davidm2m official BTT repository (https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware) has already merged my PR so latest git version is ready to be used with limitation of you mention : can't upload files to SD or USB and I doubt they will add such support, need someone doing a PR to add it.

Be noted the repository only support MKS TFT32 V4, for older/other version of MKS TFT you need to use this repository https://github.com/Uz45/BIGTREETECH-TouchScreenFirmware - @Uz45 do a great job maintaining and sync with BTT original

BTT FW do not block any command unlike MKS one ,so yes full ESPD support
I hope it clarify

@davidm2m
Copy link

Thanks.

I build the BTT firmware (on MKS TFT28 v4.0 is the same as TFT32) without problems and 0 problems to comunicate with ESP8266 (MKS TFT wifi).

As you (@luc-github) indicates I can see everything and control it.

My last questions if is it possible to open a request (I don't know program) to BTT make changes in the firmware to be able to upload gcode archives.

@luc-github
Copy link
Owner

@davidm2m I do not see any issue for this - let see what will happen ^_^

@trashypopashy
Copy link

Can somone give me a .bin-file for the MKS Robin Wifi with ESP3D? I want to upload it via SD-Card inserted into the MKS-Robin-Nano-V1.2, as slm4996 said, it would work. I am not able to compile it with Adruino IDE.

@trashypopashy
Copy link

Also, I'll add a little tidbit here, if you export the binary from Arduino IDE and rename it mkswifi.bin you can upload it to the stock firmware web interface or put it on your SD card and reboot the printer and it will flash it. Going back to stock is the same thing just give it the stock MKSWiFi.bin and it will revert back.

No need to take it out of the printer and wire it all up just to flash.

@slm4996 Do You have the .bin-file for me?

@tekstyle
Copy link

will this work with the MKS ESP12S wifi module on the MKS robin nano board with TFT35 V1.0 screen? this board uses a *.bin file to update firmware.

@luc-github
Copy link
Owner

I do not have this board: MKS robin nano board so I cannot say for sure but I suspect the esp board is just connected using serial connection so it should work as any esp8266 connected by serial

@tekstyle
Copy link

thank you luc-github. i am moving from duet and coding for marlin and MKS is very confusing for me. i am also not a coder. right now, i have a factory MKS board i want to set up for my Delta Kossel mini. do i go here https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware. follow the instructions to copy the TFT35 folder and BIGTREE_TFT*_V*...bin file over to my SD card. insert into my board to update it? still though, how do I set up delta configuration? i was look at https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/blob/master/Copy%20to%20SD%20Card%20root%20directory%20to%20update%20-%20Unified%20Menu%20Material%20theme/config.ini or just any config.ini files and I do not see any options to set machine settings (corexy,cartesian,delta,scara, etc). and also where would I have to go to enter the ssID and PW for my home wifi network?

@luc-github
Copy link
Owner

is it MKS TFT ? or BTT TFT?
I am not expert on BTT TFT configuration so I cannot help even less with MKS TFT
in Marlin you do not configure wifi in any case
in Marlin you just need to be sure the second serial port is enabled - but I cannot help more as I wrote do not have your board
The SSID / PWD way to setup will depend on what FW you put on ESP board - MKS FW or ESP3D

For serial and machine configuration questions you better go to Marlin Forum, you will get better support

@tekstyle
Copy link

is it MKS TFT ? or BTT TFT?
I am not expert on BTT TFT configuration so I cannot help even less with MKS TFT
in Marlin you do not configure wifi in any case
in Marlin you just need to be sure the second serial port is enabled - but I cannot help more as I wrote do not have your board
The SSID / PWD way to setup will depend on what FW you put on ESP board - MKS FW or ESP3D

For serial and machine configuration questions you better go to Marlin Forum, you will get better support

this is a MKS TFT. i think i understand a little more now. either way for machine config, i'll have to compile marlin and build for the MKS robin nano. i was plan on putting ESP3D but I thought BTT FW was the only thing that worked. is there a working ESP3D for MKS TFT? i see you mention something like that above

"mks wifi 1.0 + ESP3D
mks tft + btt FW
= full control

and today I have pushed a PR to BTT github to add support in ESP3D of TFT Sd and TFT usb"

@luc-github
Copy link
Owner

luc-github commented Jul 21, 2020

in your case the esp is connected to printer board not TFT, or I misunderstood ? so what ever the FW on TFT it won't affect the esp board itself because it is connected to printer board

@tekstyle
Copy link

in your case the esp is connected to printer board not TFT, or I misunderstood ? so what ever the FW on TFT it won't affect the esp board itself because it is connected to printer board

that's correct, the esp is connected to the board, not the TFT.

@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 Sep 21, 2020
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