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] Strange translation going on with M117=>M147 #388

Closed
hapklaar opened this issue Nov 24, 2019 · 24 comments
Closed

[BUG] Strange translation going on with M117=>M147 #388

hapklaar opened this issue Nov 24, 2019 · 24 comments

Comments

@hapklaar
Copy link

hapklaar commented Nov 24, 2019

Describe the bug
Whenever I send a M117 command through ESP3D, it seems to translate this to another command, M147.

To Reproduce
Steps to reproduce the behavior:

  1. Open ESP3d web page
  2. Enter 'M117 Testing' into the serial
  3. See output M147 unknown command and S0 unknown command returned from printer (Marlin):

Send: M117 testing123
[...]
Recv: echo:Unknown command: "M147 testing123"
Recv: ok
Recv: echo:Unknown command: "S0"
Recv: ok

Expected behavior
'OK' and text on LCD

ESP3D Firmware:
All compiled from latest code

Target Firmware:

  • Name: Marlin
  • Version 2.0

Board used (please complete the following information):

  • MCU: ESP01
  • Name:
  • Flash size: 4M?

Additional context
Add any other context about the problem here.
Wiring, decoded stack, etc...

Edit: just saw same behavior with esp-link firmware, so might not be ESP3d issue at all... I'll investigate further

Edit2: My setup:
SKR1.3 with TFT35 connected through AUX1/TFT port
ESP01 flashed with ESP3d or esp-link connected to ESP port on TFT35
Marlin configured with dual serial port:
1 = #define SERIAL_PORT -1 (used by Octoprint)
2 = #define SERIAL_PORT_2 0 (used by TFT)

@hapklaar hapklaar added the bug label Nov 24, 2019
@github-actions
Copy link

Thank your for submiting, please be sure you followed template or your issue may be dismissed.

@luc-github
Copy link
Owner

do you have same problem ?

  • when you send command by serial.
  • when you send command by telnet (using putty for example).

@hapklaar
Copy link
Author

same issue through esp3d webinterface command input and telnet connection to data port.

When I send M117 to serial of mainboard (SKR 1.3), it works just fine.

@luc-github
Copy link
Owner

luc-github commented Nov 24, 2019

ok, telnet neither webcommand do text modification, so problem should be between esp and board

How is your esp board wired to your SKR board ?
What baud rate do you use ?

@hapklaar
Copy link
Author

I updated my OP with how everything is connected. I use 250000 baud, but also tried 115200, no change.

@luc-github
Copy link
Owner

you use aux1 so what esp board do you used ?
Do you mean ESP is connected to TFT and TFT is connected to skr ?
what FW version did you flashed on on ESP3D ?

@hapklaar
Copy link
Author

hapklaar commented Nov 24, 2019

you use aux1 so what esp board do you used ?
Do you mean ESP is connected to TFT and TFT is connected to skr ?
what FW version did you flashed on on ESP3D ?

That's right. I use an ESP01, connected to ESP port of TFT35. TFT35 is connected to SKR via TFT port, which is the same as AUX1.

pic for clarification:
image

I cloned your repo, compiled and flashed. Versions obtained from web interface:
UI: 2.1b20 / FW: 2.1.0.b39

@luc-github
Copy link
Owner

excellent! I just received same screen and esp board yesterday to check some issue I saw on forums
1 - I cannot reproduce your issue, on my screen when I send M117 blabla I have window on tft which apear with M117 title and blabla text (I have several other issues but may be related to hardware and Marlin/TFT FW)

2 - as you were able to flash - it means you have serial to USB adapter that you use to flash the esp, please do me a favor and connect your ESP to this serial adapter and open your serial terminal and send the M117 blabla from webUI or telnet to confirm the ESP3D output is correct on serial

@hapklaar
Copy link
Author

hapklaar commented Nov 24, 2019

Ah yes we are getting somewhere :)

When I try your test, I do see correct output on serial:
image

TFT firmware issue?

Also discussing this here: bigtreetech/BIGTREETECH-TouchScreenFirmware#153

@luc-github
Copy link
Owner

luc-github commented Nov 24, 2019

yes definitly :) but I cannot work on this right now sorry - but it is in my plan for next week as several people complained, but even it is not ESP3D issue I need to dig in - that is why I bought the screen

@hapklaar
Copy link
Author

Great, no rush! I'll keep an eye on this topic.

