I have the situation at hand whereby I have a battery of runtime tests that test say:
1. Communication
2. I/O among others.
Some of the tests need to be run for a long time thus it would be good if posix signals were supported in the console component to end a test at user's will. Example ctrl-c (C-c) to exit cleanly and go back to the console menu. I believe this would be possible as the monitor program implements its own set of signals i.e: (ctrl-]) while the standard signals are unused which would make it a likely candidate.
Are my thoughts far fetched? How would I go about implementing the above and would it break anything.
I wouldn't mind making modification and pull request on the code-base for this if needed.
Support for posix signals over uart using console component
Re: Support for posix signals over uart using console component
I think you are going to have to describe the nature of the tests. For example, you don't say whether the tests are running exclusively on the ESP32 that is serial port connected or on a PC that is connected to the ESP32. Where is the application running that you wish to be cognizant of the interrupt instructions?
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Support for posix signals over uart using console component
Here is a recorded terminal session: https://asciinema.org/a/1sNPQn8cf3f3XRStNkNUJShZt
In brief the ESP32 is connected over serial to my computer. I send initial configurations to as an SPIFFS filesystem on my computer. The reads the configurations and esp32 writes the results of the tests chosen over console either in json or protobuf binary format to an SPIFFS filesystem on flash. I then readback the results as a SPIFFS image fromthe esp32 and unpack it on my computer for analysis.
Sometimes I would need or like to run one test after another without quiting monitor or restarting in order to analyse haphazard events.
In brief the ESP32 is connected over serial to my computer. I send initial configurations to as an SPIFFS filesystem on my computer. The reads the configurations and esp32 writes the results of the tests chosen over console either in json or protobuf binary format to an SPIFFS filesystem on flash. I then readback the results as a SPIFFS image fromthe esp32 and unpack it on my computer for analysis.
Sometimes I would need or like to run one test after another without quiting monitor or restarting in order to analyse haphazard events.
Re: Support for posix signals over uart using console component
If I'm understanding correctly, you have an ESP32 serial connected to a PC and the ESP32 is running tests directed from the PC by user entry. What you want to be able to do is have a human "signal" that you wish to interrupt the test?
I am also suspecting that there is a user written application running on the ESP32 that is receiving and processing the requests received over serial. I am then suspecting that when a command is entered, the ESP32 parses the request to run the command and then goes and executes it before examining the serial input a second time. If that is the case, it feels like you have two choices.
Your testing logic can poll the serial input while it is running and look for an interrupt character code / sequence or else you can setup an interrupt handler that asynchronously (to your running test) is fired when a character code / sequence is received over serial. In either case, I would suspect that you would set a flag and your test would examine that flag and, if set, quit early.
I am also suspecting that there is a user written application running on the ESP32 that is receiving and processing the requests received over serial. I am then suspecting that when a command is entered, the ESP32 parses the request to run the command and then goes and executes it before examining the serial input a second time. If that is the case, it feels like you have two choices.
Your testing logic can poll the serial input while it is running and look for an interrupt character code / sequence or else you can setup an interrupt handler that asynchronously (to your running test) is fired when a character code / sequence is received over serial. In either case, I would suspect that you would set a flag and your test would examine that flag and, if set, quit early.
Free book on ESP32 available here: https://leanpub.com/kolban-ESP32
Re: Support for posix signals over uart using console component
Thanks for this.I have decided to implement this as a separate task to the main code that polls the serial line for the character of interest and sets an event-group bit, which signals the end of the main task cleanly and finally deletion.kolban wrote:If I'm understanding correctly, you have an ESP32 serial connected to a PC and the ESP32 is running tests directed from the PC by user entry. What you want to be able to do is have a human "signal" that you wish to interrupt the test?
I am also suspecting that there is a user written application running on the ESP32 that is receiving and processing the requests received over serial. I am then suspecting that when a command is entered, the ESP32 parses the request to run the command and then goes and executes it before examining the serial input a second time. If that is the case, it feels like you have two choices.
Your testing logic can poll the serial input while it is running and look for an interrupt character code / sequence or else you can setup an interrupt handler that asynchronously (to your running test) is fired when a character code / sequence is received over serial. In either case, I would suspect that you would set a flag and your test would examine that flag and, if set, quit early.
Who is online
Users browsing this forum: Baidu [Spider], Gaston1980 and 123 guests