MKS-TFT icon indicating copy to clipboard operation
MKS-TFT copied to clipboard

MKS TFT V3.0.2 M Codes in Custom buttons don't seem to work

Open fabemit opened this issue 7 years ago • 9 comments

Hi,

I have been trying to use M Codes in custom buttons for babystepping and BL Touch controls but with no success. G Codes seem to work fine though.

An Example of what i am doing is below:

#set number of "More" button

moreitem_pic_cnt:4

#edit command for 1~7 "More" button,each command must be separated by semicolon ";"

moreitem_button1_cmd:M280 P0 S10; moreitem_button2_cmd:M280 P0 S90; moreitem_button3_cmd:M280 P0 S120; moreitem_button4_cmd:M280 P0 S160;

#how many "More" button display on screen interface

morefunc_cnt:2

#command setting on button1~6

morefunc1_cmd:M290 Z0.05; morefunc2_cmd:M290 Z-0.05;

Attached my config file for you to check. Any help would be appreciated.

mks_config.txt

fabemit avatar Dec 13 '18 19:12 fabemit

You can send the command through PC software,like the Pronterface to test your main board firmware is normal.

makerbase-mks avatar Dec 14 '18 02:12 makerbase-mks

Hi and thank you for the reply, I have already tried through Pronterface that is why i believe it is the MKS TFT firmware that is the issue.

Any other suggestions to find the issue?

fabemit avatar Dec 14 '18 10:12 fabemit

Also the button used for auto levelling had the code

#the command of auto leveling (G29 is available for Marlin.While G32 is for Repetier and Smoothieware)

cfg_auto_leveling_cmd:G28;G29;

Which worked. I then changed it to

#the command of auto leveling (G29 is available for Marlin.While G32 is for Repetier and Smoothieware)

cfg_auto_leveling_cmd:G28;G29 L40 R125 F40 B150;

With the grid offsets and it now doesn't work.

It looks like the firmware has issues with spaces in commands which isn't helpful in the slightest. Is it possible for this to be checked? and if so will you provide a patch or solution to fix this?

fabemit avatar Dec 15 '18 13:12 fabemit

Hello it's been a month any response to this?

fabemit avatar Jan 20 '19 11:01 fabemit

image I tested it and it is sending instructions normally.

makerbase-mks avatar Jan 24 '19 02:01 makerbase-mks

#-------------------------------------------------------------------- ######### 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:4

#multi-language(enable:1, disable:0)

cfg_multiple_language:0

#languages setting(simplified (simplified Chinese:1; traditional Chinese:2; English:3; Russian:4; Spanish:5;French:6;Italian:7). #This configuration is valid when "cfg_multiple_language" is disabled.

cfg_language_type:3

#extruder number(one:1; dual:2)

cfg_sprayer_counter:1

#enable heated bed(yes:1; no: 0)

cfg_custom_bed_flag:1

#the max target temp of extruder and heated bed

cfg_max_sprayer_temperature:305 cfg_max_hotbed_temperature:150

#pause position (-1 is invalid; Z-axis is relative position)

cfg_XPOS:10 cfg_YPOS:-1 cfg_ZADD:10

#----------------------------------------------------------------------- ######### Advanced Function Option ##################################

#enable UPS?(yes:1; no:0)

cfg_have_ups_device:0

#enable power detecting module(mks 220det:1; mks pwc:0)

cfg_insert_det_module:0

#enable auto off after print finish function (no:0; Yes:1)

cfg_print_finish_close_Machine:0

#set PB0 signal when use it for sencond nozzle (high level:1; low level:0)

cfg_PB0_trigger_Level:0

#set PB1 signal (high level:1; low level:0)

cfg_PB1_trigger_Level:0

#set error range of Z-axis on breakpoints recovery

cfg_breakpoint_z_error:0.2

#---------------------------------------------------------------------------

######### Filament Change Function ##############################

#the speed to extrude filament(mm/min)

