mcuadros / OctoPrint-TFT

A OctoPrint touch interface for TFT touch modules based on GTK+3
GNU Affero General Public License v3.0
171 stars 81 forks source link

Screen get's stuck after few minutes in printing status menu #34

Open mrcg opened 5 years ago

mrcg commented 5 years ago

I really love the OctoPrint-TFT addon. Unfortunately i have the issue that OctoPrint-TFT get's stuck after few minutes.

The problem happens only in the printing status menu. In all other menu's the issue is not happening. That's the reason why i think it is not related to screen timeout settings.

The issue happens also in the printing status menu if printer is in idle mode (no print ongoing). After few minutes screen get's stuck (no screen updates) and it is also not possible to go back to home screen.

Would be great to get this fixed soon. Thanks for support.

ppamidimarri commented 5 years ago

I have the same issue. The screen wakes up from timeout, but is stuck in the Status screen. It won't go back, and the Stop button doesn't do anything either. The status information in the progress bar is also out of date when this happens. I am running OctoPi on a 3B+ with a Pi touchscreen and the Pi Camera module v2. The printer is a Prusa i3 MK3.

I love this UI on my Pi touchscreen, best way by far to use OctoPi when I am home!

EissaAl commented 5 years ago

same issue with OctoPi on a 3B+, printer is a Prusa i3 MK2S.

EissaAl commented 5 years ago

omg just fixed the issue by following this https://askubuntu.com/questions/476036/xset-unable-to-open-display

then this https://raspberrypi.stackexchange.com/questions/752/how-do-i-prevent-the-screen-from-going-blank

what i did to solve this problem i tried this command xset s noblank but it keeps saying xsetroot: unable to open display ':0' this mean my display is at DISPLAY=:1 so i entered export DISPLAY=:1 then xset s off # don't activate screensaver xset -dpms # disable DPMS (Energy Star) features. xset s noblank # don't blank the video device

mrcg commented 5 years ago

Hey EissaAl, i would like to be happy with you. But the issue here is a total other issue than yours. For your mentioned issue there was already solution posted in the closed topic section.

The topic here is only happening in the "printing status" menu after some time. And also the screen does not become blank.

So for the moment there seems to be no solution for this issue.

zombu2 commented 5 years ago

Same problem here after a couple minutes on printing status the display goes unresponsive and does not update

mrcg commented 5 years ago

I did tcpdump trace to find out if there is special communication issue between frontend (octoprint-api) and backand (octoprint-tft).

Octoprint-TFT got stuck after sending "GET /api/job" command which is regulary (every 5sec) triggered from source file "status.go". Usually octoprint server replies withing few ms. At the time when octoprint-tft get's stuck i realized that there was no response from octoprint server.

Because of the missing response (resulting in missing variable) the following calculation is failing ... causing octoprint-tft to get stuck ???

switch s.Progress.Completion {
    case 100:
        text = fmt.Sprintf("Job Completed in %s", time.Duration(int64(s.Job.LastPrintTime)*1e9))
    case 0:
        text = "Warming up ..."
    default:
        e := time.Duration(int64(s.Progress.PrintTime) * 1e9)
        l := time.Duration(int64(s.Progress.PrintTimeLeft) * 1e9)
        text = fmt.Sprintf("Elapsed/Left: %s / %s", e, l)
        if l == 0 {
            text = fmt.Sprintf("Elapsed: %s", e)
        }
}

I am not 100% sure but for me it looks like to be the root cause. If this is the root cause solution could be use the "completion" variable provided from the octoprint-server without resetting the variable every 5sec. By this we should be "robust" also about missing answer from octoprint-server.

Would be great to get indication from one of the developers.

mrcg commented 5 years ago

Yesterday i have reproduced the issue another two times and the failure scenario is always the same. On "GET /api/job" there is no response from the server visible abd then octoprint-tft gets stuck. I also can see that response from server can take up to 5 seconds which could also cause some issues as the polling interval in octoprint-tft is also 5 seconds.

Suggestion to solve the issue could be:

  1. Increase polling time to 10s.
  2. Add robustness to the code so that missing HTTP reply does not cause any issue. E.g. Store previous variables until the get overwritten with udpated one.
  3. Remove remaining printing time calculation and use instead the remaining printing time variable from the octoprint server response.

Unfortunately i have not much coding experience on souce code like this. Can someone help here?

