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.3KB

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