cfg_filament_load_speed:1200 #the lenght to extrude filament (mm) cfg_filament_load_length:700

#the speed to retract filament(mm/min)

cfg_filament_unload_speed:1200 #the lenght to retract filament(mm) cfg_filament_unload_length:700

#It is the minimum temperature for filament change. It will auto heat up if the current temp doesn't reach the target.

cfg_filament_load_limit_temperature:210

#The length of Load filament before unloader filament.

cfg_unload_retract_length:2

#The speed of load filament before unloader filament.

cfg_unload_retract_speed:1200

#---------------------------------------------------------------------------

############ Leveling Function ########################################

#leveling mode(manual:0; auto:1; conceal leveling button:2)

cfg_leveling_mode:1

#the command of auto leveling (G29 is available for Marlin.While G32 is for Repetier and Smoothieware)

cfg_auto_leveling_cmd:G28;G29 L40 R125 F40 B150;

#the point number of manual leveling:(3,4,5 point available)

cfg_point_number:5

#the coordinates of 5 point on manual leveling

cfg_point1:10,10 cfg_point2:160,10 cfg_point3:160,160 cfg_point4:10,160 cfg_point5:85,85

#the travel speed of leveling(mm/min)

cfg_leveling_z_speed:1500 cfg_leveling_xy_speed:3000

#---------------------------------------------------------------------------

############# WIFI Function ##########################################

#wifi model(MKS WIFI TFT:0; MKS HLK-WIFI:1)

cfg_wifi_type:0

#wifi mode(0:sta;1:ap)

cfg_wifi_mode:0

#wifi name and password

cfg_wifi_ap_name:MKS_wifi cfg_wifi_key_code:makerbase

#0:disable cloud service 1:enable cloud service

cfg_cloud_enable:1 #cloud service adress cfg_wifi_cloud_host:www.baizhongyun.cn #cloud service port cfg_cloud_port:10086

#Dynamic access IP

cfg_ip_dhcp_flag:1

#IP/mask/gateway

cfg_ip_address:192.168.3.100 cfg_ip_mask:255.255.255.0 cfg_ip_gate:192.168.3.1

#--------------------------------------------------------------------------------

############## Function Customization #######################################

#user-defined function1 and 2.(display this button . disable: 0; enable: 1)

cfg_function_btn1_display:1

#command of user-defined function

function_btn1_cmd:M84;

#set number of "More" button

moreitem_pic_cnt:4

#edit command for 1~7 "More" button,each command must be separated by semicolon ";"

moreitem_button1_cmd:M280 P0 S10;

moreitem_button2_cmd:M280 P0 S90;

moreitem_button3_cmd:M280 P0 S120;

moreitem_button4_cmd:M280 P0 S160;

moreitem_button5_cmd:G28 Z0;

moreitem_button6_cmd:G28 Z0;

moreitem_button7_cmd:G28;

#how many "More" button display on screen interface

morefunc_cnt:2

#command setting on button1~6

morefunc1_cmd:M290 Z0.05; morefunc2_cmd:M290 Z-0.05; morefunc3_cmd:G28; morefunc4_cmd:G28; morefunc5_cmd:G28; morefunc6_cmd:G28;

#---------------------------------------------------------------------------------

