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 3.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  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_DRIVEALL": "ROBOT/ACTION/DRIVEALL",
  13. "ROBOT_ACTION_GETPOSITION": "ROBOT/ACTION/GETPOSITION",
  14. "ROBOT_ACTION_GETBATTERY": "ROBOT/ACTION/GETBATTERY",
  15. "ROBOT_DATA_SENSORDATA": "ROBOT/DATA/SENSORDATA",
  16. "ROBOT_DATA_BATTERY": "ROBOT/DATA/BATTERY",
  17. "ROBOT_DATA_POSITION": "ROBOT/DATA/POSITION",
  18. "ROBOT_DATA_PICTURE": "ROBOT/DATA/PICTURE",
  19. "ROBOT_DATA_ERROR": "ROBOT/DATA/ERROR",
  20. "ROBOT_DATA_ROBOTREADY": "ROBOT/DATA/ROBOTREADY",
  21. "ROBOT_DATA_PICTURE": "ROBOT/DATA/PICTURE",
  22. "BACKEND_ACTION_DRIVE": "BACKEND/ACTION/DRIVE",
  23. "BACKEND_ACTION_DRIVEPALL": "BACKEND/ACTION/DRIVEALL",
  24. "BACKEND_ACTION_GETPOSITION": "BACKEND/ACTION/GETPOSITION",
  25. "BACKEND_ACTION_GETBATTERY": "BACKEND/ACTION/GETBATTERY",
  26. "BACKEND_ACTION_GETALLDATA": "BACKEND/ACTION/GETALLDATA",
  27. "BACKEND_ACTION_NEWPLANT": "BACKEND/ACTION/NEWPLANT",
  28. "BACKEND_ACTION_CONFIGUREPLANT": "BACKEND/ACTION/CONFIGUREPLANT",
  29. "BACKEND_ACTION_DELETEPLANT": "BACKEND/ACTION/DELETEPLANT",
  30. "BACKEND_ACTION_PLANTCOUNT": "BACKEND/ACTION/PLANTCOUNT",
  31. "BACKEND_DATA_SENSORDATA": "BACKEND/DATA/SENSORDATA",
  32. "BACKEND_DATA_SENSORDATAALL": "BACKEND/DATA/SENSORDATA_ALL",
  33. "BACKEND_DATA_POSITION": "BACKEND/DATA/POSITION",
  34. "BACKEND_DATA_BATTERY": "BACKEND/DATA/BATTERY",
  35. "BACKEND_DATA_PICTURE": "BACKEND/DATA/PICTURE",
  36. "BACKEND_DATA_PLANTCOUNT": "BACKEND/DATA/PLANTCOUNT",
  37. "BACKEND_DATA_ERROR": "BACKEND/DATA/ERROR",
  38. "BACKEND_DATA_ROBOTREADY": "BACKEND/DATA/ROBOTREADY"
  39. }
  40. # MQTT Messages:
  41. # region Robot -> Backend
  42. SENSORDATA = {
  43. "AirTemperature": 0.0,
  44. "AirHumidity": 0.0,
  45. "SoilMoisture": 0.0,
  46. "Brightness": 0,
  47. "PlantID": 0,
  48. "ActionID": ""
  49. }
  50. # TODO When sensor is available
  51. POSITION = {
  52. "Position": ""
  53. }
  54. BATTERY = {
  55. "Battery": 0.0
  56. }
  57. # endregion
  58. # region Backend -> Robot
  59. DRIVE = {
  60. "PlantID": 0,
  61. "ActionID": ""
  62. }
  63. DRIVEALL = {
  64. "PlantIDs": [],
  65. "ActionID": ""
  66. }
  67. # GETPOSITION -> no message needed
  68. # GETBATTERY -> no message needed
  69. # endregion
  70. # region Backend -> Frontend
  71. PLANTDATA = {
  72. "AirTemperature": 0.0,
  73. "AirHumidity": 0.0,
  74. "SoilMoisture": 0.0,
  75. "Brightness": 0,
  76. "PlantID": 0,
  77. "Timestamp": "",
  78. "MeasurementID": 0,
  79. "PlantName": ""
  80. }
  81. ALLPLANTDATA = [
  82. PLANTDATA,
  83. PLANTDATA,
  84. PLANTDATA,
  85. PLANTDATA,
  86. PLANTDATA,
  87. PLANTDATA
  88. ]
  89. # TODO When sensor is available
  90. POSITION = {
  91. "Position": "",
  92. "Timestamp": ""
  93. }
  94. BATTERY = {
  95. "Battery": 0.0,
  96. "Timestamp": ""
  97. }
  98. PLANTCOUNT = {
  99. "CurrenCount": 0,
  100. "maxCount": 0
  101. }
  102. # endregion
  103. # region Frontend -> Backend
  104. DRIVE = {
  105. "PlantName": ""
  106. }
  107. NEWPLANT = PLANTDATA
  108. CONFIGUREPLANT = PLANTDATA
  109. DELETEPLANT = {
  110. "PlantID": ""
  111. }
  112. # DRIVEALL -> no message needed
  113. # GETPOSITION -> no message needed
  114. # GETBATTERY -> no message needed
  115. # GETALLDATA -> no message needed
  116. # endregion