You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by Grr <ge...@gmail.com> on 2021/01/22 19:02:17 UTC

Formatted text over serial

Hello all

Is there a way to have formatted text output over serial? I want to create
some testing utility that runs from nsh and has some screen organization to
ease use

I tested pdcurses examples but they seem to depend on fb (haven't analyzed
code) and all exited or crashed with "initscr(): Unable to create SP"

Is there a builtin way to do such thing?

TIA
Grr

Re: Formatted text over serial

Posted by Ken Pettit <pe...@gmail.com>.
Sure, no problem!

Looking at the code, someone along the way changed the first calling 
parameter in that function from "FAR SCREEN *sp" to "FAR SCREEN *s".  In 
my older copy of the NuttX code, the first parameter is "FAR SCREEN *sp".

Since I know the code pretty well, I can pull down the Apache NuttX head 
and try to compile it.

Ken

On 1/22/21 11:31 AM, Grr wrote:
> Thank you for your response
>
> I searched menuconfig according to your instructions and found it.
> Compilation crashed with
>
> nuttx/pdcdisp.c:840:19: error: 'sp' undeclared (first use in this
> function); did you mean 's'?
>
> but it's a matter of debugging it. Maybe a lacking option, I'll research it
>
> Thanks again
> Grr
>
>
> El vie, 22 ene 2021 a las 13:11, Ken Pettit (<pe...@gmail.com>) escribió:
>
>> Grr,
>>
>> Actually, pdcurses has a mode that will work over serial using
>> System->Termcurses.  This is a terminal based extension to pdcurses that
>> I added a few years back.  It supports VT-100 / ANSI escape codes.  I
>> haven't tested it in the Apache NuttX framework to validate it still
>> works though.
>>
>> If you don't define CONFIG_SYSTEM_TERMCURSES, then yes, you will get an
>> error about the graphic fb creation.
>>
>> Ken
>>
>> On 1/22/21 11:02 AM, Grr wrote:
>>> Hello all
>>>
>>> Is there a way to have formatted text output over serial? I want to
>> create
>>> some testing utility that runs from nsh and has some screen organization
>> to
>>> ease use
>>>
>>> I tested pdcurses examples but they seem to depend on fb (haven't
>> analyzed
>>> code) and all exited or crashed with "initscr(): Unable to create SP"
>>>
>>> Is there a builtin way to do such thing?
>>>
>>> TIA
>>> Grr
>>>
>>


Re: Formatted text over serial

Posted by Ken Pettit <pe...@gmail.com>.
Hey Greg,

I actully tried ALL of the emulation modes offered by minicom and each 
one behaved the same.

I found that using Linux 'screen' or 'tmux' works, but neither of those 
deal with the /dev/tty device "disappearing" suddenly.

Ken

On 1/22/21 2:43 PM, Gregory Nutt wrote:
>
>>> Now examples compile and work although in flashing mode with minicom in
>>> VT102 mode
>>>
> If you start mincom with -t vt100 it should force VT100 vs VT102 
> mode.  But I thought that VT102 was mostly compatible?


Re: Formatted text over serial

Posted by Ken Pettit <pe...@gmail.com>.
Hey Johnny,

It has been a while since I ran the pdcurses with minicom, but my 
recollection is that something sets attributes of the entire display to 
blink all the time.  Plus when drawing window borders using the VT100 / 
ANSI line drawing character, you end up with a bunch of funky characters 
intsead of the nice "| ┌ ┐ └ ┘" characters.

Ken

On 1/22/21 4:18 PM, Johnny Billquist wrote:
> On 2021-01-22 23:43, Gregory Nutt wrote:
>>
>>>> Now examples compile and work although in flashing mode with 
>>>> minicom in
>>>> VT102 mode
>>>>
>> If you start mincom with -t vt100 it should force VT100 vs VT102 
>> mode. But I thought that VT102 was mostly compatible?
>
> The VT102 is a superset of the VT100. There are a couple of additional 
> functions the VT102 have, as well as by standard having a few options 
> installed that were optional on the VT100.
>
> With that said, I'm not sure what is meant by "flashing mode" here. Is 
> there some flashing effect with redrawing things, or are we talking 
> about the flashing attribute of characters, by which they blink all 
> the time?
>
>   Johnny
>


