Open cocus opened 2 weeks ago
Hello, thank you for the report. I have tried to reproduce this but I have not been able to. Is there anything in your code that may cause this?
I'm using your example code, but using an ethernet adapter rather than WiFi. I also start the telnet server when the ethernet gets connected (blocking with the GroupBits
rtos api). Then I connect through my PC, which it works and prints the buffer. However, after disconnecting, it starts to freak out in the console. My guess is that the socket didn't close? I'm not sure, I'll add more debug to figure it out. I didn't try to phyisically disconnect the cable, but I'll see if the task ends at that case.
Just in case, this is the info about my env and chip:
IDF Version:5.3.1
Chip info:
model:ESP32
cores:2
feature:/802.11bgn/BLE/BT/External-Flash:8 MB
revision number:301
As a side note, do you know how to redirect the input from the telnet session to the stdin? I've seen some comments on this thread but I don't know if that would be compatible with your code. I assume I only need to change the stdin on the _GLOBAL_REENT
, but it doesn't make much sense to me if other tasks are already waiting on the file descriptor of stdin (like with select() or read with blocking mode).
I just want to replicate the linenoise console on telnet, since the console component of idf is quite useful.
Sounds good, let me know what you find with your debugging as the issue is hard to repro.
Redirecting stdin
in your code will not conflict with this library, probably a good addition as an option though.
Hello; I've tried the provided example with an Ethernet PHY (rather than wifi). Everything works, but there's a problem when the telnet client disconnects, which causes the RX callback to read gibberish. This is the output of said issue:
Note that the last "valid" char was ~ (I was trying the escape sequence of ssh, not the one for telnet, which is ^]). I'm running telnet on WSL, the build itself on windows.
The spam continues forever.