I am using the Console component for a serial command interface but want to also access it remotely. It seems the Console is hard-wired to UART i/o, is it possible to connect it to a network socket?
Yes. A while ago I wanted the same thing. So I created a TCP socket server on port 23 (telnet port)
Basically, whenever I want to print to that socket in my app. I just use: printft("Hello World\r\n");
Attached are the files for that. However, it's for my app and you'll have to figure out the things that are hard coded in like
CONFIG_TELNET_PORT_NUMBER, which is defined as 23, and the header files that are needed.
You will also need this part to get it going.
Code: Select all
#ifdef CONFIG_TELNET_ENABLED
// Start telnet service for printf's
xTaskCreatePinnedToCore(
TaskTelnet, // Task function.
"TaskTelnet", // name of task.
8192, // Stack size of task
NULL, // parameter of the task
CONFIG_TELNET_PRIORITY, // priority of the task
&xTaskHandleList[xtaskListCounter++], // Task handle to keep track of created task
TELNET_CPU_CORE);
#endif // CONFIG_TELNET_ENABLED