From f50d9d28ab1d3e23d51ea8afb0dfeac81efa1d1c Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Sat, 26 Aug 2023 13:54:54 +1000
Subject: [PATCH 01/11] Create temp_sensor.py
---
wireless_modules_py/sensors/temp_sensor.py | 29 ++++++++++++++++++++++
1 file changed, 29 insertions(+)
create mode 100644 wireless_modules_py/sensors/temp_sensor.py
diff --git a/wireless_modules_py/sensors/temp_sensor.py b/wireless_modules_py/sensors/temp_sensor.py
new file mode 100644
index 00000000..d24eb6f9
--- /dev/null
+++ b/wireless_modules_py/sensors/temp_sensor.py
@@ -0,0 +1,29 @@
+import pigpio
+import time
+pi=pigpio.pi()
+def dht22(pin):
+ global pi
+ pi.setmode(pin,pigpio.INPUT)
+ pi.set_pull_up_down(pin, pigpio.PUD_UP)
+ data = []
+ last_state = 1
+ bits = []
+ try:
+ while True:
+ current_state = pi.read(pin)
+ bits.append(1 if current_state == 1 and last_state == 0 else 0)
+ last_state = current_state
+ if len(bits) == 40:
+ break
+ for i in range(0, len(bits), 8):
+ byte = bits[i:i+8]
+ data.append(int(''.join([str(bit) for bit in byte]), 2))
+ humidity = data[0] + data[1]/float(10)
+ temperature = (data[2] & 0x7f) + data[3]/float(10)
+ if data[2] & 0x80:
+ temperature *= -1
+ return (humidity, temperature)
+ except KeyboardInterrupt:
+ pass
+ finally:
+ pi.cleanup()
From 9b31c2bc8e8be99b8f9c8db80a8585206048decb Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Fri, 6 Oct 2023 13:09:05 +1100
Subject: [PATCH 02/11] draft 1
---
.../sensors/new_temp_sensor.py | 20 ++
wireless_modules_py/temp_module/README.md | 41 ++++
.../temp_module/config.example.py | 6 +
wireless_modules_py/temp_module/main.py | 18 ++
wireless_modules_py/temp_module/poetry.lock | 175 ++++++++++++++++++
.../temp_module/pyproject.toml | 18 ++
6 files changed, 278 insertions(+)
create mode 100644 wireless_modules_py/sensors/new_temp_sensor.py
create mode 100644 wireless_modules_py/temp_module/README.md
create mode 100644 wireless_modules_py/temp_module/config.example.py
create mode 100644 wireless_modules_py/temp_module/main.py
create mode 100644 wireless_modules_py/temp_module/poetry.lock
create mode 100644 wireless_modules_py/temp_module/pyproject.toml
diff --git a/wireless_modules_py/sensors/new_temp_sensor.py b/wireless_modules_py/sensors/new_temp_sensor.py
new file mode 100644
index 00000000..162b41dc
--- /dev/null
+++ b/wireless_modules_py/sensors/new_temp_sensor.py
@@ -0,0 +1,20 @@
+from sensor_base import Sensor
+import serial
+import time
+import Adafruit_DHT as dht
+class Temp_sensor(Sensor):
+ def __init__(self, port):
+ """
+ Initialise the anemometer to read wind direction and wind speed data.
+ :param port: The serial port that the anemometer is connected to.
+ """
+ self.baudrate = 19200
+ self.sensor = serial.Serial(port, self.baudrate)
+
+ self.readings = []
+
+ self.query_time = 0
+ self.MS_TO_SEC = 1/1000
+ self.NS_TO_MS = 1000000
+ def read(self):
+ self.sensor()
\ No newline at end of file
diff --git a/wireless_modules_py/temp_module/README.md b/wireless_modules_py/temp_module/README.md
new file mode 100644
index 00000000..3affb3a5
--- /dev/null
+++ b/wireless_modules_py/temp_module/README.md
@@ -0,0 +1,41 @@
+# Wind Module
+This directory contains the scripts to collect wind speed and direction data from the anemometer, and publish these data to the MQTT broker under the topic `/v3/wireless_module/5/data`.
+
+- [Wind Module](#wind-module)
+ - [Basic Setup and Usage](#basic-setup-and-usage)
+ - [Testing](#testing)
+
+## Basic Setup and Usage
+1. Install the [Vaisala USB Instrument Finder driver](https://go.vaisala.com/software/WXT530/Vaisala_WXT530_Configuration_Tool_Weather_Measurement.zip?_ga=2.138439603.1803271655.1674458831-1555859295.1674458831) using these [installation instructions](https://docs.vaisala.com/r/M211840EN-F/en-US/GUID-6D206CCD-21E9-4E9A-98C9-760C90EA90BF/GUID-AE6CDFA9-16A5-4E47-B354-37C04534C558).
+
+2. Connect the anemometer to your computer and note down which port it is connecting to.
+
+3. In the `wind_module` directory, create a local version of `config.py` using the `config.example.py` file.
+
+4. Get inside the `wind_module` directory using:
+ ```
+ cd wireless_mdoules_py/wind_module
+ ```
+
+5. Ensuring that you have [poetry](https://python-poetry.org/) installed, spawn into the poetry environment using:
+ ```
+ poetry shell
+ ```
+
+6. Run the main program using:
+ ```
+ python main.py
+ ```
+
+After completing these steps, the anemometer should be collecting wind speed and direction data, and publishing these data to the MQTT broker under the topic `/v3/wireless_module/5/data`.
+
+
+
+## Testing
+1. Open 2 terminals:
+ - One to subscribe to the topic `/v3/wireless_module/5/data`.
+ - Another to publish to the topic `v3/start`.
+
+2. Publish a true start message to the topic `v3/start`. Streams of data should be shown in the terminal subscribed to the topic `/v3/wireless_module/5/data`.
+
+3. While the data is being published, mess around with the anemometer to ensure values are changing accordingly.
\ No newline at end of file
diff --git a/wireless_modules_py/temp_module/config.example.py b/wireless_modules_py/temp_module/config.example.py
new file mode 100644
index 00000000..37aff52d
--- /dev/null
+++ b/wireless_modules_py/temp_module/config.example.py
@@ -0,0 +1,6 @@
+MQTT_BROKER = ""
+
+USERNAME = ""
+PASSWORD = ""
+
+PORT = ""
diff --git a/wireless_modules_py/temp_module/main.py b/wireless_modules_py/temp_module/main.py
new file mode 100644
index 00000000..262d5257
--- /dev/null
+++ b/wireless_modules_py/temp_module/main.py
@@ -0,0 +1,18 @@
+import time
+import os
+os.environ['PI_HOST']='127.0.0.1'
+os.environ['PI_PORT']='8888'
+import sys
+import Adafruit_DHT
+DHT_SENSOR=Adafruit_DHT.DHT22
+DHT_PIN=....
+while True:
+ try:
+ humidity, temperature=Adafruit_DHT.read_retry(DHT_SENSOR,DHT_PIN)
+ if humidity is not None and temperature is not None:
+ print("Temperature={0:0.1f}C Humidity={1:0.1f}%".format(temperature,humidity))
+ else:
+ print ("failed to obtain data")
+ except KeyboardInterrupt:
+ break
+ time.sleep(2.0)
diff --git a/wireless_modules_py/temp_module/poetry.lock b/wireless_modules_py/temp_module/poetry.lock
new file mode 100644
index 00000000..5716e7a0
--- /dev/null
+++ b/wireless_modules_py/temp_module/poetry.lock
@@ -0,0 +1,175 @@
+[[package]]
+name = "jinja2"
+version = "3.1.2"
+description = "A very fast and expressive template engine."
+category = "main"
+optional = false
+python-versions = ">=3.7"
+
+[package.dependencies]
+MarkupSafe = ">=2.0"
+
+[package.extras]
+i18n = ["Babel (>=2.7)"]
+
+[[package]]
+name = "markupsafe"
+version = "2.1.1"
+description = "Safely add untrusted strings to HTML/XML markup."
+category = "main"
+optional = false
+python-versions = ">=3.7"
+
+[[package]]
+name = "mhp"
+version = "202208.20"
+description = "Common repository containing all MHP python scripts"
+category = "main"
+optional = false
+python-versions = "^3.7"
+develop = false
+
+[package.dependencies]
+Jinja2 = "^3.0.1"
+paho-mqtt = "^1.5.0"
+PyYAML = "^5.4.1"
+stringcase = "^1.2.0"
+
+[package.source]
+type = "git"
+url = "git@github.com:monash-human-power/common.git"
+reference = "master"
+resolved_reference = "b81a6915eeb8c7cc8fd83fd9d302acad68bd7f3d"
+
+[[package]]
+name = "paho-mqtt"
+version = "1.6.1"
+description = "MQTT version 5.0/3.1.1 client class"
+category = "main"
+optional = false
+python-versions = "*"
+
+[package.extras]
+proxy = ["pysocks"]
+
+[[package]]
+name = "pyserial"
+version = "3.5"
+description = "Python Serial Port Extension"
+category = "main"
+optional = false
+python-versions = "*"
+
+[package.extras]
+cp2110 = ["hidapi"]
+
+[[package]]
+name = "pyyaml"
+version = "5.4.1"
+description = "YAML parser and emitter for Python"
+category = "main"
+optional = false
+python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
+
+[[package]]
+name = "stringcase"
+version = "1.2.0"
+description = "String case converter."
+category = "main"
+optional = false
+python-versions = "*"
+
+[metadata]
+lock-version = "1.1"
+python-versions = "^3.7"
+content-hash = "69a79ae2760082eaf8113af3235b9763f2b1f5b6b34fdd5e55c2b031db956cdc"
+
+[metadata.files]
+jinja2 = [
+ {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
+ {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"},
+]
+markupsafe = [
+ {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-win32.whl", hash = "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6"},
+ {file = "MarkupSafe-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-win32.whl", hash = "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff"},
+ {file = "MarkupSafe-2.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-win32.whl", hash = "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1"},
+ {file = "MarkupSafe-2.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-win32.whl", hash = "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c"},
+ {file = "MarkupSafe-2.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247"},
+ {file = "MarkupSafe-2.1.1.tar.gz", hash = "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"},
+]
+mhp = []
+paho-mqtt = [
+ {file = "paho-mqtt-1.6.1.tar.gz", hash = "sha256:2a8291c81623aec00372b5a85558a372c747cbca8e9934dfe218638b8eefc26f"},
+]
+pyserial = [
+ {file = "pyserial-3.5-py2.py3-none-any.whl", hash = "sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0"},
+ {file = "pyserial-3.5.tar.gz", hash = "sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb"},
+]
+pyyaml = [
+ {file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"},
+ {file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"},
+ {file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"},
+ {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"},
+ {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"},
+ {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"},
+ {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"},
+ {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"},
+ {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"},
+ {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"},
+ {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"},
+ {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"},
+ {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"},
+ {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"},
+ {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"},
+ {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"},
+ {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"},
+ {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"},
+ {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"},
+ {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"},
+ {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"},
+ {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"},
+ {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"},
+ {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"},
+ {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"},
+ {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"},
+ {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"},
+ {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"},
+ {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"},
+]
+stringcase = [
+ {file = "stringcase-1.2.0.tar.gz", hash = "sha256:48a06980661908efe8d9d34eab2b6c13aefa2163b3ced26972902e3bdfd87008"},
+]
diff --git a/wireless_modules_py/temp_module/pyproject.toml b/wireless_modules_py/temp_module/pyproject.toml
new file mode 100644
index 00000000..bc5fe088
--- /dev/null
+++ b/wireless_modules_py/temp_module/pyproject.toml
@@ -0,0 +1,18 @@
+[tool.poetry]
+name = "wind_module"
+version = "0.1.0"
+description = ""
+authors = ["Cheuk Lam Winnie Chui "]
+license = "MIT"
+
+[tool.poetry.dependencies]
+python = "^3.7"
+pyserial = "^3.5"
+paho-mqtt = "^1.6.1"
+mhp = {git = "git@github.com:monash-human-power/common.git"}
+
+[tool.poetry.dev-dependencies]
+
+[build-system]
+requires = ["poetry-core>=1.0.0"]
+build-backend = "poetry.core.masonry.api"
From b7c397b89de3bc9776d8ed74a137fed1dab0013c Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Tue, 21 Nov 2023 15:53:03 +1100
Subject: [PATCH 03/11] Files to run DHT22 temp sensor
---
wireless_modules_py/sensors/temp_sensor.py | 64 ++++++++++++----------
1 file changed, 36 insertions(+), 28 deletions(-)
diff --git a/wireless_modules_py/sensors/temp_sensor.py b/wireless_modules_py/sensors/temp_sensor.py
index d24eb6f9..2858b311 100644
--- a/wireless_modules_py/sensors/temp_sensor.py
+++ b/wireless_modules_py/sensors/temp_sensor.py
@@ -1,29 +1,37 @@
-import pigpio
+from sensor_base import Sensor
import time
-pi=pigpio.pi()
-def dht22(pin):
- global pi
- pi.setmode(pin,pigpio.INPUT)
- pi.set_pull_up_down(pin, pigpio.PUD_UP)
- data = []
- last_state = 1
- bits = []
- try:
- while True:
- current_state = pi.read(pin)
- bits.append(1 if current_state == 1 and last_state == 0 else 0)
- last_state = current_state
- if len(bits) == 40:
- break
- for i in range(0, len(bits), 8):
- byte = bits[i:i+8]
- data.append(int(''.join([str(bit) for bit in byte]), 2))
- humidity = data[0] + data[1]/float(10)
- temperature = (data[2] & 0x7f) + data[3]/float(10)
- if data[2] & 0x80:
- temperature *= -1
- return (humidity, temperature)
- except KeyboardInterrupt:
- pass
- finally:
- pi.cleanup()
+import Adafruit_DHT
+
+class TempSensor(Sensor):
+ """
+ A class for the DHT_22 temp sensor
+ """
+ def __init__(self, pin):
+ """
+ Getting the DHT_22 temp sensor and pin for readings
+ """
+ self.pin=pin
+ self.sensor=Adafruit_DHT.DHT22
+
+ def read(self):
+ """
+ Read the temperature (deg in Cel) and humidity (%) from the temperature sensor
+ :return: An array of length 2 containing a temperature dictionary and a humidity dictionary.
+ Each dictionary contains a "type" key associated with the sensor type (str) and a "value" key associated with
+ another dictionary containing key-value pairs of the measurement method (str) and its relevant data (float).
+ """
+ readings=[]
+
+ humidity, temperature=Adafruit_DHT.read_retry(self.sensor,self.pin)
+ if humidity is not None and temperature is not None:
+ temperature=float(temperature)
+ humidity=float(humidity)
+ readings = [
+ {
+ "temp_in_deg": temperature,
+ },
+ {
+ "humidity_in_percent": humidity,
+ }
+ ]
+ return readings
\ No newline at end of file
From d23dbba5308db814eb52c124e74b4d6c5cbf371a Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Tue, 21 Nov 2023 15:59:27 +1100
Subject: [PATCH 04/11] The temp module for the temp sensor DHT22 to run
---
.../temp_module/config.example.py | 3 +-
wireless_modules_py/temp_module/main.py | 42 +++++++++++++------
.../temp_module/pyproject.toml | 8 ++--
3 files changed, 35 insertions(+), 18 deletions(-)
diff --git a/wireless_modules_py/temp_module/config.example.py b/wireless_modules_py/temp_module/config.example.py
index 37aff52d..93953380 100644
--- a/wireless_modules_py/temp_module/config.example.py
+++ b/wireless_modules_py/temp_module/config.example.py
@@ -2,5 +2,4 @@
USERNAME = ""
PASSWORD = ""
-
-PORT = ""
+PIN = ""
diff --git a/wireless_modules_py/temp_module/main.py b/wireless_modules_py/temp_module/main.py
index 262d5257..bd4c9421 100644
--- a/wireless_modules_py/temp_module/main.py
+++ b/wireless_modules_py/temp_module/main.py
@@ -1,18 +1,36 @@
+import sys
+sys.path.insert(1,'data-acquisition-system\wireless_modules_py\sensors')
+from temp_sensor import TempSensor
+sys.path.insert(2, '../')
+import config
import time
import os
os.environ['PI_HOST']='127.0.0.1'
os.environ['PI_PORT']='8888'
-import sys
import Adafruit_DHT
+import logging
+import asyncio
+
DHT_SENSOR=Adafruit_DHT.DHT22
-DHT_PIN=....
-while True:
- try:
- humidity, temperature=Adafruit_DHT.read_retry(DHT_SENSOR,DHT_PIN)
- if humidity is not None and temperature is not None:
- print("Temperature={0:0.1f}C Humidity={1:0.1f}%".format(temperature,humidity))
- else:
- print ("failed to obtain data")
- except KeyboardInterrupt:
- break
- time.sleep(2.0)
+MODULE_NUM=6
+
+async def main():
+ logging.basicConfig(
+ format="%(levelname)-8s [%(filename)s] %(message)s", level=logging.DEBUG
+ )
+
+ temp_sensor_pin = config.PIN
+ my_temp_sensor = TempSensor(temp_sensor_pin)
+
+ temp_module = WirelessModule(MODULE_NUM)
+ sensors = [my_temp_sensor]
+ temp_module.add_sensors(sensors)
+
+ logging.debug("Start asyncio loop")
+ asyncio.create_task(temp_module.run())
+
+ while True:
+ await asyncio.sleep(1)
+
+
+asyncio.run(main())
\ No newline at end of file
diff --git a/wireless_modules_py/temp_module/pyproject.toml b/wireless_modules_py/temp_module/pyproject.toml
index bc5fe088..f5a1df3e 100644
--- a/wireless_modules_py/temp_module/pyproject.toml
+++ b/wireless_modules_py/temp_module/pyproject.toml
@@ -1,18 +1,18 @@
[tool.poetry]
-name = "wind_module"
+name = "temp_module"
version = "0.1.0"
description = ""
-authors = ["Cheuk Lam Winnie Chui "]
+authors = ["Ngoc Thao Vy Nguyen "]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.7"
-pyserial = "^3.5"
paho-mqtt = "^1.6.1"
mhp = {git = "git@github.com:monash-human-power/common.git"}
+Adafruit-DHT = "^1.4.0"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
-build-backend = "poetry.core.masonry.api"
+build-backend = "poetry.core.masonry.api"
\ No newline at end of file
From 44b760b1a5e47defbffbba2d9ada382851b3c9b3 Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Tue, 21 Nov 2023 16:25:15 +1100
Subject: [PATCH 05/11] Made some small changes to the main.py in temp module
---
wireless_modules_py/temp_module/README.md | 20 ++++++++++----------
wireless_modules_py/temp_module/main.py | 2 +-
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/wireless_modules_py/temp_module/README.md b/wireless_modules_py/temp_module/README.md
index 3affb3a5..1eff4ee6 100644
--- a/wireless_modules_py/temp_module/README.md
+++ b/wireless_modules_py/temp_module/README.md
@@ -1,20 +1,20 @@
# Wind Module
-This directory contains the scripts to collect wind speed and direction data from the anemometer, and publish these data to the MQTT broker under the topic `/v3/wireless_module/5/data`.
+This directory contains the scripts to collect temperature and humidity from the DHT22 sensor, and publish these data to the MQTT broker under the topic `/v3/wireless_module/6/data`.
-- [Wind Module](#wind-module)
+- [Temp Module](#temp-module)
- [Basic Setup and Usage](#basic-setup-and-usage)
- [Testing](#testing)
## Basic Setup and Usage
1. Install the [Vaisala USB Instrument Finder driver](https://go.vaisala.com/software/WXT530/Vaisala_WXT530_Configuration_Tool_Weather_Measurement.zip?_ga=2.138439603.1803271655.1674458831-1555859295.1674458831) using these [installation instructions](https://docs.vaisala.com/r/M211840EN-F/en-US/GUID-6D206CCD-21E9-4E9A-98C9-760C90EA90BF/GUID-AE6CDFA9-16A5-4E47-B354-37C04534C558).
-2. Connect the anemometer to your computer and note down which port it is connecting to.
+2. Connect the DHT22 to the raspberry pi and note down which pin it is connected to.
-3. In the `wind_module` directory, create a local version of `config.py` using the `config.example.py` file.
+3. In the `temp_module` directory, create a local version of `config.py` using the `config.example.py` file.
-4. Get inside the `wind_module` directory using:
+4. Get inside the `temp_module` directory using:
```
- cd wireless_mdoules_py/wind_module
+ cd wireless_mdoules_py/temp_module
```
5. Ensuring that you have [poetry](https://python-poetry.org/) installed, spawn into the poetry environment using:
@@ -27,15 +27,15 @@ This directory contains the scripts to collect wind speed and direction data fro
python main.py
```
-After completing these steps, the anemometer should be collecting wind speed and direction data, and publishing these data to the MQTT broker under the topic `/v3/wireless_module/5/data`.
+After completing these steps, the anemometer should be collecting wind speed and direction data, and publishing these data to the MQTT broker under the topic `/v3/wireless_module/6/data`.
## Testing
1. Open 2 terminals:
- - One to subscribe to the topic `/v3/wireless_module/5/data`.
+ - One to subscribe to the topic `/v3/wireless_module/6/data`.
- Another to publish to the topic `v3/start`.
-2. Publish a true start message to the topic `v3/start`. Streams of data should be shown in the terminal subscribed to the topic `/v3/wireless_module/5/data`.
+2. Publish a true start message to the topic `v3/start`. Streams of data should be shown in the terminal subscribed to the topic `/v3/wireless_module/6/data`.
-3. While the data is being published, mess around with the anemometer to ensure values are changing accordingly.
\ No newline at end of file
+3. While the data is being published, mess around with the sensor to ensure values are changing accordingly.
\ No newline at end of file
diff --git a/wireless_modules_py/temp_module/main.py b/wireless_modules_py/temp_module/main.py
index bd4c9421..927c2332 100644
--- a/wireless_modules_py/temp_module/main.py
+++ b/wireless_modules_py/temp_module/main.py
@@ -1,5 +1,5 @@
import sys
-sys.path.insert(1,'data-acquisition-system\wireless_modules_py\sensors')
+sys.path.insert(1,'../sensors')
from temp_sensor import TempSensor
sys.path.insert(2, '../')
import config
From 6bdd9bf22d0569f84aa09675a7efebc076604611 Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Tue, 21 Nov 2023 16:28:01 +1100
Subject: [PATCH 06/11] Adding wireless module and making small changes to the
temp module
---
wireless_modules_py/temp_module/main.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/wireless_modules_py/temp_module/main.py b/wireless_modules_py/temp_module/main.py
index 927c2332..a9a468a6 100644
--- a/wireless_modules_py/temp_module/main.py
+++ b/wireless_modules_py/temp_module/main.py
@@ -3,6 +3,7 @@
from temp_sensor import TempSensor
sys.path.insert(2, '../')
import config
+from wireless_module import WirelessModule
import time
import os
os.environ['PI_HOST']='127.0.0.1'
From 7c60296c6f80550acc5e6a1b9257d42a5564a98b Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Tue, 21 Nov 2023 17:07:58 +1100
Subject: [PATCH 07/11] Testing file for temp sensor to see if mqtt wokrs
---
wireless_modules_py/sensors/temp_sensor.py | 2 ++
1 file changed, 2 insertions(+)
diff --git a/wireless_modules_py/sensors/temp_sensor.py b/wireless_modules_py/sensors/temp_sensor.py
index 2858b311..96d4fa47 100644
--- a/wireless_modules_py/sensors/temp_sensor.py
+++ b/wireless_modules_py/sensors/temp_sensor.py
@@ -34,4 +34,6 @@ def read(self):
"humidity_in_percent": humidity,
}
]
+ else:
+ print('Failed to obtain data')
return readings
\ No newline at end of file
From 548e92e6d3e6030a495dba21cff0fa2a4288a82e Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Tue, 28 Nov 2023 10:37:30 +1100
Subject: [PATCH 08/11] Changes to the pin on main.py
---
wireless_modules_py/.gitignore | 2 +-
.../sensors/new_temp_sensor.py | 20 -------------------
wireless_modules_py/sensors/temp_sensor.py | 4 ++--
wireless_modules_py/sensors/wind_sensor.py | 3 +--
4 files changed, 4 insertions(+), 25 deletions(-)
delete mode 100644 wireless_modules_py/sensors/new_temp_sensor.py
diff --git a/wireless_modules_py/.gitignore b/wireless_modules_py/.gitignore
index e67650ab..f85c6b18 100644
--- a/wireless_modules_py/.gitignore
+++ b/wireless_modules_py/.gitignore
@@ -1 +1 @@
-/wind_module/config.py
\ No newline at end of file
+config.py
\ No newline at end of file
diff --git a/wireless_modules_py/sensors/new_temp_sensor.py b/wireless_modules_py/sensors/new_temp_sensor.py
deleted file mode 100644
index 162b41dc..00000000
--- a/wireless_modules_py/sensors/new_temp_sensor.py
+++ /dev/null
@@ -1,20 +0,0 @@
-from sensor_base import Sensor
-import serial
-import time
-import Adafruit_DHT as dht
-class Temp_sensor(Sensor):
- def __init__(self, port):
- """
- Initialise the anemometer to read wind direction and wind speed data.
- :param port: The serial port that the anemometer is connected to.
- """
- self.baudrate = 19200
- self.sensor = serial.Serial(port, self.baudrate)
-
- self.readings = []
-
- self.query_time = 0
- self.MS_TO_SEC = 1/1000
- self.NS_TO_MS = 1000000
- def read(self):
- self.sensor()
\ No newline at end of file
diff --git a/wireless_modules_py/sensors/temp_sensor.py b/wireless_modules_py/sensors/temp_sensor.py
index 96d4fa47..c48e8710 100644
--- a/wireless_modules_py/sensors/temp_sensor.py
+++ b/wireless_modules_py/sensors/temp_sensor.py
@@ -1,7 +1,7 @@
from sensor_base import Sensor
import time
import Adafruit_DHT
-
+from temp_module import config.py
class TempSensor(Sensor):
"""
A class for the DHT_22 temp sensor
@@ -10,7 +10,7 @@ def __init__(self, pin):
"""
Getting the DHT_22 temp sensor and pin for readings
"""
- self.pin=pin
+ self.pin=config.PIN
self.sensor=Adafruit_DHT.DHT22
def read(self):
diff --git a/wireless_modules_py/sensors/wind_sensor.py b/wireless_modules_py/sensors/wind_sensor.py
index 6622fa70..6ae53d02 100644
--- a/wireless_modules_py/sensors/wind_sensor.py
+++ b/wireless_modules_py/sensors/wind_sensor.py
@@ -69,6 +69,5 @@ def read(self):
]
# update the last time of read() being called
- self.query_time = time.time_ns() * self.NS_TO_MS
-
+
return self.readings
From 69fedd8d522a143e83f3f461c818601482f27f35 Mon Sep 17 00:00:00 2001
From: Ngoc Thao Vy Nguyen <141688848+e-vyday@users.noreply.github.com>
Date: Tue, 28 Nov 2023 22:29:59 +1100
Subject: [PATCH 09/11] a draft to test my hypothesis for DHT22 sensors
---
wireless_modules_py/temp_module/draft.py | 3 +++
1 file changed, 3 insertions(+)
create mode 100644 wireless_modules_py/temp_module/draft.py
diff --git a/wireless_modules_py/temp_module/draft.py b/wireless_modules_py/temp_module/draft.py
new file mode 100644
index 00000000..4cf7fea9
--- /dev/null
+++ b/wireless_modules_py/temp_module/draft.py
@@ -0,0 +1,3 @@
+import Adafruit_DHT
+DHT_sensor=Adafruit_DHT.DHT22
+print(f'{DHT_sensor} is the sensor')
\ No newline at end of file
From b6ee76c6dcb98047feba14f9af33f9b1fca32de7 Mon Sep 17 00:00:00 2001
From: Vy
Date: Sun, 3 Dec 2023 16:35:55 +1100
Subject: [PATCH 10/11] Testing from raspberry pi for DHT22 temp sensor
---
wireless_modules_py/.gitignore | 7 +-
wireless_modules_py/sensors/temp_sensor.py | 7 +-
wireless_modules_py/temp_module/draft.py | 3 -
wireless_modules_py/temp_module/main.py | 3 +-
wireless_modules_py/temp_module/poetry.lock | 193 ++++++++++----------
5 files changed, 113 insertions(+), 100 deletions(-)
delete mode 100644 wireless_modules_py/temp_module/draft.py
diff --git a/wireless_modules_py/.gitignore b/wireless_modules_py/.gitignore
index f85c6b18..8c723e53 100644
--- a/wireless_modules_py/.gitignore
+++ b/wireless_modules_py/.gitignore
@@ -1 +1,6 @@
-config.py
\ No newline at end of file
+
+/wind_module/config.py
+/temp_module/config.py
+
+config.py
+
diff --git a/wireless_modules_py/sensors/temp_sensor.py b/wireless_modules_py/sensors/temp_sensor.py
index c48e8710..d304fb94 100644
--- a/wireless_modules_py/sensors/temp_sensor.py
+++ b/wireless_modules_py/sensors/temp_sensor.py
@@ -1,5 +1,7 @@
from sensor_base import Sensor
import time
+import sys
+#sys.path.append('home/pi/data-acquisition-system/wireless_modules_py/sensors/Adafruit_Python_DHT/Adafruit_DHT')
import Adafruit_DHT
from temp_module import config.py
class TempSensor(Sensor):
@@ -10,7 +12,7 @@ def __init__(self, pin):
"""
Getting the DHT_22 temp sensor and pin for readings
"""
- self.pin=config.PIN
+ self.pin=pin
self.sensor=Adafruit_DHT.DHT22
def read(self):
@@ -21,7 +23,6 @@ def read(self):
another dictionary containing key-value pairs of the measurement method (str) and its relevant data (float).
"""
readings=[]
-
humidity, temperature=Adafruit_DHT.read_retry(self.sensor,self.pin)
if humidity is not None and temperature is not None:
temperature=float(temperature)
@@ -36,4 +37,4 @@ def read(self):
]
else:
print('Failed to obtain data')
- return readings
\ No newline at end of file
+ return readings
diff --git a/wireless_modules_py/temp_module/draft.py b/wireless_modules_py/temp_module/draft.py
deleted file mode 100644
index 4cf7fea9..00000000
--- a/wireless_modules_py/temp_module/draft.py
+++ /dev/null
@@ -1,3 +0,0 @@
-import Adafruit_DHT
-DHT_sensor=Adafruit_DHT.DHT22
-print(f'{DHT_sensor} is the sensor')
\ No newline at end of file
diff --git a/wireless_modules_py/temp_module/main.py b/wireless_modules_py/temp_module/main.py
index a9a468a6..a80b16b6 100644
--- a/wireless_modules_py/temp_module/main.py
+++ b/wireless_modules_py/temp_module/main.py
@@ -8,6 +8,7 @@
import os
os.environ['PI_HOST']='127.0.0.1'
os.environ['PI_PORT']='8888'
+sys.path.append('home/pi/data-acquisition-system/wireless_modules_py/sensors/Adafruit_Python_DHT/Adafruit_DHT')
import Adafruit_DHT
import logging
import asyncio
@@ -34,4 +35,4 @@ async def main():
await asyncio.sleep(1)
-asyncio.run(main())
\ No newline at end of file
+asyncio.run(main())
diff --git a/wireless_modules_py/temp_module/poetry.lock b/wireless_modules_py/temp_module/poetry.lock
index 5716e7a0..f66bcb36 100644
--- a/wireless_modules_py/temp_module/poetry.lock
+++ b/wireless_modules_py/temp_module/poetry.lock
@@ -1,10 +1,25 @@
+# This file is automatically @generated by Poetry 1.5.1 and should not be changed by hand.
+
+[[package]]
+name = "adafruit-dht"
+version = "1.4.0"
+description = "Library to get readings from the DHT11, DHT22, and AM2302 humidity and temperature sensors on a Raspberry Pi or Beaglebone Black."
+optional = false
+python-versions = "*"
+files = [
+ {file = "Adafruit_DHT-1.4.0.tar.gz", hash = "sha256:e927f2232eff5335cb9d8a2cca6dcad4625e61f205b12e31ef04198ea6dec830"},
+]
+
[[package]]
name = "jinja2"
version = "3.1.2"
description = "A very fast and expressive template engine."
-category = "main"
optional = false
python-versions = ">=3.7"
+files = [
+ {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
+ {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"},
+]
[package.dependencies]
MarkupSafe = ">=2.0"
@@ -14,19 +29,80 @@ i18n = ["Babel (>=2.7)"]
[[package]]
name = "markupsafe"
-version = "2.1.1"
+version = "2.1.3"
description = "Safely add untrusted strings to HTML/XML markup."
-category = "main"
optional = false
python-versions = ">=3.7"
+files = [
+ {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:cd0f502fe016460680cd20aaa5a76d241d6f35a1c3350c474bac1273803893fa"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:e09031c87a1e51556fdcb46e5bd4f59dfb743061cf93c4d6831bf894f125eb57"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68e78619a61ecf91e76aa3e6e8e33fc4894a2bebe93410754bd28fce0a8a4f9f"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:65c1a9bcdadc6c28eecee2c119465aebff8f7a584dd719facdd9e825ec61ab52"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:525808b8019e36eb524b8c68acdd63a37e75714eac50e988180b169d64480a00"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:962f82a3086483f5e5f64dbad880d31038b698494799b097bc59c2edf392fce6"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:aa7bd130efab1c280bed0f45501b7c8795f9fdbeb02e965371bbef3523627779"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:c9c804664ebe8f83a211cace637506669e7890fec1b4195b505c214e50dd4eb7"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-win32.whl", hash = "sha256:10bbfe99883db80bdbaff2dcf681dfc6533a614f700da1287707e8a5d78a8431"},
+ {file = "MarkupSafe-2.1.3-cp310-cp310-win_amd64.whl", hash = "sha256:1577735524cdad32f9f694208aa75e422adba74f1baee7551620e43a3141f559"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_universal2.whl", hash = "sha256:ad9e82fb8f09ade1c3e1b996a6337afac2b8b9e365f926f5a61aacc71adc5b3c"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:3c0fae6c3be832a0a0473ac912810b2877c8cb9d76ca48de1ed31e1c68386575"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b076b6226fb84157e3f7c971a47ff3a679d837cf338547532ab866c57930dbee"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:bfce63a9e7834b12b87c64d6b155fdd9b3b96191b6bd334bf37db7ff1fe457f2"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:338ae27d6b8745585f87218a3f23f1512dbf52c26c28e322dbe54bcede54ccb9"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:e4dd52d80b8c83fdce44e12478ad2e85c64ea965e75d66dbeafb0a3e77308fcc"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_i686.whl", hash = "sha256:df0be2b576a7abbf737b1575f048c23fb1d769f267ec4358296f31c2479db8f9"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:5bbe06f8eeafd38e5d0a4894ffec89378b6c6a625ff57e3028921f8ff59318ac"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-win32.whl", hash = "sha256:dd15ff04ffd7e05ffcb7fe79f1b98041b8ea30ae9234aed2a9168b5797c3effb"},
+ {file = "MarkupSafe-2.1.3-cp311-cp311-win_amd64.whl", hash = "sha256:134da1eca9ec0ae528110ccc9e48041e0828d79f24121a1a146161103c76e686"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_universal2.whl", hash = "sha256:f698de3fd0c4e6972b92290a45bd9b1536bffe8c6759c62471efaa8acb4c37bc"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-macosx_10_9_x86_64.whl", hash = "sha256:aa57bd9cf8ae831a362185ee444e15a93ecb2e344c8e52e4d721ea3ab6ef1823"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ffcc3f7c66b5f5b7931a5aa68fc9cecc51e685ef90282f4a82f0f5e9b704ad11"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:47d4f1c5f80fc62fdd7777d0d40a2e9dda0a05883ab11374334f6c4de38adffd"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:1f67c7038d560d92149c060157d623c542173016c4babc0c1913cca0564b9939"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:9aad3c1755095ce347e26488214ef77e0485a3c34a50c5a5e2471dff60b9dd9c"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_i686.whl", hash = "sha256:14ff806850827afd6b07a5f32bd917fb7f45b046ba40c57abdb636674a8b559c"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:8f9293864fe09b8149f0cc42ce56e3f0e54de883a9de90cd427f191c346eb2e1"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-win32.whl", hash = "sha256:715d3562f79d540f251b99ebd6d8baa547118974341db04f5ad06d5ea3eb8007"},
+ {file = "MarkupSafe-2.1.3-cp312-cp312-win_amd64.whl", hash = "sha256:1b8dd8c3fd14349433c79fa8abeb573a55fc0fdd769133baac1f5e07abf54aeb"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:8e254ae696c88d98da6555f5ace2279cf7cd5b3f52be2b5cf97feafe883b58d2"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:cb0932dc158471523c9637e807d9bfb93e06a95cbf010f1a38b98623b929ef2b"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9402b03f1a1b4dc4c19845e5c749e3ab82d5078d16a2a4c2cd2df62d57bb0707"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ca379055a47383d02a5400cb0d110cef0a776fc644cda797db0c5696cfd7e18e"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:b7ff0f54cb4ff66dd38bebd335a38e2c22c41a8ee45aa608efc890ac3e3931bc"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:c011a4149cfbcf9f03994ec2edffcb8b1dc2d2aede7ca243746df97a5d41ce48"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:56d9f2ecac662ca1611d183feb03a3fa4406469dafe241673d521dd5ae92a155"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-win32.whl", hash = "sha256:8758846a7e80910096950b67071243da3e5a20ed2546e6392603c096778d48e0"},
+ {file = "MarkupSafe-2.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:787003c0ddb00500e49a10f2844fac87aa6ce977b90b0feaaf9de23c22508b24"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:2ef12179d3a291be237280175b542c07a36e7f60718296278d8593d21ca937d4"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2c1b19b3aaacc6e57b7e25710ff571c24d6c3613a45e905b1fde04d691b98ee0"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8afafd99945ead6e075b973fefa56379c5b5c53fd8937dad92c662da5d8fd5ee"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8c41976a29d078bb235fea9b2ecd3da465df42a562910f9022f1a03107bd02be"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:d080e0a5eb2529460b30190fcfcc4199bd7f827663f858a226a81bc27beaa97e"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:69c0f17e9f5a7afdf2cc9fb2d1ce6aabdb3bafb7f38017c0b77862bcec2bbad8"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:504b320cd4b7eff6f968eddf81127112db685e81f7e36e75f9f84f0df46041c3"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:42de32b22b6b804f42c5d98be4f7e5e977ecdd9ee9b660fda1a3edf03b11792d"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-win32.whl", hash = "sha256:ceb01949af7121f9fc39f7d27f91be8546f3fb112c608bc4029aef0bab86a2a5"},
+ {file = "MarkupSafe-2.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:1b40069d487e7edb2676d3fbdb2b0829ffa2cd63a2ec26c4938b2d34391b4ecc"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:8023faf4e01efadfa183e863fefde0046de576c6f14659e8782065bcece22198"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6b2b56950d93e41f33b4223ead100ea0fe11f8e6ee5f641eb753ce4b77a7042b"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9dcdfd0eaf283af041973bff14a2e143b8bd64e069f4c383416ecd79a81aab58"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05fb21170423db021895e1ea1e1f3ab3adb85d1c2333cbc2310f2a26bc77272e"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:282c2cb35b5b673bbcadb33a585408104df04f14b2d9b01d4c345a3b92861c2c"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:ab4a0df41e7c16a1392727727e7998a467472d0ad65f3ad5e6e765015df08636"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:7ef3cb2ebbf91e330e3bb937efada0edd9003683db6b57bb108c4001f37a02ea"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:0a4e4a1aff6c7ac4cd55792abf96c915634c2b97e3cc1c7129578aa68ebd754e"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-win32.whl", hash = "sha256:fec21693218efe39aa7f8599346e90c705afa52c5b31ae019b2e57e8f6542bb2"},
+ {file = "MarkupSafe-2.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:3fd4abcb888d15a94f32b75d8fd18ee162ca0c064f35b11134be77050296d6ba"},
+ {file = "MarkupSafe-2.1.3.tar.gz", hash = "sha256:af598ed32d6ae86f1b747b82783958b1a4ab8f617b06fe68795c7f026abbdcad"},
+]
[[package]]
name = "mhp"
-version = "202208.20"
+version = "202212.21"
description = "Common repository containing all MHP python scripts"
-category = "main"
optional = false
python-versions = "^3.7"
+files = []
develop = false
[package.dependencies]
@@ -38,108 +114,29 @@ stringcase = "^1.2.0"
[package.source]
type = "git"
url = "git@github.com:monash-human-power/common.git"
-reference = "master"
-resolved_reference = "b81a6915eeb8c7cc8fd83fd9d302acad68bd7f3d"
+reference = "HEAD"
+resolved_reference = "e630e4053a05a6c4690e68459a9679f45084009d"
[[package]]
name = "paho-mqtt"
version = "1.6.1"
description = "MQTT version 5.0/3.1.1 client class"
-category = "main"
-optional = false
-python-versions = "*"
-
-[package.extras]
-proxy = ["pysocks"]
-
-[[package]]
-name = "pyserial"
-version = "3.5"
-description = "Python Serial Port Extension"
-category = "main"
optional = false
python-versions = "*"
+files = [
+ {file = "paho-mqtt-1.6.1.tar.gz", hash = "sha256:2a8291c81623aec00372b5a85558a372c747cbca8e9934dfe218638b8eefc26f"},
+]
[package.extras]
-cp2110 = ["hidapi"]
+proxy = ["PySocks"]
[[package]]
name = "pyyaml"
version = "5.4.1"
description = "YAML parser and emitter for Python"
-category = "main"
optional = false
python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*"
-
-[[package]]
-name = "stringcase"
-version = "1.2.0"
-description = "String case converter."
-category = "main"
-optional = false
-python-versions = "*"
-
-[metadata]
-lock-version = "1.1"
-python-versions = "^3.7"
-content-hash = "69a79ae2760082eaf8113af3235b9763f2b1f5b6b34fdd5e55c2b031db956cdc"
-
-[metadata.files]
-jinja2 = [
- {file = "Jinja2-3.1.2-py3-none-any.whl", hash = "sha256:6088930bfe239f0e6710546ab9c19c9ef35e29792895fed6e6e31a023a182a61"},
- {file = "Jinja2-3.1.2.tar.gz", hash = "sha256:31351a702a408a9e7595a8fc6150fc3f43bb6bf7e319770cbc0db9df9437e852"},
-]
-markupsafe = [
- {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:86b1f75c4e7c2ac2ccdaec2b9022845dbb81880ca318bb7a0a01fbf7813e3812"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:f121a1420d4e173a5d96e47e9a0c0dcff965afdf1626d28de1460815f7c4ee7a"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a49907dd8420c5685cfa064a1335b6754b74541bbb3706c259c02ed65b644b3e"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:10c1bfff05d95783da83491be968e8fe789263689c02724e0c691933c52994f5"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b7bd98b796e2b6553da7225aeb61f447f80a1ca64f41d83612e6139ca5213aa4"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:b09bf97215625a311f669476f44b8b318b075847b49316d3e28c08e41a7a573f"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_i686.whl", hash = "sha256:694deca8d702d5db21ec83983ce0bb4b26a578e71fbdbd4fdcd387daa90e4d5e"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:efc1913fd2ca4f334418481c7e595c00aad186563bbc1ec76067848c7ca0a933"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-win32.whl", hash = "sha256:4a33dea2b688b3190ee12bd7cfa29d39c9ed176bda40bfa11099a3ce5d3a7ac6"},
- {file = "MarkupSafe-2.1.1-cp310-cp310-win_amd64.whl", hash = "sha256:dda30ba7e87fbbb7eab1ec9f58678558fd9a6b8b853530e176eabd064da81417"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:671cd1187ed5e62818414afe79ed29da836dde67166a9fac6d435873c44fdd02"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3799351e2336dc91ea70b034983ee71cf2f9533cdff7c14c90ea126bfd95d65a"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e72591e9ecd94d7feb70c1cbd7be7b3ebea3f548870aa91e2732960fa4d57a37"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6fbf47b5d3728c6aea2abb0589b5d30459e369baa772e0f37a0320185e87c980"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_aarch64.whl", hash = "sha256:d5ee4f386140395a2c818d149221149c54849dfcfcb9f1debfe07a8b8bd63f9a"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_i686.whl", hash = "sha256:bcb3ed405ed3222f9904899563d6fc492ff75cce56cba05e32eff40e6acbeaa3"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-musllinux_1_1_x86_64.whl", hash = "sha256:e1c0b87e09fa55a220f058d1d49d3fb8df88fbfab58558f1198e08c1e1de842a"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-win32.whl", hash = "sha256:8dc1c72a69aa7e082593c4a203dcf94ddb74bb5c8a731e4e1eb68d031e8498ff"},
- {file = "MarkupSafe-2.1.1-cp37-cp37m-win_amd64.whl", hash = "sha256:97a68e6ada378df82bc9f16b800ab77cbf4b2fada0081794318520138c088e4a"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:e8c843bbcda3a2f1e3c2ab25913c80a3c5376cd00c6e8c4a86a89a28c8dc5452"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0212a68688482dc52b2d45013df70d169f542b7394fc744c02a57374a4207003"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8e576a51ad59e4bfaac456023a78f6b5e6e7651dcd383bcc3e18d06f9b55d6d1"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4b9fe39a2ccc108a4accc2676e77da025ce383c108593d65cc909add5c3bd601"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:96e37a3dc86e80bf81758c152fe66dbf60ed5eca3d26305edf01892257049925"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_aarch64.whl", hash = "sha256:6d0072fea50feec76a4c418096652f2c3238eaa014b2f94aeb1d56a66b41403f"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_i686.whl", hash = "sha256:089cf3dbf0cd6c100f02945abeb18484bd1ee57a079aefd52cffd17fba910b88"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-musllinux_1_1_x86_64.whl", hash = "sha256:6a074d34ee7a5ce3effbc526b7083ec9731bb3cbf921bbe1d3005d4d2bdb3a63"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-win32.whl", hash = "sha256:421be9fbf0ffe9ffd7a378aafebbf6f4602d564d34be190fc19a193232fd12b1"},
- {file = "MarkupSafe-2.1.1-cp38-cp38-win_amd64.whl", hash = "sha256:fc7b548b17d238737688817ab67deebb30e8073c95749d55538ed473130ec0c7"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:e04e26803c9c3851c931eac40c695602c6295b8d432cbe78609649ad9bd2da8a"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b87db4360013327109564f0e591bd2a3b318547bcef31b468a92ee504d07ae4f"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:99a2a507ed3ac881b975a2976d59f38c19386d128e7a9a18b7df6fff1fd4c1d6"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:56442863ed2b06d19c37f94d999035e15ee982988920e12a5b4ba29b62ad1f77"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:3ce11ee3f23f79dbd06fb3d63e2f6af7b12db1d46932fe7bd8afa259a5996603"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_aarch64.whl", hash = "sha256:33b74d289bd2f5e527beadcaa3f401e0df0a89927c1559c8566c066fa4248ab7"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_i686.whl", hash = "sha256:43093fb83d8343aac0b1baa75516da6092f58f41200907ef92448ecab8825135"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-musllinux_1_1_x86_64.whl", hash = "sha256:8e3dcf21f367459434c18e71b2a9532d96547aef8a871872a5bd69a715c15f96"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-win32.whl", hash = "sha256:d4306c36ca495956b6d568d276ac11fdd9c30a36f1b6eb928070dc5360b22e1c"},
- {file = "MarkupSafe-2.1.1-cp39-cp39-win_amd64.whl", hash = "sha256:46d00d6cfecdde84d40e572d63735ef81423ad31184100411e6e3388d405e247"},
- {file = "MarkupSafe-2.1.1.tar.gz", hash = "sha256:7f91197cc9e48f989d12e4e6fbc46495c446636dfc81b9ccf50bb0ec74b91d4b"},
-]
-mhp = []
-paho-mqtt = [
- {file = "paho-mqtt-1.6.1.tar.gz", hash = "sha256:2a8291c81623aec00372b5a85558a372c747cbca8e9934dfe218638b8eefc26f"},
-]
-pyserial = [
- {file = "pyserial-3.5-py2.py3-none-any.whl", hash = "sha256:c4451db6ba391ca6ca299fb3ec7bae67a5c55dde170964c7a14ceefec02f2cf0"},
- {file = "pyserial-3.5.tar.gz", hash = "sha256:3c77e014170dfffbd816e6ffc205e9842efb10be9f58ec16d3e8675b4925cddb"},
-]
-pyyaml = [
+files = [
{file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"},
{file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"},
{file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"},
@@ -170,6 +167,18 @@ pyyaml = [
{file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"},
{file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"},
]
-stringcase = [
+
+[[package]]
+name = "stringcase"
+version = "1.2.0"
+description = "String case converter."
+optional = false
+python-versions = "*"
+files = [
{file = "stringcase-1.2.0.tar.gz", hash = "sha256:48a06980661908efe8d9d34eab2b6c13aefa2163b3ced26972902e3bdfd87008"},
]
+
+[metadata]
+lock-version = "2.0"
+python-versions = "^3.7"
+content-hash = "9d449ad3bbad0d80f20fcf1c459df66acc381055e90c968257e7354e810f1038"
From 11622845bedff1f01ba714ff3377211ea610e1d5 Mon Sep 17 00:00:00 2001
From: Vy
Date: Sun, 3 Dec 2023 16:40:45 +1100
Subject: [PATCH 11/11] Fix context error for config.py and round to 2 dec for
print statements
---
wireless_modules_py/sensors/temp_sensor.py | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/wireless_modules_py/sensors/temp_sensor.py b/wireless_modules_py/sensors/temp_sensor.py
index d304fb94..19a39fab 100644
--- a/wireless_modules_py/sensors/temp_sensor.py
+++ b/wireless_modules_py/sensors/temp_sensor.py
@@ -1,9 +1,7 @@
from sensor_base import Sensor
import time
import sys
-#sys.path.append('home/pi/data-acquisition-system/wireless_modules_py/sensors/Adafruit_Python_DHT/Adafruit_DHT')
import Adafruit_DHT
-from temp_module import config.py
class TempSensor(Sensor):
"""
A class for the DHT_22 temp sensor
@@ -25,8 +23,8 @@ def read(self):
readings=[]
humidity, temperature=Adafruit_DHT.read_retry(self.sensor,self.pin)
if humidity is not None and temperature is not None:
- temperature=float(temperature)
- humidity=float(humidity)
+ temperature=round(float(temperature),2)
+ humidity=round(float(humidity),2)
readings = [
{
"temp_in_deg": temperature,