Since the AR view uses the camera, this means the connection has to be secure using ssl. MQTT was added to the AR code, but it can’t communicate over websockets – it has to be secure websockets. The next step will be to generate certificates for the ssl connection.
Sending updates from an ESP32 device to the MQTT server is working! Right now, it’s just barebones running with default values for GPS latitude, longitude, and a random number for air temperature. Ran in to a few issues with library selection, but that was easily remedied. It took some time to test the types that are sent and the precision. Once it started to work, was simple. The library being used will retry connection to the MQTT server in 15 seconds if it loses connection. The next steps are either AR view, score counter, or making the sensor device. Tune in for the next log to see which one of those is chosen.
Next step is to start adding new devices to the map – so on to the hardware with MQTT on an ESP32.
The array of Device objects is being updated with the data from MQTT. Presently, all devices (the 51 logs) are being stored as a test. This will then be used to display dots on the map. The console shows 50 Devices added to the array, not 51, however forever list verifies that 51 devices of loglooper are running. There’s an off-by-one error somewhere, and that has to be debugged. Currently the latitude and longitude are being sent in separate messages. They will need to be combined into one message, to make search faster for seeing if that coordinate is displayed on-screen or not. That will let us keep in memory only what is needed to be there! Next step is debugging, display of all the dots on the map, then refactoring the lat & lon messages.