mrcg commented 5 years ago

Regarding suggestion 3: I think the issue is caused by this calculations from "status.go":

e := time.Duration(int64(s.Progress.PrintTime) 1e9) l := time.Duration(int64(s.Progress.PrintTimeLeft) 1e9)

Maybe the calculation is failing because of missing update from both variables (due to missing response from server)???

mrcg commented 5 years ago

I am stopping my investigations here because i could not understand how to modify the "status.go" source. :-(

The5py commented 5 years ago

All working well in my end now the only issue keep happening to me seem to be known issues but making it not possible to use octoprint-tft: Screen get's stuck after few minutes in printing status menu (issue #34) and
Freeze while printing (issue #28) Any solution for them yet? Is there anyone it's not happening to him? Any workaround?

ppamidimarri commented 5 years ago

Thank you mrcg for your investigations. I tried to test your theory, so here are the changes I made to status.go:

        switch s.Progress.Completion {
        case 100:
//              text = fmt.Sprintf("Job Completed in %s", time.Duration(int64(s.Job.LastPrintTime)*1e9))
                text = fmt.Sprintf("Job Completed")
        case 0:
                text = "Warming up ..."
        default:
//              e := time.Duration(int64(s.Progress.PrintTime) * 1e9)
//              l := time.Duration(int64(s.Progress.PrintTimeLeft) * 1e9)
//              text = fmt.Sprintf("Elapsed/Left: %s / %s", e, l)
                text = fmt.Sprintf("Job in progress")
//              if l == 0 {
//                      text = fmt.Sprintf("Elapsed: %s", e)
//              }
        }

        m.left.Label.SetLabel(text)

Attached is the deb package that I built for Raspbian Stretch (OctoPi image) with these changes. My printer is broken right now (bed thermistor needs changing) so I can't test it right now. If you want to test it, install this file with dpkg -i and check if the problem is fixed. octoprint-tft_0.0-git04dd1f0-1_armhf.zip

mrcg commented 5 years ago

@ppamidimarri Many thanks for compiling the deb package!!! I will be able to test it earliest next week on monday. For trouble shooting it is good that you have taken out the printing time estimation completely. This should allow us to prove the concept in order to define final solution. I will report after testing on my 3d printer next week. Stay tuned!

ppamidimarri commented 5 years ago

@mrcg I fixed my printer and ran one job. I can see the new text "Job in progress" instead of the times. But unfortunately the screen got stuck around 30% into a one-hour job. So this doesn't seem to be the real issue. I will try to look further.

mrcg commented 5 years ago

@ppamidimarri Good that you have fixed your printer and have been able to test.

I think we need to modify also this:

 m.pb.SetFraction(s.Progress.Completion / 100)

Beside the calculation it would be great if you could make one deb package by only increasing the new background task time from 5 to 10 seconds. This should (hopefully) help to give more time for the reply if timeout is the real root cause:

 m.b = NewBackgroundTask(time.Second*5, m.update)

WDYT?

ppamidimarri commented 5 years ago

Yes, I changed that frequency of API call to once every 10 seconds.

m.b = NewBackgroundTask(time.Second*10, m.update)

I reverted the rest of the changes in status.go to original, except this line for clearer logic:

        default:
                e := time.Duration(int64(s.Progress.PrintTime) * 1e9)
                l := time.Duration(int64(s.Progress.PrintTimeLeft) * 1e9)
                if l == 0 {
                        text = fmt.Sprintf("Elapsed: %s", e)
                } else {
                        text = fmt.Sprintf("Elapsed/Left: %s / %s", e, l)
                }

Here is the Debian package with these changes. I will test this now. octoprint-tft_0.0_git04dd1f0-1_armhf.zip

Edit: This did not fix the problem either. The status screen got stuck 10 minutes into a 3 hours print.

mrcg commented 5 years ago

I have no access to my printer until monday. I am crossing my fingers that your tests are successful.

ppamidimarri commented 5 years ago

I tried to diagnose the problem using more log messages at the debug level in status.go in the code @mrcg highlighted. I also added this line to debian/octoprint-tft.service to see if any error messages are generated when the status panel hangs:

StandardError=journal

However I can't see any error messages using journalctl -t xinit around the time of the status panel hangs. Debug messages added to the line updating the text label show up in the journal until just before the panel hangs.

I am unable to fix the real problem. So I decided to put in a small workaround that reduces the frequency of this problem. In ui.go, there is a line that opens the status panel automatically when the printer is working on a job. I commented this out.

//                      ui.Add(StatusPanel(ui, DefaultPanel(ui)))

Attached is the deb file with this tweak. With this, the only time OctoPrint-TFT hangs is if you go into the status panel manually and leave it there. You just have to remember to back out of it to the main panel if you don't want it to hang. octoprint-tft_0.0_git04dd1f0-1_armhf.zip

Edit: I checked that after this change, if you manually enter the Status panel and leave it there while a print is going on, it will get stuck on that panel like always.

EissaAl commented 5 years ago

not only in the status panel, if you left it without connecting the printer it will freeze after some time. https://i.imgur.com/zjM0VJl.jpg

The5py commented 5 years ago

@ppamidimarri For now with the lack of fix for this bug or any solution I think your workaround is good and I am going to use it. Thought about another little nice to have to add (Maybe even to use it and not comment out automatic opening the status panel), on the event of status panel opening I suggest to invoke a timer which will get out of the status panel into the main screen automatically after a short period of time by that to help the user which forgot to get out of this screen not to get stuck in the middle of printing which is annoying...

BTW anyone knows about a command to restart the octoprint-tft process in case it is stucked already during print without the need to reboot the entire raspberry pie

mrcg commented 5 years ago

@ppamidimarri Will try your workaround but anyhow we should try to find the root cause from status.go code. Question: a) The timer increase did not solve the issue? b) Do you know if the timer change (10s) was really taking effekt to allow more time for receiving the feedback?

