Open cookpate opened 1 year ago
This actually looks more like a race condition in LogInfo for this demo. IT should have printed out an example job, but this is an example console output in the ESP-IDF 4.2 PowerShell window:
14 495 [iot_thread] [jobs_demo.c:833] [INFO] [JobsDemo]
/*-----------------------------------------------------------*/
The Jobs demo is now ready to accept Jobs.
https://docs.aws.amazon.com/cli/latest/reference/iot/create-job.htmlJobsDemo]
- print ] [jobs_demo.c:843] [INFO] [JobsDemo] key.
Logs a message to the local console. The Job document must also contain a "message".
- publish "action17 495 [iot_thread] [jobs_demo.c:846] [INFO] [JobsDemo]
Publishes a message to an MQTT topic. The Job document must also contain a "message" and "topic".
For example: { "action": "publish", "topic": "demo/jobs", "message": "Hello world!"} will cause
- exit to be published 19 495 [iot_thread] [jobs_demo.c:854] [INFO] [JobsDemo]
Exits the demo program. This program will run until { "action": "exit" } is received.
/*--------------------20 495 [iot_thread] [mqtt_demo_helpers.c:565] [INFO] [MQTT] Attempt to subscribe to the MQTT topic $aws/things/cookpateESP32-TestBoard/jobs/notify-next.
This is printed out from here: https://github.com/aws/amazon-freertos/blob/49e7fe5d667362ce90bcd03b12633361d6e6f220/demos/jobs_for_aws/jobs_demo.c#L828-L854
Ah, it looks like the carriage return at the beginning of log messages isn't overwriting the current line. It's a hacky way of suppressing the log message header.
Describe the bug A help message is printed out when the jobs_for_aws demo first runs. On the ESP32 DevKit at least, the message ends up clobbered and doesn't print out in full. I initially thought I was going to a dead link in the docs.
System information
Expected behavior The help message should be displayed in full without any clobbering as shown: https://github.com/aws/amazon-freertos/blob/49e7fe5d667362ce90bcd03b12633361d6e6f220/demos/jobs_for_aws/jobs_demo.c#L828-L854
Screenshots or console output
Steps to reproduce bug Example: