Git Product home page Git Product logo

octoprint-networkhealth's Introduction

OctoPrint-NetworkHealth

GitHub top language GitHub last commit License

Monitors the health of the OctoPrint Network connection and restarts it if necessary

Configuration

By default the ip command used to restart the network interfaces requires sudo permissions.

To allow OctoPrint to manage this for us, we need to update sudoers using the below command:

echo 'pi ALL=NOPASSWD:/sbin/ip' | sudo tee /etc/sudoers.d/octoprint-ip

If your system does not have ip installed, you can install it via apt:

apt-get install iproute2

Setup

Install via the bundled Plugin Manager or manually using this URL:

https://github.com/jonfairbanks/OctoPrint-NetworkHealth/archive/master.zip

octoprint-networkhealth's People

Contributors

jonfairbanks avatar kantlivelong avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

kantlivelong

octoprint-networkhealth's Issues

Network Health not running

I have installed via plugin manager, and run the configuration command however the network health plugin does not appear to function. I have checkd my logs and find the following:

2021-05-08 07:23:08,260 - octoprint.plugins.networkhealth - ERROR - Could not run network health check
Traceback (most recent call last):
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_NetworkHealth/init.py", line 18, in _check_network
if not self.check_ping():
File "/home/pi/oprint/lib/python3.7/site-packages/octoprint_NetworkHealth/init.py", line 54, in check_ping
response = os.system("ping -c 4 " + hostname)
TypeError: can only concatenate str (not "NoneType") to str

and it just keeps looping.
Any suggestions?

Few issues

Hello,

(This was made as of bee1bd9)

Just was poking at this plugin and wanted give you a heads up on a few things:

  • Your current release version 1.0.0 doesn't run on OctoPrint and will never receive updates. You might want to push 1.0.1 or retag 1.0.0 to a newer working commit
  • While not explicitly required you should move these into the NetworkHealthPlugin class.
  • Finally, while it may not be logged; changes made via the ip command require root privileges. So as it stands when those commands are run they do not actually do anything. In order for this to work the plugin would need elevated privileges via sudo. By default on OctoPi the pi user does not have sudo rights to the ip command so the user would need to manually configure that. Take a look at /etc/sudoers and /etc/sudoers.d Example ip command error below:
pi@octopi:~ $ ip link set eth0 down
RTNETLINK answers: Operation not permitted

Looping Update

Looks like the metadata for this plugin is still 1.0.0 so even though installed or updated to 1.0.2, it's constantly asking to install an update.

Network Health plugin is causing permanent high load while enabled

I was having issues with my Pi overheating and I just dove into the cause. Turns out the Pi (a 3B+) had a permanent load of 2.5 when idle. Turning on safe mode resolved that issue so I looked into my plugins. I uninstalled one of the non-stock plugins that I was using but it didn't fix anything, so I only had the Network Health plugin left to check, and sure enough, disabling it gave me normal load levels.

This was before I turned off the Network Health plugin:
image

This was after:
image

Literally the only difference between the two is whether or not Network Health is enabled.

I should probably add that I did properly install the plugin including the sudoers configuation, unless there is more to it than the readme suggests.

Pi still disappearing from network

I've used this plugin for quite a while, and was very happy with it until recently. The Pi exhibits it's old behavior, which is that it disappears from my network from time to time. It still seems functional, as prints continue to completion, I'm just unable to see the web interface or connect with PuTTY.

I don't know if there's a configuration problem since an OctoPi reinstall a ways back, or if there's some other issue. I'll be happy to provide whatever information I can to help diagnose. I am able to put a screen/keyboard on my Pi, although I don't have it set up that way at the moment.

Package Requirements for OctoPi distribution

Users of OctoPi image will need to install the iproute2 package for this to work. it contains the 'ip' command required for this plugin to work.

Command to install:
apt install iproute2

Error when attempting reconnect

I think this is due to the fact that your command is the username pi which is not my username but I would like some confirmation.

Jan 3 10:48:35 octopi octoprint[417]: #033[31m2024-01-03 10:48:35,598 - octoprint.plugins.networkhealth - ERROR - No Network Connection - Resetting Adapter(s)...#033[0m
Jan 3 10:48:35 octopi octoprint[25163]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper Jan 3 10:48:35 octopi octoprint[25163]: sudo: a password is required
Jan 3 10:48:35 octopi octoprint[25164]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper Jan 3 10:48:35 octopi octoprint[25164]: sudo: a password is required Jan 3 10:48:35 octopi octoprint[25166]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper Jan 3 10:48:35 octopi octoprint[25166]: sudo: a password is required
Jan 3 10:48:35 octopi octoprint[25167]: sudo: a terminal is required to read the password; either use the -S option to read from standard input or configure an askpass helper Jan 3 10:48:35 octopi octoprint[25167]: sudo: a password is required

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.