Another question: Is it possible to explain shortly how to create own deb package after modification of the source files? Or is this to complex to explain in few steps?

My idea would be to almost clear the status.go and then add successively one more function in order to find the guilty code.

How can we find out if missing answer from the server could cause the issues? Because - as already sayed above - in my wireshark traces on localhost i can see several times that there is not response from the server on the "GET /api/job" request.

ppamidimarri commented 5 years ago

@EissaAl, yes the Octoprint-TFT UI will stay on the splash screen unless your OctoPi is connected to your printer. See this other issue: #15. I don't understand the code or the go language enough to fix that.

ppamidimarri commented 5 years ago

@The5py, this is a good idea. I will see if I know enough to get this change done.

One way I know to get Octoprint-TFT to restart without rebooting the Pi is to install the deb package again with sudo dpkg -i. It works most of the time, but I once had the Pi stuck on a completely blank screen instead of the UI.

ppamidimarri commented 5 years ago

@mrcg, correct, the timer change doesn't solve the problem.

I know the timer change was taking effect. I confirmed that by adding in status go:

      Logger.Debug(fmt.Sprintf("Received: ", text))

just before:

      m.left.Label.SetLabel(text)

Once I had this running, I checked what the program was logging, using the command journalctl -t xinit and I noticed that it was logging a response once every 10 seconds. If I change the timer to 5 seconds, it logs a response every 5 seconds. So the change of timer is definitely happening, but it is not helping prevent the status panel getting stuck.

Here is a quick summary of how you can build your own deb packages with changes you make to the code.

  1. Create a directory on your Pi where you will make the code changes. There, clone the respository with git clone github.com/mcuadros/OctoPrint-TFT.
  2. Follow the steps listed by the original developer in the Readme file in the section "install from source". Use the command curl -fsSL get.docker.com -o get-docker.sh to get the Docker installation script. Then run the script with sh get-docker.sh. This step can take a long time. If you get errors, repeat.
  3. Now you can build the deb package with your code changes. Go to the directory where you cloned OctoPrint-TFT and in that directory, use the command make build. This will take a while. Once it is done, the deb package will be in the subdirectory build/stretch. There will be two deb files there, use the one with the shorter name, without "dbgsym" in the name.

Please note that I am really new to Debian, Raspbian, OctoPrint, Docker, Go and GitHub. The last time I did programming was 15 years ago. I learned all these steps by googling each piece. So I may not be able to help if you run into issues with the above. I highly suggest making a backup of your Pi before you start this. Also, read the output of your commands carefully, and if there are errors in one step, don't move to the next before you take care of them. Good luck!

Edit: One more thing... don't make these changes to your Pi while you are printing from OctoPi. You can do step 3 just fine while the printer is running after every set of code changes, but if you attempt step 2 while the printer is running, your print job may be adversely affected.

EissaAl commented 5 years ago

@ppamidimarri I mean even if u connect the printer it will stay in the splash screen because I didn't connect the printer for some time. same as the status panel problem.

ppamidimarri commented 5 years ago

@EissaAl Got it, sounds like there is a bigger problem somewhere that makes the application freeze when the OctoPrint server doesn't respond for a while. I am totally out of my depth now, I hope the original developer has some time to help us out!

mrcg commented 5 years ago

@ppamidimarri Based on your description i was able to compile the deb package on my own. Many thanks for this !!!!

I am trying to take out some code in order to hopefully find the guilty part. Yesterday i took out the whole "updateJob" function from status.go where i have expected the root cause for the problem .... but unfortunetely it's not the case. The issue still happened which means it's caused by some other code. Today i will take out some more code but due to the fact it's very time consuming the activitiy will be limited.

mrcg commented 5 years ago

Some GOOD NEWS !!!

After disabling the "updateTemperature" function from status.go (remove line 145) the issue did not reoccure again after about 3-4h testing. It looks very promissing that the issue is somehow caused by this code:

func (m *statusPanel) updateTemperature() {
    s, err := (&octoprint.StateRequest{Exclude: []string{"sd"}}).Do(m.UI.Printer)
    if err != nil {
        Logger.Error(err)
        return
    }

    m.doUpdateState(&s.State)

    m.tool1.Hide()
    for tool, s := range s.Temperature.Current {
        text := fmt.Sprintf("%s: %.0f°C / %.0f°C", strings.Title(tool), s.Actual, s.Target)
        switch tool {
        case "bed":
            m.bed.Label.SetLabel(text)
        case "tool0":
            m.tool0.Label.SetLabel(text)
        case "tool1":
            m.tool1.Label.SetLabel(text)
            m.tool1.Show()
        }
    }
}

I am thinking now about this two potential workaround solutions:

  1. Remove temperatur information from status screen completely because i have this information already locally available from 3d printer's LCD display.
  2. Remove the tool1 handling as both of my 3d printers have only tool0.
  3. Developer to fix the real issue in the code. ;-)
EissaAl commented 5 years ago

@mrcg how I can modify the code? sudo nano then what is the location of the file

ppamidimarri commented 5 years ago

@mrcg Excellent progress! Removing updateTemperature is a no-brainer for me. I never look at that when I want to know how hot my printer is, I look at the printer's LCD screen.

I will look into this more tonight and try to test it with several print jobs.

The5py commented 5 years ago

@mrcg - It works great! I remaked as well- updateTemperature on line 145 compiled it and it is up and running for some short prints nothing getting stuck for the moment

Great workaround for now! I think checking it with only removing the second hotend (tool1 and leave tool0) is a good path to try investigate.

Now looking for a solution or workaround for #18 @mrcg & @ppamidimarri does the temperature profiles works good for you?

EissaAl commented 5 years ago

Can anyone tell me where is that file?

The5py commented 5 years ago

OctoPrint-TFT/ui/status.go

EissaAl commented 5 years ago

@The5py thank you and thanks to @ppamidimarri for explaining how to build deb packages :D

ppamidimarri commented 5 years ago

@The5py I don't use that feature because I slice on my computer. That issue #18 is definitely a bug in OctoPrint's web interface which seems to store some values as ints and some as strings.

mrcg commented 5 years ago

Hi all, removing tool1 from status.go completely did not solve the issue ... unfortunately. So i think the issue is caused from the 1st section of the updateTemperature function:

    s, err := (&octoprint.StateRequest{Exclude: []string{"sd"}}).Do(m.UI.Printer)
    if err != nil {
        Logger.Error(err)
        return
    }

    m.doUpdateState(&s.State)

One of my next change will be as discussed in this forum: https://stackoverflow.com/questions/25356602/golang-panic-crash-prevention

Unfortunately i was not able until now to do this change successfully without compiling error afterwards. Currently i have ongoing print and cannot proceed in testing new code.

I think the exclude string command could cause the issue because it's not used in any other variable update process. To change/remove this part will be last idea after pending panic crash prenvention. If this does not point to the root cause i will remove the temp update completely (including the icons) from status.go code.

ppamidimarri commented 5 years ago

