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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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 = "lorem ipsum"
  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_GETPOSITION": "BACKEND/ACTION/GETPOSITION",
  20. "BACKEND_ACTION_GETBATTERY": "BACKEND/ACTION/GETBATTERY",
  21. "BACKEND_ACTION_GETALLDATA": "BACKEND/ACTION/GETALLDATA",
  22. "BACKEND_DATA_SENSORDATA": "BACKEND/DATA/SENSORDATA",
  23. "BACKEND_DATA_SENSORDATAALL": "BACKEND/DATA/SENSORDATA_ALL",
  24. "BACKEND_DATA_POSITION": "BACKEND/DATA/POSITION",
  25. "BACKEND_DATA_BATTERY": "BACKEND/DATA/BATTERY",
  26. "BACKEND_DATA_PICTURE": "BACKEND/DATA/PICTURE"
  27. }
  28. # MQTT Messages:
  29. # region Robot -> Backend
  30. SENSORDATA = {
  31. "AirTemperature": 0.0,
  32. "AirHumidity" : 0.0,
  33. "SoilMoisture" : 0.0,
  34. "Brightness" : 0,
  35. "PlantID": 0,
  36. "ActionID": 0
  37. }
  38. # TODO When sensor is available
  39. POSITION = {
  40. "Position": ""
  41. }
  42. BATTERY = {
  43. "Battery": 0.0
  44. }
  45. # endregion
  46. # region Backend -> Robot
  47. DRIVE = {
  48. "PlantID": 0,
  49. "ActionID": 0
  50. }
  51. # GETPOSITION -> no message needed
  52. # GETBATTERY -> no message needed
  53. # endregion
  54. # region Backend -> Frontend
  55. PLANTDATA = {
  56. "AirTemperature": 0.0,
  57. "AirHumidity" : 0.0,
  58. "SoilMoisture" : 0.0,
  59. "Brightness" : 0,
  60. "PlantID": 0,
  61. "Timestamp": "",
  62. "MeasurementID": 0
  63. }
  64. ALLPLANTDATA = [
  65. PLANTDATA,
  66. PLANTDATA,
  67. PLANTDATA,
  68. PLANTDATA,
  69. PLANTDATA,
  70. PLANTDATA
  71. ]
  72. # TODO When sensor is available
  73. POSITION = {
  74. "Position": "",
  75. "Timestamp": ""
  76. }
  77. BATTERY = {
  78. "Battery": 0.0,
  79. "Timestamp": ""
  80. }
  81. # endregion
  82. # region Frontend -> Backend
  83. DRIVE = {
  84. "PlantID": 0
  85. }
  86. # GETPOSITION -> no message needed
  87. # GETBATTERY -> no message needed
  88. # GETALLDATA -> no message needed
  89. # endregion