Skip to content

Commit

Permalink
Chore: remove comment that are redundant according to the updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
RMNorbert committed Aug 19, 2023
1 parent 199e9a3 commit a737105
Show file tree
Hide file tree
Showing 9 changed files with 7 additions and 42 deletions.
2 changes: 1 addition & 1 deletion database/db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from sqlalchemy import create_engine, ForeignKey, Column, String, Integer, Float, DATETIME
from sqlalchemy import create_engine, Column, String, Integer, Float, DATETIME
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
from datetime import datetime
Expand Down
1 change: 0 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from tkinter import *
import tkinter as tk
from tkinter import ttk, messagebox
from sensor.arduino_multi_board_system_interface import *
# from sensor.arduino_one_board_system_interface import * # in case of one board

Expand Down
2 changes: 1 addition & 1 deletion prometheus/config/prometheus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,4 +27,4 @@ scrape_configs:

- job_name: "aquatherm"
static_configs:
- targets: ['aquatherm:5000']
- targets: ['aquatherm:5000']
12 changes: 0 additions & 12 deletions sensor/arduino/arduino_fan_controller.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
# to use pip install pyserial
import serial
import time
# 1st step : To set Arduino -> tools -> manage libraries -> search the corresponding to the device if there is any ,
# install the package
# 2nd step : file -> samples -> select the sensor
# 3rd step: Use Arduino IDE to upload the firmware onto the arduino board
# or create a custom fan controller in Arduino Ide with this code
# An example setup:
# General IRF530 N to 100 V 17 a to 220 N Channel Transistor Mosfet
# Arctic ACFAN00118A Fan
# Arduino Uno
# sd card
# set the port and baud rate


class ArduinoFanController:
Expand Down
4 changes: 1 addition & 3 deletions sensor/arduino/arduino_tap_controller.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# to use pip install pyserial
import serial
import time
# set the port and baud rate


class ArduinoTapController:
def __init__(self, port='COM7', baud_rate=115200):
def __init__(self, port='COM7', baud_rate=115200): # set the port and baud rate
self.port = port
self.baud_rate = baud_rate
self.ser_t = None
Expand Down
6 changes: 0 additions & 6 deletions sensor/arduino/arduino_temperature_and_humidity_controller.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# to use pip install pyserial
import serial
import time
# 1st step : To set Arduino -> tools -> manage libraries -> search simple dht , install the package
# 2nd step : file -> samples -> select the sensor
# 3rd step: Use Arduino IDE to upload the firmware onto the arduino board
# with the current settings connect the sensor data wire to the second digital input
# the correct connection settings can be found in the arduino application -> tools -> port


class ArduinoTemperatureAndHumidityController:
Expand Down
1 change: 0 additions & 1 deletion sensor/arduino_multi_board_system_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,3 @@ def control_tap(status):
return t_controller.switch_tap('off')
else:
return 'Tap: turned off'

Original file line number Diff line number Diff line change
@@ -1,21 +1,8 @@
# pip3 install adafruit-circuitpython-dht
# sudo apt-get install libgpiod2
# imports for using a sensor to provide readings
import time
import board
import adafruit_dht

# 1 To be able to connect to the sensor write the Raspberry OS with Raspberry Pi Imager to an sd card
# 2 Insert the sd card to the board
# 3 A, Make a connection: with usb to the computer or connection can be made directly to mouse, keyboard, screen, speakers
# to the Raspberry board in this case the power needed for the board to turn on will be provided by the usb connection.
# 3 B, Finish the setup by starting the board (screen and at least a keyboard will be needed)
# during the setup the credentials for wifi connection can be set (if the board have a wireless connectivity)
# 3 C, After finishing the setup it is possible to just make a connection with the ethernet cable or wifi.
# If only wifi connection or ethernet port used its important to provide a power outlet because raspberry pi does not have one initially.
# Initial the dht device, with data pin connected to:
# adafruit_dht.theTypeOfTheSensor(set here the board pin which the sensor is connected to)

"""
you can pass DHT22 use_pulseio=False if you wouldn't like to use pulseio.
This may be necessary on a Linux single board computer like the Raspberry Pi,
Expand Down
8 changes: 4 additions & 4 deletions web_app.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import time
from flask import Flask, request, render_template, jsonify
from prometheus_flask_exporter import PrometheusMetrics
from prometheus.metrics import *
Expand All @@ -12,7 +11,6 @@
state = 'OFF'
initial_value = '...'


@app.get('/')
def index():
fan_status = 'turned off'
Expand Down Expand Up @@ -64,13 +62,15 @@ def update_data():
humidity=humidity,
status=status,
fanStatus=fan_status,
tapStatus=tap_status)
tapStatus=tap_status
)
else:
return jsonify(temperature=initial_value,
humidity=initial_value,
status=initial_value,
fanStatus='Fan: ' + initial_value,
tapStatus='Tap: ' + initial_value)
tapStatus='Tap: ' + initial_value
)


@app.route('/state', methods=['POST'])
Expand Down

0 comments on commit a737105

Please sign in to comment.