@mrcg I removed the temperature display from status.go in createMainBox() by commenting out grid.Add(m.createTemperatureBox()) and then commenting out all calls to defer m.updateTemperature() (they occur in createPrintButton(), createPauseButton() and createStopButton()) in addition to commenting out the call in update() to m.updateTemperature().

I reverted my old workaround in ui.go of not adding the status panel automatically.

With these changes, the UI doesn't show the temperatures at all so it looks clean, and the status screen doesn't seem to hang. I am three hours into a four hour print and my OctoPrint-TFT status screen has been up all this while and it is still updating the elapsed and left times. I will test this some more with other prints.

Thank you for finding a really great workaround for this problem that almost had me uninstalling OctoPrint-TFT!

EissaAl commented 5 years ago

@mrcg @ppamidimarri the problem if u reconnect the printer it will stay in the splash screen after not connecting the printer for some time is not fixed by deleting "updateTemperature" function from status.go (line 145) but everything else is fixed.

mrcg commented 5 years ago

Yes, correct. This correction here is only fixing the issue from the printing status menu (status.go).

As workaround solultion the following lines have been removed from status.go (v0.1.2) in order to prevent OctoPrint-TFT to crash after some time in printing status menu. The workaround removes also the temperature status from bed, tool0 and tool1:

( 59) grid.Add(m.createTemperatureBox())
(103) defer m.updateTemperature()
(117) defer m.updateTemperature()
(132) defer m.updateTemperature()
(145) m.updateTemperature()

Attached the compiled deb packages with the changes mentioned above. Installation of the deb packages like this:

sudo dpkg -i octoprint-tft_v0.1.2_#34-fix_stretch.deb
or
sudo dpkg -i octoprint-tft_v0.1.2_#34-fix_jessie.deb

octoprint-tftv0.1.2#34-fix_stretch.zip

octoprint-tftv0.1.2#34-fix_jessie.zip

ppamidimarri commented 5 years ago

@mrcg I have tested the fix with several jobs over the last day, including a 12 hour job. The problem with status screen hanging is completely solved with your fix. Thanks again for your persistence! As an idea to better use the screen real estate now available with the temperature display gone, here is the change I made to show the elapsed and left times separately, along with the ETA (which adds current time + left time) to show when your current job will finish. Here is the code I changed in the updateJob() function within status.go, starting on line 226:

        default:
                e := time.Duration(int64(s.Progress.PrintTime) * 1e9)
                l := time.Duration(int64(s.Progress.PrintTimeLeft) * 1e9)
                eta := time.Now().Add(l).Format("Mon Jan 2, 3:04 PM")
                if l == 0 {
                        text = fmt.Sprintf("Elapsed: %s", e)
                } else {
                        text = fmt.Sprintf("Elapsed: %s | Left: %s | ETA: %s", e, l, eta)
                }

I also changed the function filenameEllipsis() starting at line 241:

        if len(name) > 46 {
                return name[:43] + "..."
        }
ppamidimarri commented 5 years ago

@EissaAl It looks like there is a logging call made in the code in ui.go that verifies the connection state every 5 seconds. Next time you see this problem, please do this:

  1. SSH into your OctoPi
  2. Run the command journalctl -t xinit | grep go
  3. In the output see what the last couple of lines say and may be post it here

This may help one of us diagnose and attempt to fix what is going on.

EissaAl commented 5 years ago

