diff options
author | Nikolay Amiantov <ab@fmap.me> | 2016-02-22 02:05:24 +0300 |
---|---|---|
committer | Nikolay Amiantov <ab@fmap.me> | 2016-02-22 21:01:58 +0300 |
commit | 81032a4722f3a37c51702b76c5424f509af5c0a5 (patch) | |
tree | dd6d4709b9fa358da840dfa8df9c601158af4829 /pkgs/applications/misc/octoprint | |
parent | 2d2efceecbc364e4d114c83e8df8dc09d932d74d (diff) | |
download | nixlib-81032a4722f3a37c51702b76c5424f509af5c0a5.tar nixlib-81032a4722f3a37c51702b76c5424f509af5c0a5.tar.gz nixlib-81032a4722f3a37c51702b76c5424f509af5c0a5.tar.bz2 nixlib-81032a4722f3a37c51702b76c5424f509af5c0a5.tar.lz nixlib-81032a4722f3a37c51702b76c5424f509af5c0a5.tar.xz nixlib-81032a4722f3a37c51702b76c5424f509af5c0a5.tar.zst nixlib-81032a4722f3a37c51702b76c5424f509af5c0a5.zip |
octoprint-plugins.m3d-fio: 0.26 -> 0.27
Diffstat (limited to 'pkgs/applications/misc/octoprint')
-rw-r--r-- | pkgs/applications/misc/octoprint/0002-Try-to-create-connection-several-times-if-printer-is.patch | 57 | ||||
-rw-r--r-- | pkgs/applications/misc/octoprint/plugins.nix | 5 |
2 files changed, 2 insertions, 60 deletions
diff --git a/pkgs/applications/misc/octoprint/0002-Try-to-create-connection-several-times-if-printer-is.patch b/pkgs/applications/misc/octoprint/0002-Try-to-create-connection-several-times-if-printer-is.patch deleted file mode 100644 index 63495fd6db9c..000000000000 --- a/pkgs/applications/misc/octoprint/0002-Try-to-create-connection-several-times-if-printer-is.patch +++ /dev/null @@ -1,57 +0,0 @@ -From b99fc3fd012765c5b3d8ac7a3f64762af5121b4a Mon Sep 17 00:00:00 2001 -From: Nikolay Amiantov <ab@fmap.me> -Date: Wed, 17 Feb 2016 15:47:34 +0300 -Subject: [PATCH 2/2] Try to create connection several times if printer is not - yet available - ---- - octoprint_m3dfio/__init__.py | 25 ++++++++++++++++++++++--- - 1 file changed, 22 insertions(+), 3 deletions(-) - -diff --git a/octoprint_m3dfio/__init__.py b/octoprint_m3dfio/__init__.py -index 9f59768..e7d97eb 100644 ---- a/octoprint_m3dfio/__init__.py -+++ b/octoprint_m3dfio/__init__.py -@@ -3421,8 +3421,16 @@ class M3DFioPlugin( - # Set updated port - currentPort = self.getPort() - -- # Re-connect -- connection = serial.Serial(currentPort, currentBaudrate) -+ # Re-connect; wait for the device to be available -+ connection = None -+ for i in range(1, 5): -+ try: -+ connection = serial.Serial(currentPort, currentBaudrate) -+ break -+ except OSError: -+ time.sleep(1) -+ if connection is None: -+ raise Exception("Couldn't reconnect to the printer") - - # Check if getting EEPROM was successful - if self.getEeprom(connection) : -@@ -6799,8 +6807,19 @@ class M3DFioPlugin( - # Set state to connecting - comm_instance._log("Connecting to: " + str(port)) - -+ # Create a connection -+ connection = None -+ for i in range(1, 5): -+ try: -+ connection = serial.Serial(str(port), baudrate) -+ # If printer has just power-cycled it may not yet be ready -+ except OSError: -+ time.sleep(1) -+ if connection is None: -+ raise Exception("Couldn't reconnect to the printer") -+ - # Return connection -- return serial.Serial(str(port), baudrate) -+ return connection - - # Disable sleep - def disableSleep(self) : --- -2.7.0 - diff --git a/pkgs/applications/misc/octoprint/plugins.nix b/pkgs/applications/misc/octoprint/plugins.nix index 801be43220d9..33f4561598a2 100644 --- a/pkgs/applications/misc/octoprint/plugins.nix +++ b/pkgs/applications/misc/octoprint/plugins.nix @@ -8,18 +8,17 @@ in { m3d-fio = buildPlugin rec { name = "M3D-Fio-${version}"; - version = "0.26"; + version = "0.27"; src = fetchFromGitHub { owner = "donovan6000"; repo = "M3D-Fio"; rev = "V${version}"; - sha256 = "1dl8m0cxp2vzla2a729r3jrq5ahxkj10pygp7m9bblj5nn2s0rll"; + sha256 = "14zva61dhnsyapapw8q2qadfq5hzv5ykb7qxlz8a3x5j6wfhjn6h"; }; patches = [ ./0001-Don-t-use-static-library.patch - ./0002-Try-to-create-connection-several-times-if-printer-is.patch ]; postInstall = '' |