linenoise library on USB JTAG/serial console on ESP32-S3
Posted: Tue May 21, 2024 6:06 pm
Has any had any success using this? linenoise library on USB JTAG/serial console on ESP32-S3?
I only want to use linenoise, not the whole esp_console shebang, I have my own command parser which is more complex than esp_console can offer.
What am I doing:
- added "console" component
- include "linenoise/linenoise.h"
- call linenoise(" >"), nothing else
- this runs on the USB JTAG/serial console of the S3, which is the main console port and the secondary console port (UART) has been disabled.
What I expect:
- using idf.py monitor
- a line editor that sends my edited line to my application
What I am experiencing:
- linenoise continuously returning with NULL or small fragments that look like colour escape codes, but may be small bits of logging too.
- when I make a small test loop that only reads from input fd (0) en writes to output fd (1), it just works. No editing though, of course. So I guess there should be no technical reason why this couldn't work.
Looking at the source code of linenoise it seems it mainly returns for not being able to allocate memory (calloc) which will not be the issue here, because I have 2200 kB available for malloc/calloc.
I only want to use linenoise, not the whole esp_console shebang, I have my own command parser which is more complex than esp_console can offer.
What am I doing:
- added "console" component
- include "linenoise/linenoise.h"
- call linenoise(" >"), nothing else
- this runs on the USB JTAG/serial console of the S3, which is the main console port and the secondary console port (UART) has been disabled.
What I expect:
- using idf.py monitor
- a line editor that sends my edited line to my application
What I am experiencing:
- linenoise continuously returning with NULL or small fragments that look like colour escape codes, but may be small bits of logging too.
- when I make a small test loop that only reads from input fd (0) en writes to output fd (1), it just works. No editing though, of course. So I guess there should be no technical reason why this couldn't work.
Looking at the source code of linenoise it seems it mainly returns for not being able to allocate memory (calloc) which will not be the issue here, because I have 2200 kB available for malloc/calloc.