Re: Formatted text over serial

Posted by Grr <ge...@gmail.com>.
Not only everything blinks but the background color changes to some middle
scale gray and that happens with all pdcurses demos

But that's minicom. I just tested with screen and they work just fine,
color included

I kind of remember now minicom had such problems with curses 15+ years
back. It seems it's not a bug, it's a feature

El vie, 22 ene 2021 a las 19:26, Ken Pettit (<pe...@gmail.com>) escribió:

> But using tmux, I am able to get pdcurses displays like this (it
> actually has color):
>
>     File  Debug  Help
> ┌───Watch───────────────────┐
> ┌─────────────────────────────────────────────────────┐│ │
> │ ││                           │
> │                                      .     *
> ││                           │
> │                                   x     *    .
> ││                           │
> │      __  __                     *     .     x
> ││                           │
> │     /  \/  \                  .          x     .
> ││                           │
> │         \   \                     x  |\     *
> ││                           │
> │    I Q - A N A L O G                 | \ ││                           │
> │           \   \                (\,   |  \     ,/)
> ││                           │
> │            \__/\__/             \(   |___\    )/
> ││                           │
> │                                 //\  # oo #  /\\
> ││                           │
> │                                (/  \_#  * #_/  \)
> ││                           │
> │                                  \ /  ####  \ /
> ││                           │
> │      M E R L I N                  /\   ##   /\
> ││                           │
> │       Debugger                      )      (
> ││                           │
> │         v2.8                        |      |
> ││                           │
> │                                     |      |
> ││                           │
> │                                     +~~~~~~+
> ││                           │
> │ ││── Key Debug ──────────────│
> │ ││                           │
>
> └─────────────────────────────────────────────────────┘└───────────────────────────┘
>
> ┌───Command────────────────────────────────────────────────────────────────────────┐
> │ merlin> │
> │ │
> │ │
> │ │
> │ │
> │ │
>
> └──────────────────────────────────────────────────────────────────────────────────┘
>
>
> On 1/22/21 4:18 PM, Johnny Billquist wrote:
> > On 2021-01-22 23:43, Gregory Nutt wrote:
> >>
> >>>> Now examples compile and work although in flashing mode with
> >>>> minicom in
> >>>> VT102 mode
> >>>>
> >> If you start mincom with -t vt100 it should force VT100 vs VT102
> >> mode. But I thought that VT102 was mostly compatible?
> >
> > The VT102 is a superset of the VT100. There are a couple of additional
> > functions the VT102 have, as well as by standard having a few options
> > installed that were optional on the VT100.
> >
> > With that said, I'm not sure what is meant by "flashing mode" here. Is
> > there some flashing effect with redrawing things, or are we talking
> > about the flashing attribute of characters, by which they blink all
> > the time?
> >
> >   Johnny
> >
>
>

Re: Formatted text over serial

Posted by Ken Pettit <pe...@gmail.com>.
But using tmux, I am able to get pdcurses displays like this (it 
actually has color):

    File  Debug  Help
┌───Watch───────────────────┐
┌─────────────────────────────────────────────────────┐│ │
│ ││                           │
│                                      .     * 
││                           │
│                                   x     *    . 
││                           │
│      __  __                     *     .     x 
││                           │
│     /  \/  \                  .          x     . 
││                           │
│         \   \                     x  |\     * 
││                           │
│    I Q - A N A L O G                 | \ ││                           │
│           \   \                (\,   |  \     ,/) 
││                           │
│            \__/\__/             \(   |___\    )/ 
││                           │
│                                 //\  # oo #  /\\ 
││                           │
│                                (/  \_#  * #_/  \) 
││                           │
│                                  \ /  ####  \ / 
││                           │
│      M E R L I N                  /\   ##   /\ 
││                           │
│       Debugger                      )      ( 
││                           │
│         v2.8                        |      | 
││                           │
│                                     |      | 
││                           │
│                                     +~~~~~~+ 
││                           │
│ ││── Key Debug ──────────────│
│ ││                           │
└─────────────────────────────────────────────────────┘└───────────────────────────┘
┌───Command────────────────────────────────────────────────────────────────────────┐
│ merlin> │
│ │
│ │
│ │
│ │
│ │
└──────────────────────────────────────────────────────────────────────────────────┘


On 1/22/21 4:18 PM, Johnny Billquist wrote:
> On 2021-01-22 23:43, Gregory Nutt wrote:
>>
>>>> Now examples compile and work although in flashing mode with 
>>>> minicom in
>>>> VT102 mode
>>>>
>> If you start mincom with -t vt100 it should force VT100 vs VT102 
>> mode. But I thought that VT102 was mostly compatible?
>
> The VT102 is a superset of the VT100. There are a couple of additional 
> functions the VT102 have, as well as by standard having a few options 
> installed that were optional on the VT100.
>
> With that said, I'm not sure what is meant by "flashing mode" here. Is 
> there some flashing effect with redrawing things, or are we talking 
> about the flashing attribute of characters, by which they blink all 
> the time?
>
>   Johnny
>


Re: Formatted text over serial

Posted by Johnny Billquist <bq...@softjar.se>.
On 2021-01-22 23:43, Gregory Nutt wrote:
> 
>>> Now examples compile and work although in flashing mode with minicom in
>>> VT102 mode
>>>
> If you start mincom with -t vt100 it should force VT100 vs VT102 mode. 
> But I thought that VT102 was mostly compatible?

The VT102 is a superset of the VT100. There are a couple of additional 
functions the VT102 have, as well as by standard having a few options 
installed that were optional on the VT100.

With that said, I'm not sure what is meant by "flashing mode" here. Is 
there some flashing effect with redrawing things, or are we talking 
about the flashing attribute of characters, by which they blink all the 
time?

   Johnny

-- 
Johnny Billquist                  || "I'm on a bus
                                   ||  on a psychedelic trip
email: bqt@softjar.se             ||  Reading murder books
pdp is alive!                     ||  tryin' to stay hip" - B. Idol

Re: Formatted text over serial

Posted by Gregory Nutt <sp...@gmail.com>.
>> Now examples compile and work although in flashing mode with minicom in
>> VT102 mode
>>
If you start mincom with -t vt100 it should force VT100 vs VT102 mode.  
But I thought that VT102 was mostly compatible?

Re: Formatted text over serial

Posted by Ken Pettit <pe...@gmail.com>.
Yeah, I have never found a way to use pdcurses with minicom ... it 
always has flashing characters like you stated.

Ken

On 1/22/21 2:10 PM, Grr wrote:
> It also needs CONFIG_PDCURSES_MULTITHREAD or there's no PDC_ctx_free()
> definition
>
> Now examples compile and work although in flashing mode with minicom in
> VT102 mode
>
> I'll fix that later
>
> Thanks again
>
> Grr
>
> El vie, 22 ene 2021 a las 14:35, Ken Pettit (<pe...@gmail.com>) escribió:
>
>> Looks like changing  nuttx/pdcdisp.c:840 from "sp" to just "s" was the
>> only compile error.  Though going through the exercise made me remember
>> that you also need to select:
>>
>> Application Configuration --> Graphics Support --> pdcurses --> Input
>> Devices --> Terminal Input
>>
>> Otherwise you don't have any input device for pdcurses.
>>
>> Ken
>>
>>
>> On 1/22/21 11:31 AM, Grr wrote:
>>> Thank you for your response
>>>
>>> I searched menuconfig according to your instructions and found it.
>>> Compilation crashed with
>>>
>>> nuttx/pdcdisp.c:840:19: error: 'sp' undeclared (first use in this
>>> function); did you mean 's'?
>>>
>>> but it's a matter of debugging it. Maybe a lacking option, I'll research
>> it
>>> Thanks again
>>> Grr
>>>
>>>
>>> El vie, 22 ene 2021 a las 13:11, Ken Pettit (<pe...@gmail.com>)
>> escribió:
>>>> Grr,
>>>>
>>>> Actually, pdcurses has a mode that will work over serial using
>>>> System->Termcurses.  This is a terminal based extension to pdcurses that
>>>> I added a few years back.  It supports VT-100 / ANSI escape codes.  I
>>>> haven't tested it in the Apache NuttX framework to validate it still
>>>> works though.
>>>>
>>>> If you don't define CONFIG_SYSTEM_TERMCURSES, then yes, you will get an
>>>> error about the graphic fb creation.
>>>>
>>>> Ken
>>>>
>>>> On 1/22/21 11:02 AM, Grr wrote:
>>>>> Hello all
>>>>>
>>>>> Is there a way to have formatted text output over serial? I want to
>>>> create
>>>>> some testing utility that runs from nsh and has some screen
>> organization
>>>> to
>>>>> ease use
>>>>>
>>>>> I tested pdcurses examples but they seem to depend on fb (haven't
>>>> analyzed
>>>>> code) and all exited or crashed with "initscr(): Unable to create SP"
>>>>>
>>>>> Is there a builtin way to do such thing?
>>>>>
>>>>> TIA
>>>>> Grr
>>>>>
>>


Re: Formatted text over serial

Posted by Grr <ge...@gmail.com>.
It also needs CONFIG_PDCURSES_MULTITHREAD or there's no PDC_ctx_free()
definition

Now examples compile and work although in flashing mode with minicom in
VT102 mode

I'll fix that later

Thanks again

Grr

El vie, 22 ene 2021 a las 14:35, Ken Pettit (<pe...@gmail.com>) escribió:

> Looks like changing  nuttx/pdcdisp.c:840 from "sp" to just "s" was the
> only compile error.  Though going through the exercise made me remember
> that you also need to select:
>
> Application Configuration --> Graphics Support --> pdcurses --> Input
> Devices --> Terminal Input
>
> Otherwise you don't have any input device for pdcurses.
>
> Ken
>
>
> On 1/22/21 11:31 AM, Grr wrote:
> > Thank you for your response
> >
> > I searched menuconfig according to your instructions and found it.
> > Compilation crashed with
> >
> > nuttx/pdcdisp.c:840:19: error: 'sp' undeclared (first use in this
> > function); did you mean 's'?
> >
> > but it's a matter of debugging it. Maybe a lacking option, I'll research
> it
> >
> > Thanks again
> > Grr
> >
> >
> > El vie, 22 ene 2021 a las 13:11, Ken Pettit (<pe...@gmail.com>)
> escribió:
> >
> >> Grr,
> >>
> >> Actually, pdcurses has a mode that will work over serial using
> >> System->Termcurses.  This is a terminal based extension to pdcurses that
> >> I added a few years back.  It supports VT-100 / ANSI escape codes.  I
> >> haven't tested it in the Apache NuttX framework to validate it still
> >> works though.
> >>
> >> If you don't define CONFIG_SYSTEM_TERMCURSES, then yes, you will get an
> >> error about the graphic fb creation.
> >>
> >> Ken
> >>
> >> On 1/22/21 11:02 AM, Grr wrote:
> >>> Hello all
> >>>
> >>> Is there a way to have formatted text output over serial? I want to
> >> create
> >>> some testing utility that runs from nsh and has some screen
> organization
> >> to
> >>> ease use
> >>>
> >>> I tested pdcurses examples but they seem to depend on fb (haven't
> >> analyzed
> >>> code) and all exited or crashed with "initscr(): Unable to create SP"
> >>>
> >>> Is there a builtin way to do such thing?
> >>>
> >>> TIA
> >>> Grr
> >>>
> >>
>
>

Re: Formatted text over serial

Posted by Ken Pettit <pe...@gmail.com>.
Looks like changing  nuttx/pdcdisp.c:840 from "sp" to just "s" was the 
only compile error.  Though going through the exercise made me remember 
that you also need to select:

Application Configuration --> Graphics Support --> pdcurses --> Input 
Devices --> Terminal Input

Otherwise you don't have any input device for pdcurses.

Ken


On 1/22/21 11:31 AM, Grr wrote:
> Thank you for your response
>
> I searched menuconfig according to your instructions and found it.
> Compilation crashed with
>
> nuttx/pdcdisp.c:840:19: error: 'sp' undeclared (first use in this
> function); did you mean 's'?
>
> but it's a matter of debugging it. Maybe a lacking option, I'll research it
>
> Thanks again
> Grr
>
>
> El vie, 22 ene 2021 a las 13:11, Ken Pettit (<pe...@gmail.com>) escribió:
>
>> Grr,
>>
>> Actually, pdcurses has a mode that will work over serial using
>> System->Termcurses.  This is a terminal based extension to pdcurses that
>> I added a few years back.  It supports VT-100 / ANSI escape codes.  I
>> haven't tested it in the Apache NuttX framework to validate it still
>> works though.
>>
>> If you don't define CONFIG_SYSTEM_TERMCURSES, then yes, you will get an
>> error about the graphic fb creation.
>>
>> Ken
>>
>> On 1/22/21 11:02 AM, Grr wrote:
>>> Hello all
>>>
>>> Is there a way to have formatted text output over serial? I want to
>> create
>>> some testing utility that runs from nsh and has some screen organization
>> to
>>> ease use
>>>
>>> I tested pdcurses examples but they seem to depend on fb (haven't
>> analyzed
>>> code) and all exited or crashed with "initscr(): Unable to create SP"
>>>
>>> Is there a builtin way to do such thing?
>>>
>>> TIA
>>> Grr
>>>
>>


Re: Formatted text over serial

Posted by Grr <ge...@gmail.com>.
Thank you for your response

I searched menuconfig according to your instructions and found it.
Compilation crashed with

nuttx/pdcdisp.c:840:19: error: 'sp' undeclared (first use in this
function); did you mean 's'?

but it's a matter of debugging it. Maybe a lacking option, I'll research it

Thanks again
Grr


El vie, 22 ene 2021 a las 13:11, Ken Pettit (<pe...@gmail.com>) escribió:

> Grr,
>
> Actually, pdcurses has a mode that will work over serial using
> System->Termcurses.  This is a terminal based extension to pdcurses that
> I added a few years back.  It supports VT-100 / ANSI escape codes.  I
> haven't tested it in the Apache NuttX framework to validate it still
> works though.
>
> If you don't define CONFIG_SYSTEM_TERMCURSES, then yes, you will get an
> error about the graphic fb creation.
>
> Ken
>
> On 1/22/21 11:02 AM, Grr wrote:
> > Hello all
> >
> > Is there a way to have formatted text output over serial? I want to
> create
> > some testing utility that runs from nsh and has some screen organization
> to
> > ease use
> >
> > I tested pdcurses examples but they seem to depend on fb (haven't
> analyzed
> > code) and all exited or crashed with "initscr(): Unable to create SP"
> >
> > Is there a builtin way to do such thing?
> >
> > TIA
> > Grr
> >
>
>

Re: Formatted text over serial

Posted by Ken Pettit <pe...@gmail.com>.
Grr,

Actually, pdcurses has a mode that will work over serial using 
System->Termcurses.  This is a terminal based extension to pdcurses that 
I added a few years back.  It supports VT-100 / ANSI escape codes.  I 
haven't tested it in the Apache NuttX framework to validate it still 
works though.

If you don't define CONFIG_SYSTEM_TERMCURSES, then yes, you will get an 
error about the graphic fb creation.

Ken

On 1/22/21 11:02 AM, Grr wrote:
> Hello all
>
> Is there a way to have formatted text output over serial? I want to create
> some testing utility that runs from nsh and has some screen organization to
> ease use
>
> I tested pdcurses examples but they seem to depend on fb (haven't analyzed
> code) and all exited or crashed with "initscr(): Unable to create SP"
>
> Is there a builtin way to do such thing?
>
> TIA
> Grr
>