[BRLTTY] Error "Can't determine tty number"

t w teona_wagner at yahoo.com
Fri Jul 1 07:49:17 EDT 2016


Hi Sherab,
Thank you so much for your answer!
Yes, I am using Linux (ubuntu 14.04, to be more precise).

I ran my c++ code from eclipse, so if I understood your question correctly, yes, I ran it from a graphical terminal. 
I used the sample code on the brltty official internet page, here are some relevant abstracts:
/* Get driver name */
  if (brlapi_getDriverName(name, sizeof(name)) < 0)
    brlapi_perror("brlapi_getDriverName");
  else
    fprintf(stderr, "Driver name: %s\n", name);

/* Get display size */
  if (brlapi_getDisplaySize(&x, &y) < 0)
    brlapi_perror("brlapi_getDisplaySize");
  else
    fprintf(stderr, "Braille display has %d line%s of %d column%s\n",
      y, y>1?"s":"", x, x>1?"s":"");

/* Try entering raw mode, immediately go out from raw mode */
  fprintf(stderr, "Trying to enter in raw mode... ");
  if (brlapi_enterRawMode(name) < 0)
    brlapi_perror("brlapi_enterRawMode");
  else {
    fprintf(stderr, "Ok, leaving raw mode immediately\n");
    brlapi_leaveRawMode();
  }

/* Get tty control */
  fprintf(stderr, "Taking control of the tty... ");
  if (brlapi_enterTtyMode(BRLAPI_TTY_DEFAULT, NULL) >= 0)
  {
    fprintf(stderr, "Ok\n");

And here is the output that I get when running the code above:

Driver name: Papenmeier
Braille display has 1 line of 40 columns
Trying to enter in raw mode... brlapi_enterRawMode: Operation not supported
Taking control of the tty... brlapi_enterTtyMode: Can't determine tty number
So it does find my Braille display, but does no more than that, unfortunately :(
Another thing: I tried running brltty from a console, and it does show me the version number, but then returns (exits)! Meaning, I can't give any input or do anything else with it. So this might be a hint that I am doing something wrong, but I can't figure out what and where. I edited the config file, btw, but I am having trouble installing brltty as a service. Does it need to run like a service, in my case? I thought just accessing the functions from a C++ program would be enough...
By the way, I couldn't find the brlapitest that you mentioned in by brltty sources! Could this be another hint that something is wrong with my installation of brltty?

Thanks a lot once more and best,TW





Message: 4
Date: Thu, 30 Jun 2016 22:01:06 +0200
From: Sh?rab <Sebastien.Hinderer at ens-lyon.org>
To: brltty at mielke.cc
Subject: Re: [BRLTTY] Error "Can't determine tty number"
Message-ID: <20160630200106.GB25018 at pema>
Content-Type: text/plain; charset=utf-8

Hi,

a c (2016/06/29 11:12 +0000):
> Hi,
> 
> I'm writing some C++ code on ubuntu, trying to connect to a Papenmeier
> Braillex EL 40s and just write some characters on it, for a start.
> However, when taking control of the tty using the default tty number
> (brlapi_enterTtyMode(BRLAPI_TTY_DEFAULT, NULL)), I get an error:
> "Can't determine tty number".

Am I correct that you ran this program from a graphical terminal?

You may try running it from a virtual console, first, and see if that
works.

By the way are you using Linux or another operating system?

> I tried to figure out what this number should be, but didn't manage;
> and also tried some more or less random numbers, and when I do this,
> it says "brlapi_enterTtyMode: Ok", but then does not write anything on
> the Braille Display, nor does it recognize any user input.

Did you try the brlapitest program that is in brltty's sources? It may
be interesting to see if that works...

Cheers,

Sh?rab.
   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mielke.cc/pipermail/brltty/attachments/20160701/469cec3d/attachment.html>


More information about the BRLTTY mailing list