@ppamidimarri journalctl -t xinit | grep go Aug 28 19:56:23 octopi xinit[611]: Kernel command line: 8250.nr_uarts=1 bcm2708_ fb.fbwidth=640 bcm2708_fb.fbheight=480 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec 00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 console=ttyS 0,115200 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait consoleb lank=0 fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo Aug 28 19:56:29 octopi xinit[611]: time="2018-08-28T19:56:29Z" level=info msg="O ctoPrint's config file found: \"/home/pi/.octoprint/config.yaml\"" file=main.go func=main.readConfig line=98 Aug 28 19:56:29 octopi xinit[611]: time="2018-08-28T19:56:29Z" level=info msg="U sing \"http://localhost:5000\" as server address" file=main.go func=main.init.0 line=47 Aug 28 19:56:29 octopi xinit[611]: time="2018-08-28T19:56:29Z" level=info msg="F ound API key at \"/home/pi/.octoprint/config.yaml\" file" file=main.go func=main .init.0 line=55 Aug 28 19:56:30 octopi xinit[611]: time="2018-08-28T19:56:30Z" level=debug msg=" New background task started" file=common.go func="ui.(*BackgroundTask).Start" li ne=109 Aug 28 19:56:30 octopi xinit[611]: time="2018-08-28T19:56:30Z" level=debug msg=" Unexpected error: Get http://localhost:5000/api/connection: net/http: HTTP/1.x t ransport connection broken: malformed MIME header line: Not found" file=ui.go fu nc="ui.(*UI).verifyConnection" line=110 Aug 28 19:56:35 octopi xinit[611]: time="2018-08-28T19:56:35Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 28 19:56:41 octopi xinit[611]: time="2018-08-28T19:56:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:56:56 octopi xinit[611]: time="2018-08-28T19:56:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:01 octopi xinit[611]: time="2018-08-28T19:57:01Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:06 octopi xinit[611]: time="2018-08-28T19:57:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:11 octopi xinit[611]: time="2018-08-28T19:57:11Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:16 octopi xinit[611]: time="2018-08-28T19:57:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:21 octopi xinit[611]: time="2018-08-28T19:57:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:26 octopi xinit[611]: time="2018-08-28T19:57:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:31 octopi xinit[611]: time="2018-08-28T19:57:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:36 octopi xinit[611]: time="2018-08-28T19:57:36Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 28 19:57:41 octopi xinit[611]: time="2018-08-28T19:57:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:46 octopi xinit[611]: time="2018-08-28T19:57:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:51 octopi xinit[611]: time="2018-08-28T19:57:51Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:57:56 octopi xinit[611]: time="2018-08-28T19:57:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:58:01 octopi xinit[611]: time="2018-08-28T19:58:01Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:58:06 octopi xinit[611]: time="2018-08-28T19:58:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:58:11 octopi xinit[611]: time="2018-08-28T19:58:11Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:58:16 octopi xinit[611]: time="2018-08-28T19:58:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:58:21 octopi xinit[611]: time="2018-08-28T19:58:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:58:26 octopi xinit[611]: time="2018-08-28T19:58:26Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 28 19:58:31 octopi xinit[611]: time="2018-08-28T19:58:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 28 19:58:36 octopi xinit[611]: time="2018-08-28T19:58:36Z" level=info msg="P rinter is ready" file=ui.go func="ui.(*UI).verifyConnection" line=119 Aug 28 19:58:40 octopi xinit[611]: time="2018-08-28T19:58:40Z" level=debug msg=" New background task started" file=common.go func="ui.(*BackgroundTask).Start" li ne=109 Aug 29 02:09:53 octopi xinit[611]: time="2018-08-29T02:09:53Z" level=debug msg=" Background task closed" file=common.go func="ui.(*BackgroundTask).loop" line=136 Aug 29 02:10:11 octopi xinit[611]: time="2018-08-29T02:10:11Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:10:16 octopi xinit[611]: time="2018-08-29T02:10:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:21 octopi xinit[611]: time="2018-08-29T02:10:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:26 octopi xinit[611]: time="2018-08-29T02:10:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:31 octopi xinit[611]: time="2018-08-29T02:10:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:36 octopi xinit[611]: time="2018-08-29T02:10:36Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:41 octopi xinit[611]: time="2018-08-29T02:10:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:46 octopi xinit[611]: time="2018-08-29T02:10:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:51 octopi xinit[611]: time="2018-08-29T02:10:51Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:10:56 octopi xinit[611]: time="2018-08-29T02:10:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:01 octopi xinit[611]: time="2018-08-29T02:11:01Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:11:06 octopi xinit[611]: time="2018-08-29T02:11:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:11 octopi xinit[611]: time="2018-08-29T02:11:11Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:16 octopi xinit[611]: time="2018-08-29T02:11:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:21 octopi xinit[611]: time="2018-08-29T02:11:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:26 octopi xinit[611]: time="2018-08-29T02:11:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:31 octopi xinit[611]: time="2018-08-29T02:11:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:36 octopi xinit[611]: time="2018-08-29T02:11:36Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:41 octopi xinit[611]: time="2018-08-29T02:11:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:46 octopi xinit[611]: time="2018-08-29T02:11:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:11:51 octopi xinit[611]: time="2018-08-29T02:11:51Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:11:56 octopi xinit[611]: time="2018-08-29T02:11:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:01 octopi xinit[611]: time="2018-08-29T02:12:01Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:06 octopi xinit[611]: time="2018-08-29T02:12:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:11 octopi xinit[611]: time="2018-08-29T02:12:11Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:16 octopi xinit[611]: time="2018-08-29T02:12:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:21 octopi xinit[611]: time="2018-08-29T02:12:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:26 octopi xinit[611]: time="2018-08-29T02:12:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:31 octopi xinit[611]: time="2018-08-29T02:12:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:36 octopi xinit[611]: time="2018-08-29T02:12:36Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:41 octopi xinit[611]: time="2018-08-29T02:12:41Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:12:46 octopi xinit[611]: time="2018-08-29T02:12:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:51 octopi xinit[611]: time="2018-08-29T02:12:51Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:12:56 octopi xinit[611]: time="2018-08-29T02:12:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:01 octopi xinit[611]: time="2018-08-29T02:13:01Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:06 octopi xinit[611]: time="2018-08-29T02:13:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:11 octopi xinit[611]: time="2018-08-29T02:13:11Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:16 octopi xinit[611]: time="2018-08-29T02:13:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:21 octopi xinit[611]: time="2018-08-29T02:13:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:26 octopi xinit[611]: time="2018-08-29T02:13:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:31 octopi xinit[611]: time="2018-08-29T02:13:31Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:13:36 octopi xinit[611]: time="2018-08-29T02:13:36Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:41 octopi xinit[611]: time="2018-08-29T02:13:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:46 octopi xinit[611]: time="2018-08-29T02:13:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:51 octopi xinit[611]: time="2018-08-29T02:13:51Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:13:56 octopi xinit[611]: time="2018-08-29T02:13:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:01 octopi xinit[611]: time="2018-08-29T02:14:01Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:06 octopi xinit[611]: time="2018-08-29T02:14:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:11 octopi xinit[611]: time="2018-08-29T02:14:11Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:16 octopi xinit[611]: time="2018-08-29T02:14:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:21 octopi xinit[611]: time="2018-08-29T02:14:21Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:14:26 octopi xinit[611]: time="2018-08-29T02:14:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:31 octopi xinit[611]: time="2018-08-29T02:14:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:36 octopi xinit[611]: time="2018-08-29T02:14:36Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:41 octopi xinit[611]: time="2018-08-29T02:14:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:46 octopi xinit[611]: time="2018-08-29T02:14:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:51 octopi xinit[611]: time="2018-08-29T02:14:51Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:14:56 octopi xinit[611]: time="2018-08-29T02:14:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:01 octopi xinit[611]: time="2018-08-29T02:15:01Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:06 octopi xinit[611]: time="2018-08-29T02:15:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:11 octopi xinit[611]: time="2018-08-29T02:15:11Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:15:16 octopi xinit[611]: time="2018-08-29T02:15:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:21 octopi xinit[611]: time="2018-08-29T02:15:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:26 octopi xinit[611]: time="2018-08-29T02:15:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:31 octopi xinit[611]: time="2018-08-29T02:15:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:36 octopi xinit[611]: time="2018-08-29T02:15:36Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:41 octopi xinit[611]: time="2018-08-29T02:15:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:46 octopi xinit[611]: time="2018-08-29T02:15:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:51 octopi xinit[611]: time="2018-08-29T02:15:51Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:15:56 octopi xinit[611]: time="2018-08-29T02:15:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:01 octopi xinit[611]: time="2018-08-29T02:16:01Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:16:06 octopi xinit[611]: time="2018-08-29T02:16:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:11 octopi xinit[611]: time="2018-08-29T02:16:11Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:16 octopi xinit[611]: time="2018-08-29T02:16:16Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:21 octopi xinit[611]: time="2018-08-29T02:16:21Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:26 octopi xinit[611]: time="2018-08-29T02:16:26Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:31 octopi xinit[611]: time="2018-08-29T02:16:31Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:36 octopi xinit[611]: time="2018-08-29T02:16:36Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:41 octopi xinit[611]: time="2018-08-29T02:16:41Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:46 octopi xinit[611]: time="2018-08-29T02:16:46Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:16:51 octopi xinit[611]: time="2018-08-29T02:16:51Z" level=info msg="C onnection offline, connecting: Closed" file=ui.go func="ui.(*UI).verifyConnectio n" line=132 Aug 29 02:16:56 octopi xinit[611]: time="2018-08-29T02:16:56Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:17:01 octopi xinit[611]: time="2018-08-29T02:17:01Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137 Aug 29 02:17:06 octopi xinit[611]: time="2018-08-29T02:17:06Z" level=info msg="W aiting for connection: Detecting baudrate" file=ui.go func="ui.(*UI).verifyConne ction" line=137

