Refactor of Host ESP32
Create a json string that is readable by the server (will be later sent). Closes #54 (closed) Major refactors and cleanup of the host code. This includes SD card specific utilities, moving logging to separate files, move commonly used definitions to a separate file. Closes #56 (closed) Renamed TimeManager to NTPManager to better reflect its purpose in the project. Try remounting SD after a number of failed attempts (see Definitions.h) Early exit continuous SD access if the SD has not been found before. Closes #47 (closed)
Merge request reports
Activity
added host label
assigned to @c7031416
Note that further improvements can be made by:
- Making the logging cleaner (i.e. separating the single function into more functions)
- Moving the ESPNow code away from the
main.cpp
file @csaw4531
some small remarks. I'm not very familiar with the host code.
- fix typo in 'received' https://git.uibk.ac.at/informatik/qe/forte/sensor-system/-/blob/fe26453f38557879ecc35d618461c47859349a2a/host/host_central_mast/src/main.cpp#L63
- as long as there is only an acknowledgement sent to the client and no tests on the received data is performed and results (errors) are transmitted to the client it should immediately be send. Especially before logging to the SD card. This minimizes wake time for clients. https://git.uibk.ac.at/informatik/qe/forte/sensor-system/-/blob/fe26453f38557879ecc35d618461c47859349a2a/host/host_central_mast/src/main.cpp#L83
- remove comment. same a few lines lower at the right spot. https://git.uibk.ac.at/informatik/qe/forte/sensor-system/-/blob/fe26453f38557879ecc35d618461c47859349a2a/host/host_central_mast/src/main.cpp#L194
can the response be send at the beginning of on_data_recv? see https://git.uibk.ac.at/informatik/qe/forte/sensor-system/-/blob/3935b9098d2c34f669640a0c3fcd51ac72372a91/host/host_central_mast/src/main.cpp
possible from my side. What do you think @csaw4531 ?
Sadly no, as it's not possible to send a message to an unregistered peer, so this check has to happen before sending the response
Then I suggest to move https://git.uibk.ac.at/informatik/qe/forte/sensor-system/-/blob/ad91360cbf7d07a06b6581f4e827fc763caa6fcd/host/host_central_mast/src/main.cpp#L63-67 past the acknowledgement.
mentioned in commit 1602d6a1