Bed Leveller (3D Printer Assistant)

So you have written that new, must have program. Let us see it here.
PartierSP
Posts: 51
Joined: Tuesday 30th November 2021 12:14am
Location: Canada
Contact:

Re: Bed Leveller (3D Printer Assistant)

Post by PartierSP » Wednesday 29th December 2021 6:26am

Thanks for the quick test run. I now see how Cura is doing the temperature monitoring. Its sending a M105 periodically instead of setting up automatic temperature reporting with a M155 Sxx command. I managed to snoop this by starting up miniterm and sending a M111 S7 (this turns on echo, extra info, and extra debugging) and then start up Cura. So this is easily fixed using a timer.

I have a feeling that there's a bug in my printer and I need to flash an update. This is possibly a common issue and why Cura does it with M105 instead.

User avatar
stevedee
Posts: 514
Joined: Monday 20th March 2017 6:06pm

Re: Bed Leveller (3D Printer Assistant)

Post by stevedee » Wednesday 29th December 2021 11:54am

PartierSP wrote:
Wednesday 29th December 2021 6:26am
...I now see how Cura is doing the temperature monitoring. Its sending a M105 periodically...
Like you, I'm also using M155 S5 (5 sec interval) but without any apparent problems.
I have a feeling that there's a bug in my printer and I need to flash an update. This is possibly a common issue and why Cura does it with M105 instead.

From the Marlin web site (https://marlinfw.org/docs/gcode/M105.html):-
Some hosts may hide the reply from M105.

A better way for hosts to get regular temperature updates is to use M155 (requires AUTO_REPORT_TEMPERATURES and EXTENDED_CAPABILITIES_REPORT). Hosts then no longer need to run an extra process or use up slots in the command buffer to receive temperatures.


Public Sub SerialPort3D_Read()

  Dim strReceived As String

  'Small pause to allow full line to be buffered
  Sleep 0.01

  Try Read #SerialPort3D, strReceived, Lof(SerialPort3D)
  If Error Then
SerialPort3D_Read() is a Callback so should return the data that it has. Did you have a reason to include this Sleep?

Does your printer double-output everything, or only the temperature report?

I suggest you try a terminal app like "minicom" to check responses from your printer (e.g. M155 S5) before you update your firmware, as it seems unlikely (but possible) that its a printer firmware problem.
Last edited by stevedee on Monday 07th February 2022 9:59am, edited 1 time in total.

PartierSP
Posts: 51
Joined: Tuesday 30th November 2021 12:14am
Location: Canada
Contact:

Re: Bed Leveller (3D Printer Assistant)

Post by PartierSP » Wednesday 29th December 2021 7:54pm

I've included the SLEEP to allow the read buffer to capture an entire line before the code starts to parse the data. Otherwise I was trying to parse a partial temperature line and then parse the rest later. If the SLEEP starts to be unreliable, I would have to build a buffer and monitor for an end of line prior to parsing.

I originally tried WAIT but as per Gambas manual in this instance SLEEP is more appropriate as it would prevent multiple SerialPort3D_Read() events firing for a single line.

I also get the messed up temperature reading lines when I try miniterm alone. And all other data retrieved is returned properly (no duplication - even M105 looks good). So I do believe my code is retrieving the data properly, just its not being sent properly. I would say it's almost like the M155 is double triggering the temperature report within my printer its self.

Yes that Marlin page was the reason I originally went with M155. That made sense to me. And now that I've switched, I've ran into a slight issue of a race condition when the user clicks a button on the screen just at the right time that my timer is asking for a temperature reading. So for example, if my program wanted to do a home with a G28, and the timer fires requesting a M105, I have had the printer see a command like this:

Code: Select all

G2M105
8
Which as you expect, the printer sends back a big Huh???

So I need to do some traffic control prior to sending data. This may also help if the user starts to button bash, sending all kinds of messages to the printer at once.

I've checked my printer's Marlin version: Ver. 1.0.1 dated 2020-04-25

After looking on Creative's website for updates, they appear to be a bit of a mess. So like you, I've been a little hesitant on doing the update.

Post Reply