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

Constantly throwing connection errors. #371

Closed
mikekscholz opened this issue Jan 13, 2020 · 5 comments · Fixed by #378
Closed

Constantly throwing connection errors. #371

mikekscholz opened this issue Jan 13, 2020 · 5 comments · Fixed by #378
Assignees
Labels
bug Something isn't working
Projects

Comments

@mikekscholz
Copy link

Describe the bug
I use PSU control and switch my printers mainboard through octoprint. I have a custom version of portlister installed with 0 second lag time so the instant marlin receives power octoprint starts connecting, which immediately causes marlin to reboot which is normal behavior. I modified the typescript for the standby module so that when you press the screen to wake, it sends the PSU on command which is working perfectly, but its throwing error messages before its even had 3 seconds for marlin to finish booting. Also as an aside, if I open octoprint from my laptop and click to power on the power supply, I still get a 409 error that pops up on top of the standby screen. then once its properly connected and the main screen is properly showing live data I usually get 2 more error popups that I need to clear before they stop. Im kind of at my limit for typescript syntax and free time is scarce for learning a new language at the moment, but is there any way to get octodash to chill out for like 10 seconds when a connect command is issued?

Here is the relevant section of code of my standby mods:

import { Component, OnInit } from '@angular/core';
import { ConfigService } from '../config/config.service';
import { Subscription } from 'rxjs';
import { HttpClient, HttpErrorResponse } from '@angular/common/http';
import { Router } from '@angular/router';
import { AppService } from '../app.service';
import { PsuControlService } from '../plugin-service/psu-control.service';

@Component({
  selector: 'app-standby',
  templateUrl: './standby.component.html',
  styleUrls: ['./standby.component.scss']
})
export class StandbyComponent implements OnInit {

  connecting = false;
  error = '';
  httpPOSTRequest: Subscription;

  constructor(
    private configService: ConfigService,
    private http: HttpClient,
    private router: Router,
    private service: AppService,
    private psuControlService: PsuControlService) { }

  ngOnInit() {
    if (this.configService.getAutomaticScreenSleep()) {
      setTimeout(this.service.turnDisplayOff.bind(this.service), 300000);
    }
  }

  reconnect() {
    this.connecting = true;
    this.psuControlService.changePSUState(true);
    if (this.httpPOSTRequest) {
      this.httpPOSTRequest.unsubscribe();
    }

General Information:

  • Hardware: Pi 3b+ connected to 1024x600 hdmi capacitive touch screen
  • OS Info: OctoPrint 1.3.12 running on OctoPi 0.17.0
  • OctoDash: selfbuilt from master branch with and without the above mods as well as 1.3.3 official release.
@mikekscholz mikekscholz added the bug Something isn't working label Jan 13, 2020
@UnchartedBull
Copy link
Owner

This is related to #214. Standby currently just omits all errors, but once you tap the screen they will be shown again. Ideal would be, that everything just shuts down until you restart. I'll have a look, whether there is a quick and dirty way to handle this, until I have time to do it properly.

@UnchartedBull
Copy link
Owner

I've included the PSUControl in the main code. With the next version you should be able to specify this via the config. Also the notifications are now suppressed for the first 4 seconds after connection, which should hopefully fix the spam :) Still needs some testing though ...

@UnchartedBull UnchartedBull added this to To do in v2 Release via automation Jan 22, 2020
@UnchartedBull UnchartedBull moved this from To do to In progress in v2 Release Jan 22, 2020
@mikekscholz
Copy link
Author

I figured adding a config parameter to enable this would be the way to go but I had only gotten about halfway to figuring out how to go about it after learning how to include it properly in the first place. Ill do a pull and rebuild and give her a go once I get out of the office for the day.

@UnchartedBull
Copy link
Owner

The stuff with the errors being thrown during connection is fixed now. The config parameter will currently only return false until the update with the new config is merged. So you could either change that line in the config service or wait until the release and stay on your build for now . :)

v2 Release automation moved this from In progress to Done Jan 22, 2020
@mikekscholz
Copy link
Author

This did the trick :) Did a build with the config param changed to return true and everything works as I would expect now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
No open projects
v2 Release
  
Done
Development

Successfully merging a pull request may close this issue.

2 participants