ppamidimarri commented 5 years ago

@EissaAl Thanks for posting this. Looks like no error is getting logged when the thing just freezes. It is checking every five seconds for a connection, and then it just stops doing that. Not clear to me what the issue is.

mrcg commented 5 years ago

@ppamidimarri To extend the filename lenght is a really great addition. I will add this also to my installation later on. Many thanks again for the good cooperation!

mrcg commented 5 years ago

Just one more comment. The "Heat Up" menu (temperature.go) contains exactly the same temperature information than the printing status menu (status.go). While the temperature update function in status.go is sporadically crashing the function in the temperature.go does not have this problem.

Final solution would be to implement the temperature update code from temperature.go into status.go. The method in updating the temperature information is done in different way. Unfortunately i was not able to understand the go language in a way to do this change.

This would be the final solution.

mcuadros commented 5 years ago

Hey everyone, sorry for the lack of answers about this project, but I am really busy with a bunch of other stuff, plus I didn't use octoprint-tft myself, since was created for being used in a printer I was making but I didn't finish it.

These days, I got a new 3d printer a HicTop Duale3 and it comes with the standard LCD screen, so looks like I am going to back to this project in the coming weeks.

I will try to solve this problem ASAP.

BTW I will love to get some pictures of the people using this project.

mrcg commented 5 years ago