Display Customization(button and logo customized see User's Manual)

#the color of screen background

cfg_background_color:0x000000

#the color of title text

cfg_title_color:0xFFFFFF

#the color of temperature,fan,(etc) background

cfg_state_background_color:0x000000

#the color of temprature,fan,(etc) text

cfg_state_text_color:0xFFFFFF

#the color of file button

cfg_filename_background_color:0x000000

#the color of file text

cfg_filename_color:0xFFFFFF

#the color of background in printing

cfg_printingstat_word_background_color:0x000000

#the color of text in printing status

cfg_printingstat_word_color:0xFFFFFF

#3D effects setting (disable: 0; enable: 1)

cfg_BUTTON_3D_effects:0

#The screen is flipped 180°(0: no flip, 0xEE: flip)

cfg_OVERTURN_180:0

#shield the function of detection power (0:no shield ,1:shield)

cfg_disable_PWR_det:0

#shield the function of detection filament (0:no shield ,1:shield)

cfg_disable_MT_det:0

#Whether to support the function of dual extruder single nozzle.(0: disable, 1: enable) #the extruder number need set to dual.

cfg_single_nozzle:0

#For the M110 command plus check, the version of Marlin 1.0.2 and below is set to 1, and the other versions are set to 0.

cfg_M110_add_checkSum:1

#Enable function of display error message. (no:0; Yes:1)

cfg_display_eeror_message:0

#-----------------------------------------------------------------------

makerbase-mks avatar Jan 24 '19 02:01 makerbase-mks

anyone how to add a gcode to "more" button @Bobblejot you told its working fine for gcode can you please tell how to write a gcode to custom button @thank u @sancocbvb

sancocbvb avatar Aug 26 '19 11:08 sancocbvb

Teaching tech has a tutorial on Youtube that covers doing exactly this. https://youtu.be/ncc7TRkCH-M it doesnt look any different to whats been listed here so ????? @Bobblejot I have my bed offsets in my Mainboard firmware and it seems to work fine... Although I am new at this so I could be blissfully unaware of whats actually occurring :)

MarkV3082 avatar Sep 08 '19 14:09 MarkV3082

#-------------------------------------------------------------------- ######### 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:4

#multi-language(enable:1, disable:0)

cfg_multiple_language:0

#languages setting(simplified (simplified Chinese:1; traditional Chinese:2; English:3; Russian:4; Spanish:5;French:6;Italian:7). #This configuration is valid when "cfg_multiple_language" is disabled.

cfg_language_type:3

#extruder number(one:1; dual:2)

cfg_sprayer_counter:1

#enable heated bed(yes:1; no: 0)

cfg_custom_bed_flag:1

#the max target temp of extruder and heated bed

cfg_max_sprayer_temperature:305 cfg_max_hotbed_temperature:150

#pause position (-1 is invalid; Z-axis is relative position)

cfg_XPOS:10 cfg_YPOS:-1 cfg_ZADD:10

#----------------------------------------------------------------------- ######### Advanced Function Option ##################################

#enable UPS?(yes:1; no:0)

cfg_have_ups_device:0

#enable power detecting module(mks 220det:1; mks pwc:0)

cfg_insert_det_module:0

#enable auto off after print finish function (no:0; Yes:1)

cfg_print_finish_close_Machine:0

#set PB0 signal when use it for sencond nozzle (high level:1; low level:0)

cfg_PB0_trigger_Level:0

#set PB1 signal (high level:1; low level:0)

cfg_PB1_trigger_Level:0

#set error range of Z-axis on breakpoints recovery

cfg_breakpoint_z_error:0.2

#---------------------------------------------------------------------------

######### Filament Change Function ##############################

#the speed to extrude filament(mm/min)

cfg_filament_load_speed:1200 #the lenght to extrude filament (mm) cfg_filament_load_length:700

#the speed to retract filament(mm/min)

cfg_filament_unload_speed:1200 #the lenght to retract filament(mm) cfg_filament_unload_length:700

#It is the minimum temperature for filament change. It will auto heat up if the current temp doesn't reach the target.

cfg_filament_load_limit_temperature:210

#The length of Load filament before unloader filament.

cfg_unload_retract_length:2

#The speed of load filament before unloader filament.

cfg_unload_retract_speed:1200

#---------------------------------------------------------------------------

############ Leveling Function ########################################

#leveling mode(manual:0; auto:1; conceal leveling button:2)

cfg_leveling_mode:1

#the command of auto leveling (G29 is available for Marlin.While G32 is for Repetier and Smoothieware)

cfg_auto_leveling_cmd:G28;G29 L40 R125 F40 B150;

#the point number of manual leveling:(3,4,5 point available)

cfg_point_number:5

#the coordinates of 5 point on manual leveling

cfg_point1:10,10 cfg_point2:160,10 cfg_point3:160,160 cfg_point4:10,160 cfg_point5:85,85

#the travel speed of leveling(mm/min)

cfg_leveling_z_speed:1500 cfg_leveling_xy_speed:3000

#---------------------------------------------------------------------------

############# WIFI Function ##########################################

#wifi model(MKS WIFI TFT:0; MKS HLK-WIFI:1)

cfg_wifi_type:0

#wifi mode(0:sta;1:ap)

cfg_wifi_mode:0

#wifi name and password

cfg_wifi_ap_name:MKS_wifi cfg_wifi_key_code:makerbase

#0:disable cloud service 1:enable cloud service

cfg_cloud_enable:1 #cloud service adress cfg_wifi_cloud_host:www.baizhongyun.cn #cloud service port cfg_cloud_port:10086

#Dynamic access IP

cfg_ip_dhcp_flag:1

#IP/mask/gateway

cfg_ip_address:192.168.3.100 cfg_ip_mask:255.255.255.0 cfg_ip_gate:192.168.3.1

#--------------------------------------------------------------------------------

############## Function Customization #######################################

#user-defined function1 and 2.(display this button . disable: 0; enable: 1)

cfg_function_btn1_display:1

#command of user-defined function

function_btn1_cmd:M84;

#set number of "More" button

moreitem_pic_cnt:4

#edit command for 1~7 "More" button,each command must be separated by semicolon ";"

moreitem_button1_cmd:M280 P0 S10;

moreitem_button2_cmd:M280 P0 S90;

moreitem_button3_cmd:M280 P0 S120;

moreitem_button4_cmd:M280 P0 S160;

moreitem_button5_cmd:G28 Z0;

moreitem_button6_cmd:G28 Z0;

moreitem_button7_cmd:G28;

#how many "More" button display on screen interface

morefunc_cnt:2

#command setting on button1~6

morefunc1_cmd:M290 Z0.05; morefunc2_cmd:M290 Z-0.05; morefunc3_cmd:G28; morefunc4_cmd:G28; morefunc5_cmd:G28; morefunc6_cmd:G28;

#---------------------------------------------------------------------------------

Display Customization(button and logo customized see User's Manual)

#the color of screen background

cfg_background_color:0x000000

#the color of title text

cfg_title_color:0xFFFFFF

#the color of temperature,fan,(etc) background

cfg_state_background_color:0x000000

#the color of temprature,fan,(etc) text

cfg_state_text_color:0xFFFFFF

#the color of file button

cfg_filename_background_color:0x000000

#the color of file text

cfg_filename_color:0xFFFFFF

#the color of background in printing

cfg_printingstat_word_background_color:0x000000

#the color of text in printing status

cfg_printingstat_word_color:0xFFFFFF

#3D effects setting (disable: 0; enable: 1)

cfg_BUTTON_3D_effects:0

#The screen is flipped 180°(0: no flip, 0xEE: flip)

cfg_OVERTURN_180:0

#shield the function of detection power (0:no shield ,1:shield)

cfg_disable_PWR_det:0

#shield the function of detection filament (0:no shield ,1:shield)

cfg_disable_MT_det:0

#Whether to support the function of dual extruder single nozzle.(0: disable, 1: enable) #the extruder number need set to dual.

cfg_single_nozzle:0

#For the M110 command plus check, the version of Marlin 1.0.2 and below is set to 1, and the other versions are set to 0.

cfg_M110_add_checkSum:1

#Enable function of display error message. (no:0; Yes:1)

cfg_display_eeror_message:0

#-----------------------------------------------------------------------

Hi, I have this issue that is I want to add custom button to open the lights and close them. I connected the led wires onto the main board. But I don't know what is the code and how to write in MKS TFT 3.5 config file. Could you help me with this situation please?

Asafbucak avatar Aug 16 '22 20:08 Asafbucak