From 5ec999afcbb3be83103965e26cbc2beeb9dd5781 Mon Sep 17 00:00:00 2001 From: su530201 <olivier.kaufmann@umons.ac.be> Date: Thu, 27 Oct 2022 23:35:17 +0200 Subject: [PATCH] Fixes error in requirements.txt. Adds node-red test_ohmpi_flow --- .gitignore | 1 + mqtt_controller.py | 4 ++-- requirements.txt | 4 ++-- test_ohmpi_flow.json | 48 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 53 insertions(+), 4 deletions(-) create mode 100644 test_ohmpi_flow.json diff --git a/.gitignore b/.gitignore index d70443a7..e1648cde 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +.idea/* data/* **/.ipynb_notebooks/** data.zip diff --git a/mqtt_controller.py b/mqtt_controller.py index dd2e6a5c..9a39941c 100644 --- a/mqtt_controller.py +++ b/mqtt_controller.py @@ -1,12 +1,12 @@ import json -import paho.mqtt.client as mqtt +import paho.mqtt.client as mqtt_client import paho.mqtt.publish as publish from config import MQTT_CONTROL_CONFIG, OHMPI_CONFIG import time import uuid -client = mqtt.Client(f'ohmpi_{OHMPI_CONFIG["id"]}_controller', clean_session=False) # create new instance +client = mqtt_client.Client(f'ohmpi_{OHMPI_CONFIG["id"]}_controller', clean_session=False) # create new instance print('connecting controller to broker') client.connect(MQTT_CONTROL_CONFIG['hostname']) client.loop_start() diff --git a/requirements.txt b/requirements.txt index a4fa7862..63b85440 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,10 +2,10 @@ RPi.GPIO adafruit-blinka numpy paho-mqtt -adafruit-circuitpython-adsgit 1x15 +adafruit-circuitpython-ads1x15 adafruit-circuitpython-tca9548a adafruit-circuitpython-mcp230xx gpiozero termcolor pandas -pyzmq \ No newline at end of file +pyzmq diff --git a/test_ohmpi_flow.json b/test_ohmpi_flow.json new file mode 100644 index 00000000..7b14f113 --- /dev/null +++ b/test_ohmpi_flow.json @@ -0,0 +1,48 @@ +[ + { + "id": "4f3a554c97d05d5a", + "type": "ui_button", + "z": "83bcb023749d85ff", + "name": "", + "group": "142ad6ae.d55e29", + "order": 0, + "width": "2", + "height": "1", + "passthru": false, + "label": "set_sequence", + "tooltip": "", + "color": "", + "bgcolor": "green", + "className": "", + "icon": "", + "payload": "{\"cmd_id\":\"\",\"cmd\":\"set_sequence\",\"args\":\"5 6 7 8\\n10 11 12 13\"}", + "payloadType": "str", + "topic": "topic", + "topicType": "msg", + "x": 560, + "y": 500, + "wires": [ + [ + "689423767506a28c" + ] + ] + }, + { + "id": "142ad6ae.d55e29", + "type": "ui_group", + "name": "Buttons", + "tab": "5d888f29.07334", + "order": 3, + "disp": true, + "width": "6", + "collapse": false + }, + { + "id": "5d888f29.07334", + "type": "ui_tab", + "name": "Home", + "icon": "dashboard", + "disabled": false, + "hidden": false + } +] -- GitLab