That's really great new's that you proceed to work on this awesome project. :-)

EissaAl commented 5 years ago

My OctoPrint-TFT Setup :) https://i.imgur.com/1MFcJKE.jpg https://i.imgur.com/onakkzB.jpg https://i.imgur.com/krlG849.jpg https://i.imgur.com/JdgY2yT.jpg

Crowlord commented 5 years ago

Does

Yes, correct. This correction here is only fixing the issue from the printing status menu (status.go).

As workaround solultion the following lines have been removed from status.go (v0.1.2) in order to prevent OctoPrint-TFT to crash after some time in printing status menu. The workaround removes also the temperature status from bed, tool0 and tool1:

( 59) grid.Add(m.createTemperatureBox())
(103) defer m.updateTemperature()
(117) defer m.updateTemperature()
(132) defer m.updateTemperature()
(145) m.updateTemperature()

Attached the compiled deb packages with the changes mentioned above. Installation of the deb packages like this:

sudo dpkg -i octoprint-tft_v0.1.2_#34-fix_stretch.deb
or
sudo dpkg -i octoprint-tft_v0.1.2_#34-fix_jessie.deb

octoprint-tftv0.1.2#34-fix_stretch.zip

octoprint-tftv0.1.2#34-fix_jessie.zip

does this compiled code include the TFT fix or am I breaking it again by fixing this bug?

I love this app but am about ready to bin my screen altogether as I seem to need to learn programming to get it running :(

ppamidimarri commented 5 years ago

Does

Yes, correct. This correction here is only fixing the issue from the printing status menu (status.go). As workaround solultion the following lines have been removed from status.go (v0.1.2) in order to prevent OctoPrint-TFT to crash after some time in printing status menu. The workaround removes also the temperature status from bed, tool0 and tool1:

( 59) grid.Add(m.createTemperatureBox())
(103) defer m.updateTemperature()
(117) defer m.updateTemperature()
(132) defer m.updateTemperature()
(145) m.updateTemperature()

Attached the compiled deb packages with the changes mentioned above. Installation of the deb packages like this:

sudo dpkg -i octoprint-tft_v0.1.2_#34-fix_stretch.deb
or
sudo dpkg -i octoprint-tft_v0.1.2_#34-fix_jessie.deb

octoprint-tftv0.1.2#34-fix_stretch.zip octoprint-tftv0.1.2#34-fix_jessie.zip

does this compiled code include the TFT fix or am I breaking it again by fixing this bug?

I love this app but am about ready to bin my screen altogether as I seem to need to learn programming to get it running :(

I think @mrcg's files include the fix, so they should just work without any more changes to be made by you.

Crowlord commented 5 years ago

I can confirm its working great now.

I apologise for the salt. It was a very frustrating install!