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

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