bigtreetech / BIGTREETECH-TouchScreenFirmware

support TFT35 V1.0/V1.1/V1.2/V2.0/V3.0, TFT28, TFT24 V1.1, TFT43, TFT50, TFT70
GNU General Public License v3.0
1.3k stars 1.64k forks source link

[Q] How to display M117 messages in touch mode info area on TFT35 E3 V3.0? #1050

Closed StarNamer closed 3 years ago

StarNamer commented 4 years ago

Your question or details you need. Please describe. When in Marlin (12864 simulator) mode, M117 messages regarding progress etc are displayed on the last line of the screen. How do I get these to display on the Info Area when in touch mode. With the current firmware, the text "Ender-3 Ready" is always displayed.

specify the device variant related to your question. TFT35 E3 V3.0.

Additional context So far, I've only tested this while printing GCode sent via USB from OctoPrint, either as a print job or as terminal commands. The test displays in Marlin mode, but not in touch mode. .

traffic-light commented 4 years ago

I've got the same issue.

I think it's some sort of lost with an update.... But the strange thing is when sending through terminal on the TFT it's receiving it correctly

StarNamer commented 4 years ago

If I type an M117 command in the touch mode 'terminal' on the TFT then if gets displayed in to info area (though there's not must you can type). If I type an M117 command in OctoPrint's 'terminal' then it gets displayed in Marlin mode, but the info area in touch mode doesn't change.

traffic-light commented 4 years ago

A couple of day's ago I did take a look at it. Couldn't find anything..

I'll take a look again. maybe I'm lucky today :-P

radek8 commented 4 years ago

In the parseACK.c file you define messages that will be suppressed and will not be displayed. Try to allow what you need.

StarNamer commented 4 years ago

What I need is for it to display the text reported by the M117 command in GCode. How do I allow it to do that?

radek8 commented 4 years ago

Comment out these lines (//) in the file parceACK.c

image

traffic-light commented 4 years ago

@radek8 already did that. Also added notify toast ;-)

Doesn't work

radek8 commented 4 years ago

Then Marlin can filter it. Swap ports in Marlin configuration. Set the touch screen to serialport, on serial port2 set Octoprint I don't know if it will help but I would try it. Another option is to connect the Octoprint to the serial port of the display, but you probably won't want that ...

StarNamer commented 4 years ago

@radek8 I don't understand your comment. Are you suggesting to change the Marlin firmware to swap the definitions of SERIAL_PORT and SERIAL_PORT_2? However, you "don't know if it would help"?

Currently:

`/**

/**

Also, I considered connecting OctoPrint to the USB port on the display (I assume that's what you mean by "serial port"), but as far as I can find, that's configured to act as a host for USB drives, not as a COM port, so OctoPrint couldn't run the printer through it.

Update:I tried connecting the Pi to the TFT35 and it doesn't recognised the TFT35 as anything.

[By the way, I thought this would be a simple setting change, since most people with a TFT35 using OctoPrint would expect to see the M117 messages in the info area of the touch screen and not have to run in Marlin mode to see them; for that, I might as well have stayed with the original screen!]

StarNamer commented 4 years ago

Of course, it may be that this is impossible without changing Marlin to notify the TFT35 of the message.

I haven't checked, but would assume that the 12864 simulator is actually just creating a representation of the instructions sent by Marlin which is effectively creating a bitmap of the screen pixels. Hence when Marlin executes an M117 command, it simply updates the "bitmap", inserting the text in the bottom line of the display. So it shows in Marlin mode, but nothing is sent to the TFT35 that it can recognise and interpret.

radek8 commented 4 years ago

OK Marlin you have configured the way I thought it might work. I have no idea now

radek8 commented 4 years ago

Did you connect Ictoprint to the TFT in the USB port? it can't work, you would have to use serial port3 on TFT it should work.

StarNamer commented 4 years ago

[it seem surreal to discuss Marlin mods in the BTT issue log., but...]

Adding the lines marked /**/ in ultralcd.cpp (in the set_status method)...

`

 void MarlinUI::set_status(const char * const message, const bool persist) {
    if (alert_level) return;

    TERN_(HOST_PROMPT_SUPPORT, host_action_notify(message));
    /**/// Always send status as action:notification (expansion of host_action_notify)
    /**/PORT_REDIRECT(SERIAL_BOTH);
    /**/SERIAL_ECHOPGM("//action:");
    /**/serialprintPGM(PSTR("notification "));
   /**/SERIAL_ECHOLN(message);

` Causes an M117 command to echo back to OctoPrint and presumably also send to the TFT35 as I assume it's the other serial port. In OctoPrint, I see:

`

Send: M117 OK
Recv: //action:notification OK
Recv: ok`

If I then change the above to use: `

    /**/PORT_REDIRECT(SERIAL_BOTH);
    /**/SERIAL_ECHOPGM("echo:");
    /**/SERIAL_ECHOLN(message);

` Then the text gets put in the Info Area as desired.

guruathwal commented 4 years ago

you may try the M118 in place of M117

StarNamer commented 4 years ago

The pronlem with that is that OctoPrint plugins like "Detailed Progress" and "DisplayLAyerProgress" use M117 with no option to change to using M118. So it's a case of change the Marlin firmware (easy) or change the OctoPrint plugins (hard).

whitedavil commented 4 years ago

The solution for this is to add this code in parseACK.c file:

if(ack_seen("notification ")) { strcpy(hostAction.prompt_begin, dmaL2Cache + ack_index); statusScreen_setMsg((u8 )echomagic, (u8 )dmaL2Cache + ack_index); }

in this place: Immagine ` I have tested the code on my TFT50 and work well.

Dev request: Is possible to add this code in master branch? thanks

traffic-light commented 4 years ago

The solution for this is to add this code in parseACK.c file:

if(ack_seen("notification ")) { strcpy(hostAction.prompt_begin, dmaL2Cache + ack_index); statusScreen_setMsg((u8 )echomagic, (u8 )dmaL2Cache + ack_index); }

in this place: Immagine ` I have tested the code on my TFT50 and work well.

Dev request: Is possible to add this code in master branch? thanks

You can always create a pull request ;-)

whitedavil commented 4 years ago

Thanks for your suggestion, today I try it! 😉 This is the first time to me on github.

Madbyte3d commented 4 years ago

whitedavil is this in addition to what StarNamer changed above? I have a TFT70 and tried only what you have on the screenshot and it didn't work for me.

whitedavil commented 4 years ago

To work correctly the host action command option must be active in the marlin firmware

ssombra commented 4 years ago

To work correctly the host action command option must be active in the marlin firmware

How do you activate that?

radek8 commented 4 years ago

Configuration_adv.h

define HOST_ACTION_COMMANDS

if ENABLED(HOST_ACTION_COMMANDS)

define HOST_PROMPT_SUPPORT

endif

megatech1966 commented 3 years ago

The modded firmware worked. I can send text to the screen now. “Layer” plugin displays the information fine. Why don’t I see anything from the “detailed progress” plugin?

whitedavil commented 3 years ago

Are you sure that the plugin work correctly? I alredy use this plugin and all work fine.

megatech1966 commented 3 years ago

I didn’t have the plugin installed đŸ„ș

Sent from my iPhone X 256Gb

On 27 Sep 2020, at 8:07 pm, whitedavil notifications@github.com wrote:

ï»ż Are you sure that the plugin work correctly? I alredy use this plugin and all work fine.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

thebiggestgit commented 3 years ago

Thanks this was great, I was tearing my hair out trying to get some status updates on the screen in touch mode, once I'd enabled the Marlin settings as per TFT instructions it didn't work, but enabling the #define HOST_ACTION_COMMANDS line and #define HOST_PROMPT_SUPPORT (which were both commented out) worked, so now get the status messages displayed. Running a few plugins on octoprint to show ETA and layer progress etc so really useful. Thanks all. IMG_9835

rkarlsba commented 3 years ago

thebiggestgit, no changes to the code elsewhere? I'm using an SKR 1.4 turbo with the TFT35 E3 V3.0 and I've tried HOST_PROMPT_SUPPORT etc, but no luck. Also, with an M600 sent to change filament, the touch version didn't bother noticing me. When I tried to press the knob to get into marlin mode, it read the click as an action and started printing again, long before I even got the prompt.

radek8 commented 3 years ago

Depending on what you write, you do not have the current version of Marlin. You install the current Marin bugfix-2.0.x For M600, enable

define ADVANCED_PAUSE_FEATURE

rkarlsba commented 3 years ago

M600 works, but I only get output on the screen in marlin mode.

radek8 commented 3 years ago

When rotating the encoder in touch mode, does the print speed change?

If so, you're using old Marlin Therefore, after pressing the encoder, printing started

radek8 commented 3 years ago

M600 works, but I only get output on the screen in marlin mode.

You are allowed?

define HOST_ACTION_COMMANDS (in Configuration_adv.h)

define HOST_PROMPT_SUPPORT

rkarlsba commented 3 years ago

I have added I have enabled HOST_ACTION_COMMANDS and HOST_PROMPT_SUPPORT, yes. I'm not using bugfix-2.0.x. I get lost in git. How do I switch to that branch?

radek8 commented 3 years ago

https://github.com/MarlinFirmware/Marlin/tree/bugfix-2.0.x or

https://marlinfw.org/meta/download/ image

rkarlsba commented 3 years ago

Yeah - I was just messing around with git, but I managed at last - but I'll get back to you later. Not close to the printer at the moment.

rkarlsba commented 3 years ago

upgraded to latest bugfix-2.0.x from git - same result - no status on colour display, lots of status in marlin mode

rkarlsba commented 3 years ago

Any ideas on how to address this?

mink007 commented 3 years ago

The solution for this is to add this code in parseACK.c file:

if(ack_seen("notification ")) { strcpy(hostAction.prompt_begin, dmaL2Cache + ack_index); statusScreen_setMsg((u8 )echomagic, (u8 )dmaL2Cache + ack_index); }

in this place: Immagine ` I have tested the code on my TFT50 and work well.

Dev request: Is possible to add this code in master branch? thanks

Let us say I am calling M117 HELLO, through Serial_Puts(SERIAL_PORT, "M117 HELLO"), in Heat.c (touchscreen side of the code). THe host responds with HELLO. How to capture the "HELLO" in Heat.c file? When I am in StatusScreen.c only then I am able to see the "HELLO" in status.

I was hoping that when loopProcess(); is called in Heat.c then HELLO should have been captured but that is not the case until I go back to the StatusScreen.

Any insight into what I might be missing here?

mink007 commented 3 years ago

The solution for this is to add this code in parseACK.c file: if(ack_seen("notification ")) { strcpy(hostAction.prompt_begin, dmaL2Cache + ack_index); statusScreen_setMsg((u8 )echomagic, (u8 )dmaL2Cache + ack_index); } in this place: Immagine ` I have tested the code on my TFT50 and work well. Dev request: Is possible to add this code in master branch? thanks

Let us say I am calling M117 HELLO, through Serial_Puts(SERIAL_PORT, "M117 HELLO"), in Heat.c (touchscreen side of the code). THe host responds with HELLO. How to capture the "HELLO" in Heat.c file? When I am in StatusScreen.c only then I am able to see the "HELLO" in status.

I was hoping that when loopProcess(); is called in Heat.c then HELLO should have been captured but that is not the case until I go back to the StatusScreen.

Any insight into what I might be missing here?

I was able to figure out that "toggleTool();" function is the one that updates. More specifically nextScreenUpdate(UPDATE_TOOL_TIME).

thebiggestgit commented 3 years ago

thebiggestgit, no changes to the code elsewhere? I'm using an SKR 1.4 turbo with the TFT35 E3 V3.0 and I've tried HOST_PROMPT_SUPPORT etc, but no luck. Also, with an M600 sent to change filament, the touch version didn't bother noticing me. When I tried to press the knob to get into marlin mode, it read the click as an action and started printing again, long before I even got the prompt.

Sorry only just seen your question, I don't think it was anything else in Marlin, but I had gone through and enabled all of the options as specified in the TFT35 readme file for Marlin, was a while ago I did this now. It was showing the temperatures OK before, so all that shows are updates in the Status window, all buttons remain the same as though it's waiting to print.

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