Raspy comment update, Robot UML update

This commit is contained in:
waldluis 2023-08-17 10:37:00 +02:00
parent 22bcf7310f
commit 1778a211bb
4 changed files with 333 additions and 288 deletions

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@ -50,7 +50,7 @@ def drive_plant_thread(plantID, actionID, client: mqtt.Client):
Meassure and publish data via MQTT
Drive home to starting point
***If color codes are working properly this function is not needed anymore***
***Function is only neccessary for driving without color codes***
Args:
plantID (_type_): plant to measure
@ -116,7 +116,7 @@ def drive_plant_all_thread(plantIDs: list, actionID, client: mqtt.Client):
client (mqtt.Client): current MQTT client
"""
allPlantData = {
allPlantData = { # Sensordata for all plants
"SensorData": [],
"ActionID": ""
}
@ -168,11 +168,12 @@ def drive_plant_all_thread(plantIDs: list, actionID, client: mqtt.Client):
else:
errorMessage = "Motor or Sensor unplugged"
logging.info(f"{errorMessage}, Drive Plant aborted, Robot at starting position")
logging.info(f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}")
client.publish(Topics["ROBOT_DATA_ERROR"], f"{errorMessage}, Drive Plant aborted, Robot at plant {plant}", qos=1)
client.publish(Topics["ROBOT_DATA_ROBOTREADY"], "True", qos=1)
return
# End of drive and measure operation
logging.info("All Plants measured, sending data")
client.publish(Topics["ROBOT_DATA_ALL"], json.dumps(allPlantData, indent=4), qos=1)
@ -206,7 +207,7 @@ def drive_plant(client: mqtt.Client, userdata, message: mqtt.MQTTMessage):
Function to drive to plant according to request
Starting Drive in Thread to not block main programm
***If color codes are working properly this function is not needed anymore***
***Function is only neccessary for driving without color codes***
Args:
client (mqtt.Client): current mqtt client

View File

@ -42,7 +42,7 @@ def readDHT22():
def readTSL2561():
"""
Reads TSL2561 brightness in Lux and returns integer value
Reads TSL2561 brightness via I2C in Lux and returns integer value
Raises:
Exception: If TSL2561 not connected properly
@ -67,7 +67,7 @@ def readTSL2561():
def readMCP3008():
"""
Reads YL-69 via MCP3008 ADC soil moisture in percent and returns float value
Reads YL-69 via MCP3008 ADC and SPI soil moisture in percent and returns float value
Raises:
Exception: If YL-69 not connected properly
@ -133,7 +133,7 @@ def readSensors(sensorData):
sensorData["SoilMoisture"] = 0 # No value returend if error occurs -> setting safe value
errorMessage = errorMessage + str(e) + "\n" # Appending received error message to later forward all occured errors
# raise combined error message
# raise combined error message, successfull values still available
if errorMessage != "":
raise Exception(errorMessage)