From 2417f27031471df8ae3526728e9db239df450277 Mon Sep 17 00:00:00 2001
From: su530201 <olivier.kaufmann@umons.ac.be>
Date: Sat, 5 Mar 2022 18:40:38 +0100
Subject: [PATCH] Adds a script to install a local mqtt broker

---
 install_local_mqtt_broker.sh | 6 ++++++
 ohmpi.py                     | 4 ++--
 2 files changed, 8 insertions(+), 2 deletions(-)
 create mode 100644 install_local_mqtt_broker.sh

diff --git a/install_local_mqtt_broker.sh b/install_local_mqtt_broker.sh
new file mode 100644
index 00000000..ef3c8145
--- /dev/null
+++ b/install_local_mqtt_broker.sh
@@ -0,0 +1,6 @@
+sudo apt update && sudo apt upgrade
+sudo apt install -y mosquitto mosquitto-clients
+sudo systemctl enable mosquitto.service
+echo "Broker is intalled. Starting now..."
+mosquitto -v
+ 
diff --git a/ohmpi.py b/ohmpi.py
index ae8ef7b3..330b7379 100644
--- a/ohmpi.py
+++ b/ohmpi.py
@@ -234,8 +234,8 @@ class OhmPi(object):
             with io.open('/sys/firmware/devicetree/base/model', 'r') as f:
                 if 'raspberry pi' in f.read().lower():
                     running_on_pi = True
-        except Exception as e:
-            print(e)
+        except FileNotFoundError:
+            pass
         return running_on_pi and arm64_imports
 
     def read_quad(self, filename):
-- 
GitLab