You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Nathan Hartman <ha...@gmail.com> on 2023/04/24 16:31:57 UTC
Re: Telnet broken?
I am having some trouble understanding how NSH_TELNET is supposed to
work in NuttX now. It used to work for me on real hardware.
I saw that some people had problems because of not synchronized nuttx
and apps repos, because some PRs were merged at different times. My
nuttx and apps are both based on latest master.
Recently (last couple of weeks?) there were some PRs in both repos
related to telnet, CR/LF, CLE, or I don't know what, and the behavior
changed:
Now, when I type, I see double characters, and they get mixed up, and
also seem to change with some delay. For example, if I type 'help':
[[[
$ telnet 192.168.10.100
Trying 192.168.10.100...
Connected to 192.168.10.100.
Escape character is '^]'.
NuttShell (NSH)
nsh> hehehelp
]]]
Typing 'help' and pressing Return does not work: Momentarily I see ^M
when I press Return but it is replaced by duplicated characters of
'help' and the help does not print.
Typing 'help' followed by Ctrl+J instead of Return does work and the
help does print, but there is garbage displayed momentarily.
If I change telnet mode to 'line' instead of 'character', it works
better, but then I see each line of input echoed a second time. For
example, notice how I type 'help' + Return and I see "helphelp usage"
on the next line:
[[[
$ telnet 192.168.10.100
Trying 192.168.10.100...
Connected to 192.168.10.100.
Escape character is '^]'.
NuttShell (NSH)
nsh> ^]
telnet> mode line
nsh> help
helphelp usage: help [-v] [<cmd>]
. basename dd exit ifup nslookup set
uname
[ break delroute false kill printf sleep
umount
? cat df free ls ps source
unset
addroute cd dmesg help mkdir pwd test
uptime
alias cp echo hexdump mkrd rm time
usleep
unalias cmp env ifconfig mount rmdir true
xd
arp dirname exec ifdown mv route truncate
Builtin Apps:
telnetd morsecode sh ping tmutil
ostest renew netcat nsh
nsh>
]]]
If telnet is working for you, what telnet program are you using and
what telnet settings do you have?
Thanks,
Nathan
Re: Telnet broken?
Posted by Xiang Xiao <xi...@gmail.com>.
Nathan, could you try:
https://github.com/apache/nuttx/blob/master/boards/sim/sim/sim/configs/adb/defconfig
I just try it work as expect in last mainline:
telnet 127.0.0.1 2323
Trying 127.0.0.1...
Connected to 127.0.0.1.
Escape character is '^]'.
Welcome to NuttShell(NSH) Telnet Server...
login: admin
password:
User Logged-in!
Username: admin Password: Administrator
Maybe, some configuration mismatch.
On Tue, Apr 25, 2023 at 5:06 AM Nathan Hartman <ha...@gmail.com>
wrote:
> On Mon, Apr 24, 2023 at 4:54 PM Gregory Nutt <sp...@gmail.com> wrote:
>
> >
> > > Including the doubling of characters and momentary display of some
> > > characters which seem to change rapidly?
> >
> > That probably comes from NSH. I think it still sends an escape sequence
> > to clear to the end of the line. So any additional garbage at the end
> > after the first four characters would only be present momentarily.
> >
> > But things are changing rapidly, obviously more rapidly than can be
> > tested. So I would have to studly the nshlib code again to see what it
> > is doing today.
> >
> > So do you think that that last release was too shaky? Should there be a
> > bugfix release for that one?
>
>
>
> Unfortunately I wasn't available to test and vote on the most recent
> release and I also don't currently know in exactly which commit or PR this
> broke, but it is definitely broken now, so if it has been released, then
> yes, I think it makes sense to do another release once it's fixed.
>
> I don't know how many people are using the telnet/nsh combination but I
> have to do it with this particular board since the only communication port
> it has is a network port. When telnet doesn't work correctly it really
> messes everything up for me because I can't really interface to it.
>
> Cheers
> Nathan
>
Re: Telnet broken?
Posted by Nathan Hartman <ha...@gmail.com>.
On Mon, Apr 24, 2023 at 4:54 PM Gregory Nutt <sp...@gmail.com> wrote:
>
> > Including the doubling of characters and momentary display of some
> > characters which seem to change rapidly?
>
> That probably comes from NSH. I think it still sends an escape sequence
> to clear to the end of the line. So any additional garbage at the end
> after the first four characters would only be present momentarily.
>
> But things are changing rapidly, obviously more rapidly than can be
> tested. So I would have to studly the nshlib code again to see what it
> is doing today.
>
> So do you think that that last release was too shaky? Should there be a
> bugfix release for that one?
Unfortunately I wasn't available to test and vote on the most recent
release and I also don't currently know in exactly which commit or PR this
broke, but it is definitely broken now, so if it has been released, then
yes, I think it makes sense to do another release once it's fixed.
I don't know how many people are using the telnet/nsh combination but I
have to do it with this particular board since the only communication port
it has is a network port. When telnet doesn't work correctly it really
messes everything up for me because I can't really interface to it.
Cheers
Nathan
Re: Telnet broken?
Posted by Gregory Nutt <sp...@gmail.com>.
> Including the doubling of characters and momentary display of some
> characters which seem to change rapidly?
That probably comes from NSH. I think it still sends an escape sequence
to clear to the end of the line. So any additional garbage at the end
after the first four characters would only be present momentarily.
But things are changing rapidly, obviously more rapidly than can be
tested. So I would have to studly the nshlib code again to see what it
is doing today.
So do you think that that last release was too shaky? Should there be a
bugfix release for that one?
Re: Telnet broken?
Posted by Nathan Hartman <ha...@gmail.com>.
On Mon, Apr 24, 2023 at 2:06 PM Gregory Nutt <sp...@gmail.com> wrote:
>
>
> > $ ./nuttx
> > login: admin
> > password:
> > User Logged-in!
> > nsh> duk
> > ((o) Duktape 2.5.0 (v2.5.0)
> > duk> hheellpp
> Note that only the characters sent from the remote peer and echoed by
> the driver are corrupted.
> > ReferenceError: identifier 'help' undefined
> > at [anon] (duktape/src-noline/duktape.c:83732) internal
> > at global (input:1) preventsyield
> > duk>
> Note that the actual received text is correct, only the echo back is wrong.
> > It was caused by recent carry return modifications.
>
> This seems to be the case.
Including the doubling of characters and momentary display of some
characters which seem to change rapidly?
I noticed that in the past we had a CONFIG_TELNET_CHARACTER_MODE (or
similar name). That doesn't seem to exist anymore. Are we expected to
always be in Character Mode? Line Mode? Which?
Thanks,
Nathan
Re: Telnet broken?
Posted by Gregory Nutt <sp...@gmail.com>.
> $ ./nuttx
> login: admin
> password:
> User Logged-in!
> nsh> duk
> ((o) Duktape 2.5.0 (v2.5.0)
> duk> hheellpp
Note that only the characters sent from the remote peer and echoed by
the driver are corrupted.
> ReferenceError: identifier 'help' undefined
> at [anon] (duktape/src-noline/duktape.c:83732) internal
> at global (input:1) preventsyield
> duk>
Note that the actual received text is correct, only the echo back is wrong.
> It was caused by recent carry return modifications.
This seems to be the case.
Re: Telnet broken?
Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Nathan,
Yes, same happens to duktape prompt:
$ ./nuttx
login: admin
password:
User Logged-in!
nsh> duk
((o) Duktape 2.5.0 (v2.5.0)
duk> hheellpp
ReferenceError: identifier 'help' undefined
at [anon] (duktape/src-noline/duktape.c:83732) internal
at global (input:1) preventsyield
duk>
It was caused by recent carry return modifications.
BR,
Alan
On 4/24/23, Nathan Hartman <ha...@gmail.com> wrote:
> I am having some trouble understanding how NSH_TELNET is supposed to
> work in NuttX now. It used to work for me on real hardware.
>
> I saw that some people had problems because of not synchronized nuttx
> and apps repos, because some PRs were merged at different times. My
> nuttx and apps are both based on latest master.
>
> Recently (last couple of weeks?) there were some PRs in both repos
> related to telnet, CR/LF, CLE, or I don't know what, and the behavior
> changed:
>
> Now, when I type, I see double characters, and they get mixed up, and
> also seem to change with some delay. For example, if I type 'help':
>
> [[[
>
> $ telnet 192.168.10.100
> Trying 192.168.10.100...
> Connected to 192.168.10.100.
> Escape character is '^]'.
>
> NuttShell (NSH)
> nsh> hehehelp
>
> ]]]
>
> Typing 'help' and pressing Return does not work: Momentarily I see ^M
> when I press Return but it is replaced by duplicated characters of
> 'help' and the help does not print.
>
> Typing 'help' followed by Ctrl+J instead of Return does work and the
> help does print, but there is garbage displayed momentarily.
>
> If I change telnet mode to 'line' instead of 'character', it works
> better, but then I see each line of input echoed a second time. For
> example, notice how I type 'help' + Return and I see "helphelp usage"
> on the next line:
>
> [[[
>
> $ telnet 192.168.10.100
> Trying 192.168.10.100...
> Connected to 192.168.10.100.
> Escape character is '^]'.
>
> NuttShell (NSH)
> nsh> ^]
> telnet> mode line
>
> nsh> help
> helphelp usage: help [-v] [<cmd>]
>
> . basename dd exit ifup nslookup set
> uname
> [ break delroute false kill printf sleep
> umount
> ? cat df free ls ps source
> unset
> addroute cd dmesg help mkdir pwd test
> uptime
> alias cp echo hexdump mkrd rm time
> usleep
> unalias cmp env ifconfig mount rmdir true
> xd
> arp dirname exec ifdown mv route truncate
>
> Builtin Apps:
> telnetd morsecode sh ping tmutil
> ostest renew netcat nsh
> nsh>
>
> ]]]
>
> If telnet is working for you, what telnet program are you using and
> what telnet settings do you have?
>
> Thanks,
> Nathan
>