From a64c31c7fd69d97f333373701ec850144c9a37a1 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 31 May 2019 19:21:58 +0200 Subject: [PATCH 1/6] murex: fix for kernel panic --- murex.nix | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/murex.nix b/murex.nix index ea4df3b..e4cadaa 100644 --- a/murex.nix +++ b/murex.nix @@ -152,6 +152,18 @@ "dialout" # ttyUSB access ]; + systemd.services.ethKernelPanicFix = rec { + wantedBy = [ "networking.target" ]; + serviceConfig = { + Type = "oneshot"; + RemainAfterExit = "yes"; + }; + # https://github.com/raspberrypi/linux/issues/2449 + script = '' + ${pkgs.ethtool}/bin/ethtool -K eth0 tx-tcp-segmentation off tx-tcp6-segmentation off + ''; + }; + services.mjpg-streamer.enable = true; networking.firewall = { From a1842f265fc6848fbdd79c8bc748cc00eb49f589 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 31 May 2019 19:27:09 +0200 Subject: [PATCH 2/6] murex: enable full-hd goodness --- murex.nix | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/murex.nix b/murex.nix index e4cadaa..48601f6 100644 --- a/murex.nix +++ b/murex.nix @@ -164,7 +164,10 @@ ''; }; - services.mjpg-streamer.enable = true; + services.mjpg-streamer = { + enable = true; + inputPlugin = "input_uvc.so -r 1920x1080"; + }; networking.firewall = { enable = true; From 432bd498109c740f6c0338a70b2452d05f5bb238 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 31 May 2019 19:38:30 +0200 Subject: [PATCH 3/6] murex: fix 502 bad gateway --- murex.nix | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/murex.nix b/murex.nix index 48601f6..3806f88 100644 --- a/murex.nix +++ b/murex.nix @@ -189,6 +189,10 @@ locations."/" = { proxyPass = "http://localhost:${toString config.services.octoprint.port}"; proxyWebsockets = true; + # do not cache that octoprint is inaccessible on startup + extraConfig = '' + proxy_cache off; + ''; }; locations."/webcam/".proxyPass = "http://localhost:5050/?action=stream"; locations."/webcampic/".proxyPass = "http://localhost:5050/?action=snapshot"; From f78f549c6b67b539e94a7fcacf734b1dbb6fe545 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 31 May 2019 20:41:17 +0200 Subject: [PATCH 4/6] murex: disable full-hd again for now --- murex.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/murex.nix b/murex.nix index 3806f88..e2224ec 100644 --- a/murex.nix +++ b/murex.nix @@ -40,7 +40,7 @@ # ]; # networking.wireless.enable = true; # networking.networkmanager.enable = true; - # networking.wireless.iwd.enable = true; + networking.wireless.iwd.enable = true; fileSystems = { # "/boot" = { @@ -166,7 +166,7 @@ services.mjpg-streamer = { enable = true; - inputPlugin = "input_uvc.so -r 1920x1080"; + # inputPlugin = "input_uvc.so -r 1920x1080"; }; networking.firewall = { From 43765b9038ea3ea5dac6d6afc6cbcf6bdf94a909 Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Fri, 31 May 2019 19:08:45 +0200 Subject: [PATCH 5/6] murex: switch back to upstream kernel --- murex.nix | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/murex.nix b/murex.nix index e2224ec..d92d38a 100644 --- a/murex.nix +++ b/murex.nix @@ -13,10 +13,9 @@ uboot.enable = true; }; - # boot.kernelPackages = pkgs.linuxPackages_latest; + boot.kernelPackages = pkgs.linuxPackages_latest; # boot.kernelPackages = pkgs.linuxPackages_4_18; - # boot.kernelPackages = pkgs.linuxPackages_latest; - boot.kernelPackages = pkgs.linuxPackages_rpi; + # boot.kernelPackages = pkgs.linuxPackages_rpi; boot.kernelParams = [ "cma=32M" # for virtual console, see https://nixos.wiki/wiki/NixOS_on_ARM @@ -141,11 +140,11 @@ Type = "oneshot"; RemainAfterExit = "yes"; }; - script = '' - if echo 17 > /sys/class/gpio/export; then - echo high > /sys/class/gpio/gpio17/direction + script = let gpio = toString (458 + 17); in '' + if echo ${gpio} > /sys/class/gpio/export; then + echo high > /sys/class/gpio/gpio${gpio}/direction fi - chown octoprint:dialout /sys/class/gpio/gpio17/value + chown octoprint:dialout /sys/class/gpio/gpio${gpio}/value ''; }; users.users.${config.services.octoprint.user}.extraGroups = [ From 88c7f3c0a54cb52bc3498d5c10d112ee66d16b8e Mon Sep 17 00:00:00 2001 From: Gabriel Ebner Date: Mon, 8 Jul 2019 22:55:06 +0200 Subject: [PATCH 6/6] murex: include octoprint plugins in nixpkgs --- murex.nix | 57 +------------------------------------------------------ 1 file changed, 1 insertion(+), 56 deletions(-) diff --git a/murex.nix b/murex.nix index d92d38a..7aea3a2 100644 --- a/murex.nix +++ b/murex.nix @@ -77,62 +77,7 @@ services.octoprint = { enable = true; - plugins = plugins: with pkgs; with python2Packages; - let rpi-gpio = buildPythonPackage rec { - pname = "RPi.GPIO"; - version = "0.6.5"; - src = fetchPypi { - inherit pname version; - sha256 = "a4210ad63bfe844e43995286de0d3950dfacfa0f3799bb9392770ac54a7d2e47"; - }; - }; in - [ - # bundles binary which is not built for aarch64 :-( - # (buildPythonPackage rec { - # pname = "OctoPrint-PrintTimeGenius"; - # version = "1.3"; - # src = fetchFromGitHub { - # owner = "eyal0"; - # repo = pname; - # rev = version; - # sha256 = "1jfiih8vpd1x5yk2yq9sgi0rbjh2ipasj39vs2dmfm3va2fhy75l"; - # }; - # propagatedBuildInputs = [ octoprint ]; - # }) - (buildPythonPackage rec { - pname = "OctoPrint-TouchUI"; - version = "0.3.13"; - src = fetchFromGitHub { - owner = "BillyBlaze"; - repo = pname; - rev = version; - sha256 = "0qk12ysabdzy6cna3l4f8v3qcnppppwxxsjx2i0xn1nd0cv6yzwh"; - }; - propagatedBuildInputs = [ octoprint ]; - }) - (buildPythonPackage rec { - pname = "OctoPrint-Cost"; - version = "master"; - src = fetchFromGitHub { - owner = "jasiek"; - repo = pname; - rev = "d1dc75aa64df332d54a237864a116c63cb9e6cf5"; - sha256 = "0xkz1ygb5jspl1iy841lrv3fwm92ay09m6rw9g4vchwldqbgpjf3"; - }; - propagatedBuildInputs = [ octoprint ]; - }) - (buildPythonPackage rec { - pname = "OctoPrint-PSUControl"; - version = "0.1.8"; - src = fetchFromGitHub { - owner = "kantlivelong"; - repo = pname; - rev = version; - sha256 = "0aj38d7b7d5pzmzq841pip18cpg18wy2vrxq2nd13875597y54b8"; - }; - propagatedBuildInputs = [ octoprint rpi-gpio ]; - }) - ]; + plugins = ps: with ps; [ printtimegenius touchui psucontrol ]; }; systemd.services.setupGpioForRelais = rec { wantedBy = [ "octoprint.service" ];