In our IoT project, we use the Google Text-to-Speech API to enable our devices to speak. However, we've noticed that occasionally the devices produce speech that doesn't align with our expectations, suggesting a possible issue with the text being sent to the API. The main problem is that our IoT device doesn’t currently log these requests, and we can't easily modify the firmware to add this functionality. Furthermore, the URLs for the API requests are fixed and cannot be altered. This makes it challenging to diagnose and correct the issue, as we have no record of what text is being sent to the API at any given time.
We initially considered modifying the device's firmware to implement logging, but this proved to be infeasible due to the complexity and risk of altering the firmware in our constrained IoT environment. We also looked into redirecting our API requests through a proxy that could log the text, but this isn't possible as we cannot change the API request URLs. Our expectation was to create a logging mechanism that would help us identify and resolve the discrepancies in the speech output, but our attempts were hindered by these constraints. As a result, we are still facing the issue of unexpected speech outputs without a clear method to trace or debug the root cause.