repository to manage all files related to the makeathon farm bot project (Software + Documentation).
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

defines.py 2.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. """
  2. created by caliskan at 19.04.2023
  3. contains all constants for the backend architecture of the smart garden project
  4. """
  5. MQTT_BROKER_LOCAL = "192.168.0.199"
  6. MQTT_BROKER_GLOBAL = "mqtt.eclipseprojects.io"
  7. RASPI_CLIENT_ID = "smart_farming_raspi"
  8. BACKEND_CLIENT_ID = "smart_farming_server"
  9. # Topics:
  10. Topics = {
  11. "ROBOT_ACTION_DRIVE": "ROBOT/ACTION/DRIVE",
  12. "ROBOT_ACTION_GETPOSITION": "ROBOT/ACTION/GETPOSITION",
  13. "ROBOT_ACTION_GETBATTERY": "ROBOT/ACTION/GETBATTERY",
  14. "ROBOT_DATA_SENSORDATA": "ROBOT/DATA/SENSORDATA",
  15. "ROBOT_DATA_BATTERY": "ROBOT/DATA/BATTERY",
  16. "ROBOT_DATA_POSITION": "ROBOT/DATA/POSITION",
  17. "ROBOT_DATA_PICTURE": "ROBOT/DATA/PICTURE",
  18. "BACKEND_ACTION_DRIVE": "BACKEND/ACTION/DRIVE",
  19. "BACKEND_ACTION_DRIVEPALL": "BACKEND/ACTION/DRIVEALL",
  20. "BACKEND_ACTION_GETPOSITION": "BACKEND/ACTION/GETPOSITION",
  21. "BACKEND_ACTION_GETBATTERY": "BACKEND/ACTION/GETBATTERY",
  22. "BACKEND_ACTION_GETALLDATA": "BACKEND/ACTION/GETALLDATA",
  23. "BACKEND_ACTION_NEWPLANT": "BACKEND/ACTION/NEWPLANT",
  24. "BACKEND_ACTION_CONFIGUREPLANT": "BACKEND/ACTION/CONFIGUREPLANT",
  25. "BACKEND_ACTION_DELETEPLANT": "BACKEND/ACTION/DELETEPLANT",
  26. "BACKEND_ACTION_PLANTCOUNT": "BACKEND/ACTION/PLANTCOUNT",
  27. "BACKEND_DATA_SENSORDATA": "BACKEND/DATA/SENSORDATA",
  28. "BACKEND_DATA_SENSORDATAALL": "BACKEND/DATA/SENSORDATA_ALL",
  29. "BACKEND_DATA_POSITION": "BACKEND/DATA/POSITION",
  30. "BACKEND_DATA_BATTERY": "BACKEND/DATA/BATTERY",
  31. "BACKEND_DATA_PICTURE": "BACKEND/DATA/PICTURE",
  32. "BACKEND_DATA_PLANTCOUNT": "BACKEND/DATA/PLANTCOUNT",
  33. }
  34. # MQTT Messages:
  35. # region Robot -> Backend
  36. SENSORDATA = {
  37. "AirTemperature": 0.0,
  38. "AirHumidity": 0.0,
  39. "SoilMoisture": 0.0,
  40. "Brightness": 0,
  41. "PlantID": 0,
  42. "ActionID": 0
  43. }
  44. # TODO When sensor is available
  45. POSITION = {
  46. "Position": ""
  47. }
  48. BATTERY = {
  49. "Battery": 0.0
  50. }
  51. # endregion
  52. # region Backend -> Robot
  53. DRIVE = {
  54. "PlantID": 0,
  55. "ActionID": 0
  56. }
  57. # GETPOSITION -> no message needed
  58. # GETBATTERY -> no message needed
  59. # endregion
  60. # region Backend -> Frontend
  61. PLANTDATA = {
  62. "AirTemperature": 0.0,
  63. "AirHumidity": 0.0,
  64. "SoilMoisture": 0.0,
  65. "Brightness": 0,
  66. "PlantID": 0,
  67. "Timestamp": "",
  68. "MeasurementID": 0,
  69. "PlantName": ""
  70. }
  71. ALLPLANTDATA = [
  72. PLANTDATA,
  73. PLANTDATA,
  74. PLANTDATA,
  75. PLANTDATA,
  76. PLANTDATA,
  77. PLANTDATA
  78. ]
  79. # TODO When sensor is available
  80. POSITION = {
  81. "Position": "",
  82. "Timestamp": ""
  83. }
  84. BATTERY = {
  85. "Battery": 0.0,
  86. "Timestamp": ""
  87. }
  88. PLANTCOUNT = {
  89. "CurrenCount": 0,
  90. "maxCount": 0
  91. }
  92. # endregion
  93. # region Frontend -> Backend
  94. DRIVE = {
  95. "PlantName": ""
  96. }
  97. NEWPLANT = PLANTDATA
  98. CONFIGUREPLANT = PLANTDATA
  99. DELETEPLANT = {
  100. "PlantID": ""
  101. }
  102. # DRIVEALL -> no message needed
  103. # GETPOSITION -> no message needed
  104. # GETBATTERY -> no message needed
  105. # GETALLDATA -> no message needed
  106. # endregion