The latest version works for me using HTTP. Having an MQTT server I decided to reflash the
ESP32 with MQTT enabled and try it. The mower connects to the server fine but I seem to have an issue with cassandra as whilst it connects to MQTT and subscribes it fails to update the dashboard which permanantly shows offline. I have attached a file which shows it seems to 'fails to publish' . I'm running a standard Mosquitto server and the
ESP32 code is as published with sunray 298. You will see towards the end I just tried to turn the mower
motor on / off.
Tried to attach the debug file but couldn't so have edited out some of the success messages to save space.
Rgds Clive
Jun 08 07:48:10 cassandra systemd[1]: Started CaSSAndRA.
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Found GEOS DLL: <CDLL '/home/ardumower/.local/lib/python3.9/site-packages/Shapely.libs/libgeos_c-17b902da.so.1.16.0', handle 29ad3790 at 0x7f796d9be0>, using it.
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 INFO Backend: Starting backend server
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG absolute_path: /home/ardumower/CaSSAndRA/CaSSAndRA/src/backend
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 INFO Backend: Read communication config file
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Opening commcfg.json
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Path to commcfg.json: /src/data/user/commcfg.json
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG commcfg.json content: {'USE': 'MQTT', 'MQTT': [{'CLIENT_ID': 'Ardumower'}, {'USERNAME': ''}, {'PASSWORD': ''}, {'MQTT_SERVER': '192.168.1.22'}, {'PORT': 1883}, {'MOWER_NAME': '/ardumower/Ardumower'}], 'HTTP': [{'IP': '
http://192.168.1.1'}, {'PASSWORD': '123456'}], 'UART': [{'SERPORT': '/dev/ttyACM0'}, {'BAUDRATE': 115200}]}
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 INFO Backend: Used connection: MQTT
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Checking connection data
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Connection data are valid
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 INFO Backend: Read map config file
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Opening mapcfg.json
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Path to mapcfg.json: /src/data/user/mapcfg.json
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG mapcfg.json content: {'MOWOFFSET': 0.18, 'MOWANGLE': 140, 'MOWEDGE': 'yes', 'DISTANCETOBORDER': 2, 'PATTERN': 'lines', 'POSITIONMODE': 'relative', 'LON': 0, 'LAT': 0}
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Values for mapcfg. mowoffset: 0.18 mowangle: 140 distance to border: 2 pattern: lines mowedge: yes
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 INFO Backend: Read app config file
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Opening appcfg.json
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Path to appcfg.json: /src/data/user/appcfg.json
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG appcfg.json content: {'datamaxage': 30, 'voltage_to_soc': [{'V': 22.5, 'SoC': 0}, {'V': 28.7, 'SoC': 100}], 'time_to_offline': 60, 'current_thd_charge': -0.03}
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 DEBUG Values for appcfg. datamaxage: 30 time until offline: 60 soc look up table: [{'V': 22.5, 'SoC': 0}, {'V': 28.7, 'SoC': 100}]
Jun 08 07:48:14 cassandra python3[1706]: 2023-06-08 07:48:14 INFO Backend: Read saved data
Jun 08 07:48:15 cassandra python3[1706]: 2023-06-08 07:48:15 INFO Backend: State data are loaded successfully
Jun 08 07:48:15 cassandra python3[1706]: 2023-06-08 07:48:15 INFO Backend: Statistics data are loaded successfully
Jun 08 07:48:15 cassandra python3[1706]: 2023-06-08 07:48:15 INFO Backend: Calced data from state are loaded successfully
Jun 08 07:48:15 cassandra python3[1706]: 2023-06-08 07:48:15 INFO Backend: Calced data from stats are loaded successfully
Jun 08 07:48:15 cassandra python3[1706]: 2023-06-08 07:48:15 INFO Backend: Read map data file
Jun 08 07:48:15 cassandra python3[1706]: 2023-06-08 07:48:15 INFO Backend: Saved perimeters are loaded successfully
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 INFO Backend: Perimeter name is successfully saved in tmp.json
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 INFO Backend: Selected perimeter: Meadow_Ct
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 INFO Backend: Establishing MQTT connection to the MQTT-Server
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 INFO Backend: Connection to the MQTT-Server succsessfull
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 INFO Backend: Starting server thread
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 DEBUG Backend: Starting MQTT client loop
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 INFO Backend: Backend is successfully started
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 DEBUG MQTT: publish: /ardumower/Ardumower/command with message: AT+P,0,0,0
Jun 08 07:48:21 cassandra python3[1706]: 2023-06-08 07:48:21 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:48:22 cassandra python3[1706]: 2023-06-08 07:48:22 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:48:23 cassandra python3[1706]: Dash is running on
http://0.0.0.0:8050/
Jun 08 07:48:23 cassandra python3[1706]: 2023-06-08 07:48:23 INFO Dash is running on
http://0.0.0.0:8050/
Jun 08 07:48:23 cassandra python3[1706]: * Serving Flask app 'app'
Jun 08 07:48:23 cassandra python3[1706]: * Debug mode: off
Jun 08 07:48:23 cassandra python3[1706]: 2023-06-08 07:48:23 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:48:23 cassandra python3[1706]: 2023-06-08 07:48:23 ERROR Exception on /_dash-update-component [POST]
Jun 08 07:48:23 cassandra python3[1706]: Traceback (most recent call last):
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/dash/dash.py", line 1230, in dispatch
Jun 08 07:48:23 cassandra python3[1706]: cb = self.callback_map[output]
Jun 08 07:48:23 cassandra python3[1706]: KeyError: 'speedsetpoint-offcanvas.children'
Jun 08 07:48:23 cassandra python3[1706]: The above exception was the direct cause of the following exception:
Jun 08 07:48:23 cassandra python3[1706]: Traceback (most recent call last):
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
Jun 08 07:48:23 cassandra python3[1706]: response = self.full_dispatch_request()
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: rv = self.handle_user_exception(e)
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: rv = self.dispatch_request()
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/dash/dash.py", line 1279, in dispatch
Jun 08 07:48:23 cassandra python3[1706]: raise KeyError(msg) from missing_callback_function
Jun 08 07:48:23 cassandra python3[1706]: KeyError: "Callback function not found for output 'speedsetpoint-offcanvas.children', perhaps you forgot to prepend the '@'?"
Jun 08 07:48:23 cassandra python3[1706]: 2023-06-08 07:48:23 ERROR Exception on /_dash-update-component [POST]
Jun 08 07:48:23 cassandra python3[1706]: Traceback (most recent call last):
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/dash/dash.py", line 1230, in dispatch
Jun 08 07:48:23 cassandra python3[1706]: cb = self.callback_map[output]
Jun 08 07:48:23 cassandra python3[1706]: KeyError: 'modal-info-body.children'
Jun 08 07:48:23 cassandra python3[1706]: The above exception was the direct cause of the following exception:
Jun 08 07:48:23 cassandra python3[1706]: Traceback (most recent call last):
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
Jun 08 07:48:23 cassandra python3[1706]: response = self.full_dispatch_request()
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: rv = self.handle_user_exception(e)
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: rv = self.dispatch_request()
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/dash/dash.py", line 1279, in dispatch
Jun 08 07:48:23 cassandra python3[1706]: raise KeyError(msg) from missing_callback_function
Jun 08 07:48:23 cassandra python3[1706]: KeyError: "Callback function not found for output 'modal-info-body.children', perhaps you forgot to prepend the '@'?"
Jun 08 07:48:23 cassandra python3[1706]: 2023-06-08 07:48:23 ERROR Exception on /_dash-update-component [POST]
Jun 08 07:48:23 cassandra python3[1706]: Traceback (most recent call last):
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/dash/dash.py", line 1230, in dispatch
Jun 08 07:48:23 cassandra python3[1706]: cb = self.callback_map[output]
Jun 08 07:48:23 cassandra python3[1706]: KeyError: '..state-map.figure...interval.disabled@9c808abcc9bc812598b8db4ac4a08413..'
Jun 08 07:48:23 cassandra python3[1706]: The above exception was the direct cause of the following exception:
Jun 08 07:48:23 cassandra python3[1706]: Traceback (most recent call last):
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 2190, in wsgi_app
Jun 08 07:48:23 cassandra python3[1706]: response = self.full_dispatch_request()
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1486, in full_dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: rv = self.handle_user_exception(e)
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1484, in full_dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: rv = self.dispatch_request()
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/flask/app.py", line 1469, in dispatch_request
Jun 08 07:48:23 cassandra python3[1706]: return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
Jun 08 07:48:23 cassandra python3[1706]: File "/home/ardumower/.local/lib/python3.9/site-packages/dash/dash.py", line 1279, in dispatch
Jun 08 07:48:23 cassandra python3[1706]: raise KeyError(msg) from missing_callback_function
Jun 08 07:48:23 cassandra python3[1706]: KeyError: "Callback function not found for output '..state-map.figure...interval.disabled@9c808abcc9bc812598b8db4ac4a08413..', perhaps you forgot to prepend the '@'?"
Jun 08 07:48:24 cassandra python3[1706]: 2023-06-08 07:48:24 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:48:25 cassandra python3[1706]: 2023-06-08 07:48:25 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
06-08 07:49:34 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:49:35 cassandra python3[1706]: 2023-06-08 07:49:35 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:49:36 cassandra python3[1706]: 2023-06-08 07:49:36 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:49:37 cassandra python3[1706]: 2023-06-08 07:49:37 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:49:38 cassandra python3[1706]: 2023-06-08 07:49:38 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
:27 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:29 cassandra python3[1706]: 2023-06-08 07:50:29 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:30 cassandra python3[1706]: 2023-06-08 07:50:30 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:31 cassandra python3[1706]: 2023-06-08 07:50:31 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:32 cassandra python3[1706]: 2023-06-08 07:50:32 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:33 cassandra python3[1706]: 2023-06-08 07:50:33 WARNING Backend: MQTT failed to publish: /ardumower/Ardumower/command with message: AT+C,1,-1,-1,-1,-1,-1,-1,-1
Jun 08 07:50:33 cassandra python3[1706]: 2023-06-08 07:50:33 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:34 cassandra python3[1706]: 2023-06-08 07:50:34 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:35 cassandra python3[1706]: 2023-06-08 07:50:35 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:37 cassandra python3[1706]: 2023-06-08 07:50:37 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:38 cassandra python3[1706]: 2023-06-08 07:50:38 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:38 cassandra python3[1706]: 2023-06-08 07:50:38 WARNING Backend: MQTT failed to publish: /ardumower/Ardumower/command with message: AT+C,0,-1,-1,-1,-1,-1,-1,-1
Jun 08 07:50:39 cassandra python3[1706]: 2023-06-08 07:50:39 INFO Backend: Subscriptions to the rover MQTT topics succsessfull
Jun 08 07:50:40 cassandra python3[1706]: 2023-06-08 07:50:40 INFO Backend: Subscriptions to the rover MQTT topics succsessfull