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

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