[Telnet] Random chars in command
-
This is a long standing problem (not just v3.5.1). It's not recurrent but still, it's an annoying one. Sometimes when I connect via telnet to my duet I get random chars.
Example:
another example:
^M
is when I pressEnter
and^?
forBackspace
Closing connection and opening again works fine
This happens on Linux and on Mac.
Any idea of what is going on here?
-
@AndMaz Which Duet board, WiFi or Ethernet? If you could do an M122 while it's happening, and another when it's fine, there maybe some information in the Network diagnostics that might be useful.
Ian
-
@AndMaz In general RRF does not support the use of editing keys (like backspace or the arrow keys) when reading text so it will be seeing the backspace characters you are typing as invalid values. Not sure about the other invalid characters, if enter is causing problems you may need to change what character the enter key is sending in your terminal program.
-
@droftarts @gloomyandy I'm using Duet 2 Ethernet.
In general RRF does not support the use of editing keys (like backspace or the arrow keys) when reading text so it will be seeing the backspace characters you are typing as invalid values.
If enter is causing problems you may need to change what character the enter key is sending in your terminal program.Both
enter
andbackspace
work fine when telnet works "properly". The other keys are not so important to meWhen it misbehaves it "magically" adds random chars, as in the
echo 1
command that's shown in the first image.Network diagnostics that might be useful
Yep, I'll keep you updated.
-
@AndMaz I think it would help if you could tell us exactly what it is you are typing (including and backspace or other keys) when you get this output (along with exactly what output you get). So for instance do you ever get this extra output if you just type the command correctly (no editing of the line) and hit enter?
-
@gloomyandy said in [Telnet] Random chars in command:
So for instance do you ever get this extra output if you just type the command correctly (no editing of the line) and hit enter?
Yep, I do. As shown in prints above simple
echo 1
producesBad command 0x03]0x18]0x1f]0x05] echo 1
. There's no special chars in here nor it's a copy-paste -
-
Here's the M122, obtained via HTTP, when telnet is showing "Bad Command" error for
echo 123
:Escape character is '^]'. echo 123 Error: Bad command: 0x03]0x18]0x1f]0x05]echo 123 ok M122 Error: Bad command: M122 ok
=== Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.5.1 (2024-04-19 14:40:46) running on Duet Ethernet 1.02 or later Board ID: Used output buffers: 1 of 26 (26 max) Error in macro line 182 while starting up: I2C transmission error === RTOS === Static ram: 23256 Dynamic ram: 77288 of which 0 recycled Never used RAM 4032, free system stack 172 words Tasks: NETWORK(1,ready,34.5%,179) HEAT(3,nWait 5,0.1%,330) Move(4,nWait 5,0.0%,359) MAIN(1,running,65.4%,660) IDLE(0,ready,0.0%,29), total 100.0% Owned mutexes: === Platform === Last reset 184:52:29 ago, cause: software Last software reset at 2024-05-13 14:28, reason: User, Gcodes spinning, available RAM 3320, slot 2 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x0c Aux0 errors 0,0,0 MCU temperature: min 36.5, current 37.0, max 37.1 Supply voltage: min 23.7, current 23.8, max 23.8, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 297/201, heap memory allocated/used/recyclable 6144/5672/1340, gc cycles 18345 Events: 0 queued, 0 completed Driver 0: standstill, SG min n/a Driver 1: standstill, SG min n/a Driver 2: standstill, SG min n/a Driver 3: standstill, SG min n/a Driver 4: standstill, SG min n/a Driver 5: Driver 6: Driver 7: Driver 8: Driver 9: Driver 10: Driver 11: Date/time: 2024-05-21 07:21:05 Cache data hit count 4294967295 Slowest loop: 7.23ms; fastest: 0.15ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0 === Storage === Free file entries: 7 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest read time 3.5ms, write time 0.0ms, max retries 0 === Move === DMs created 83, segments created 0, maxWait 0ms, bed compensation in use: none, height map offset 0.000, max steps late 0, min interval 0, bad calcs 0, ebfmin 0.00, ebfmax 0.00 no step interrupt scheduled Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0 === DDARing 0 === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters -1 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 === GCodes === Movement locks held by null HTTP is idle in state(s) 0 Telnet is idle in state(s) 0 File is doing "G4 S15" in state(s) 0 0, running macro USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 Daemon is idle in state(s) 0 Autopause is idle in state(s) 0 Q0 segments left 0 Code queue 0 is empty === Network === Slowest loop: 9.95ms; fastest: 0.07ms Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(1) HTTP sessions: 1 of 8 Interface state active, link 100Mbps full duplex Socket states: 5 2 2 2 1 3
and here's when telnet is ok
=== Diagnostics === RepRapFirmware for Duet 2 WiFi/Ethernet version 3.5.1 (2024-04-19 14:40:46) running on Duet Ethernet 1.02 or later Board ID: Used output buffers: 1 of 26 (26 max) Error in macro line 182 while starting up: I2C transmission error === RTOS === Static ram: 23256 Dynamic ram: 77288 of which 0 recycled Never used RAM 4032, free system stack 172 words Tasks: NETWORK(1,ready,33.9%,179) HEAT(3,nWait 5,0.1%,330) Move(4,nWait 5,0.0%,359) MAIN(1,running,66.0%,660) IDLE(0,ready,0.0%,29), total 100.0% Owned mutexes: === Platform === Last reset 184:53:20 ago, cause: software Last software reset at 2024-05-13 14:28, reason: User, Gcodes spinning, available RAM 3320, slot 2 Software reset code 0x0003 HFSR 0x00000000 CFSR 0x00000000 ICSR 0x0041f000 BFAR 0xe000ed38 SP 0x00000000 Task MAIN Freestk 0 n/a Error status: 0x0c Aux0 errors 0,0,0 MCU temperature: min 36.5, current 36.8, max 37.2 Supply voltage: min 23.7, current 23.8, max 23.8, under voltage events: 0, over voltage events: 0, power good: yes Heap OK, handles allocated/used 297/201, heap memory allocated/used/recyclable 6144/4736/404, gc cycles 18347 Events: 0 queued, 0 completed Driver 0: standstill, SG min n/a Driver 1: standstill, SG min n/a Driver 2: standstill, SG min n/a Driver 3: standstill, SG min n/a Driver 4: standstill, SG min n/a Driver 5: Driver 6: Driver 7: Driver 8: Driver 9: Driver 10: Driver 11: Date/time: 2024-05-21 07:21:56 Cache data hit count 4294967295 Slowest loop: 4.57ms; fastest: 0.22ms I2C nak errors 0, send timeouts 0, receive timeouts 0, finishTimeouts 0, resets 0 === Storage === Free file entries: 7 SD card 0 detected, interface speed: 20.0MBytes/sec SD card longest read time 3.2ms, write time 1.1ms, max retries 0 === Move === DMs created 83, segments created 0, maxWait 0ms, bed compensation in use: none, height map offset 0.000, max steps late 0, min interval 0, bad calcs 0, ebfmin 0.00, ebfmax 0.00 no step interrupt scheduled Moves shaped first try 0, on retry 0, too short 0, wrong shape 0, maybepossible 0 === DDARing 0 === Scheduled moves 0, completed 0, hiccups 0, stepErrors 0, LaErrors 0, Underruns [0, 0, 0], CDDA state -1 === Heat === Bed heaters -1 -1 -1 -1, chamber heaters -1 -1 -1 -1, ordering errs 0 === GCodes === Movement locks held by null HTTP is idle in state(s) 0 Telnet is idle in state(s) 0 File is doing "G4 S15" in state(s) 0 0, running macro USB is idle in state(s) 0 Aux is idle in state(s) 0 Trigger is idle in state(s) 0 Queue is idle in state(s) 0 LCD is idle in state(s) 0 Daemon is idle in state(s) 0 Autopause is idle in state(s) 0 Q0 segments left 0 Code queue 0 is empty === Network === Slowest loop: 3.72ms; fastest: 0.07ms Responder states: HTTP(0) HTTP(0) HTTP(0) FTP(0) Telnet(1) HTTP sessions: 1 of 8 Interface state active, link 100Mbps full duplex Socket states: 5 2 2 2 1 3
Sorry for @dc42 tagging you but do you have any clue on what might be causing this?
-
Related; I've been connecting to my Duet@ Wifi over USB and serial a lot recently; but also over telnet (all while working on SerialOM, which actually started out as a telnet client).
I have seen similar behaviour on all serial connection types, after a restart random chars appear in the input buffer of the duet. I have seen this on uart, USB-Serial and telnet connections, but is is very ephemeral and random. SerialOM actually has code in it's startup that sends a couple of
\n
's and ignores the response at startup; I added this specifically to address this issue.I have a 'gut feel' that something is wonky with the input and output buffer initialisation at startup. Possibly the internal MCU UART registers themselves not being properly reset and cleaned during resets? This is a guess on my part, based on observed behaviour, reality may differ substantially.
This is an example from last Tuesday; I'm connecting to my D2wifi via USB serial from a Pi3 using pyserial-miniterm.
--- Miniterm on /dev/ttyACM0 9600,8,N,1 --- --- Quit: Ctrl+] | Menu: Ctrl+T | Help: Ctrl+T followed by Ctrl+H --- g time File 0:/gcodes/bailer.gcode will print in 0h 56m plus hea Error: Bad command: WiFi module is ce ok
Context: This is a connection to the board via USB serial immediately after it was rebooted.
Before the reboot I had just finished simulating a print via the Web interface.
As you can see the Input buffer on the Duet appears to have text in it that was actually written to all serial devices before the restart when the simulation finished.
The Duet2 is still running 2.4.6, but I have seen this with earlier releases too -
I see the same behaviour since a looong time. (Linux workstation) It is a bit surprising that I see that every time when I reboot the board and keep the telnet session open. (Which obviously disconnects than) The "Random chars" appear at a reconnect. The only "fix" I found is:
Disconenct from the telnet server
reset (to reset the linux terminal session)
Connect via telnet. That fixes it in 99%.Cheers, Chriss