@luc-github
Copy link
Owner

luc-github commented Nov 24, 2019

can you share your TFT FW version ?
mine is when you go to settings /info

Board: BIGTREETECH_TFT35_V3.0
Firmware: TFT35_V3_0.23 Sep 20 2019

@hapklaar
Copy link
Author

hapklaar commented Nov 24, 2019

Mine is latest code built from source. In info screen it identifies itself as:

Board: BIGTREETECH_TFT35_V3.0
Firmware: TFT35_V3_0.24.2 Nov 23 2019

I'm going to try that precompiled binary and see if it behaves differently

@luc-github
Copy link
Owner

luc-github commented Nov 24, 2019

Great, thank you ! Now I know the latest TFT git bring more trouble than I found already ^_^

@hapklaar
Copy link
Author

hapklaar commented Nov 24, 2019

Interesting....

  • When I try the precompiled fw BIGTREE_TFT35_V3.0.23.bin (20 sept 2019) , the M117 message is shown on screen.
  • Doing the same with precompiled BIGTREE_TFT35_V3.0.24.2.bin (Unified Material Theme - 7 nov 2019) this also still works.
  • Recompiled latest src and flashed, and it worked only briefly during startup, showing the Wifi connecting messages on screen ending with Connected Then followed by:
    Unknown command M147 192.168.111.249

@luc-github
Copy link
Owner

yes definitly in FW TFT - need to check which commit generate such behavior

@hapklaar
Copy link
Author

Tried fork from https://github.com/guruathwal/BIGTREETECH-TouchScreenFirmware . This one seems to work ok upon first look. Will need to test more.

@luc-github
Copy link
Owner

luc-github commented Nov 24, 2019

I think I found the bug reading the code
https://github.com/bigtreetech/BIGTREETECH-TouchScreenFirmware/blob/master/TFT/src/User/API/interfaceCmd.c#L249-L258

the break statement is not in correct position , so next command seems modifying the output and set 4 in 3rd char

change the break position from

case 117: //M117
          if (infoMenu.menu[infoMenu.cur] == menuStatus)
          {
            statusScreen_setMsg((u8 *)"M117", (u8 *)&infoCmd.queue[infoCmd.index_r].gcode[5]);
          }
          else
          {
            popupReminder((u8 *)"M117", (u8 *)&infoCmd.queue[infoCmd.index_r].gcode[5]);
            break;
          }

to

case 117: //M117
          if (infoMenu.menu[infoMenu.cur] == menuStatus)
          {
            statusScreen_setMsg((u8 *)"M117", (u8 *)&infoCmd.queue[infoCmd.index_r].gcode[5]);
          }
          else
          {
            popupReminder((u8 *)"M117", (u8 *)&infoCmd.queue[infoCmd.index_r].gcode[5]);
          }
         break;

should solve the problem

@luc-github
Copy link
Owner

I think issue can be closed 😸

@hapklaar
Copy link
Author

@luc-github really curious to know how you experience communication through the TFT's ESP port. For me it seems very unstable. For example I only get output from that port after I send something to it, then it stops again. This is very apparent by looking at temperature readings. Setting ESP3d to check position every 1 second helps a bit, but I don't think this is the solution?

@luc-github
Copy link
Owner

luc-github commented Nov 27, 2019

well I did not test yet so much - it is in my todo list but with the version I have, the communication is only one way (ESP -> TFT ->Printer) for what I can see - I do not get any command return even temperatures.

I have tested with a Mega/ramps marlin 2.0 system and tft + esp = reset printer board at start, when no esp is ok,
so I suspect power is not enough with 5V avr, also I saw repetier FW was not supported well

So I suspect this TFT is tailored for Bigtreetech board like skr 1.3 but I do not have any cash to buying one for the moment, so I plan to power externaly the TFT to see if power is the root cause and be able to continue debug.

That said it is not in my top priority list as the issue is not in my FW but in TFT one - I have other topic more urgent to do before going to this,

sorry.

@hapklaar
Copy link
Author

If you have the motor drivers needed for SKR1.3, like for example tmc2130, I can donate a board to you, no strings attached. It's only around $16 this weekend.

@luc-github
Copy link
Owner

Well if you do not have usage of it, this could be useful - yes I should have some tmc2130.
thank you ^_^

Repository owner deleted a comment from hapklaar Dec 10, 2019
@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

2 participants