How to setup locale config on angstrom-lxde-image to avoid "XOpenIM() failed"

Hi,

we run a FLTK based application on the angstrom-lxde-image environment. During Startup the Error Message “XOpenIM() failed” appears:

> root@colibri-imx7-emmc:~/Programs/WESuite#
> ./WELaserCC XOpenIM() failed ^C
> root@colibri-imx7-emmc:~/Programs/WESuite#

It seems that the application cannot open a connection to the Input Method corresponding to the current “locale” of the Operating System.
On the angstrom-lxde-image “locale” configuration looks like this:

root@colibri-imx7-emmc:~/Programs/WESuite# localectl
   System Locale: n/a
       VC Keymap: n/a
      X11 Layout: n/a
root@colibri-imx7-emmc:~/Programs/WESuite#

I’ve tried to set some locale config using e.g.

localectl set-locale LANG=de_CH
localectl set-keymap de_CH.UTF-8

It seems that the settings have been accepted but the problem still exists:

root@colibri-imx7-emmc:~# localectl
   System Locale: LANG=de_CH
       VC Keymap: de_CH.UTF-8
      X11 Layout: n/a
root@colibri-imx7-emmc:~#

Setting the X11-Keymap was not successful:

root@colibri-imx7-emmc:~# localectl set-x11-keymap de_CH.UTF-8
Failed to set keymap: Local keyboard configuration not supported on this system.
root@colibri-imx7-emmc:~#

Do you have any idea what I’m doing wrong or what I can improve?

More Environment Information:

  • Module: Colibri iMX7d 1G
  • Carrier-Board: Aster
  • Machine: colibri-imx7-emmc
  • Image: angstrom-lxde-image
  • Additional Libraries: boost fltk aravis

Many Thanks for your support,
Adrian

Hi @EmbeddedPID and Welcome to the Toradex Community!

Could you provide the version of the Hardware (including carrier board) and Software of your module?
Please share also the dmesg.log and the complete error log in a text file?

Thanks and best regards,
Jaski

Hi jaski.tx

I’m running the Aster Carrier-Board V1.1.B and the Colibri iMX7D 1G V1.1A. The Software is self compiled running the following commands:

repo init -u http://git.toradex.com/toradex-bsp-platform.git -b LinuxImageV2.8
$ repo sync
$ . export
$ bitbake –k angstrom-lxde-image

The local.conf file I have modified as follow:

MACHINE ?= "colibri-imx7-emmc"
IMAGE_INSTALL_append = "boost fltk aravis"

In addition I have individually compiled a new Device-Tree File so that the Capacitive Touch Display 7" is working correctly. The dtb file I have added manually after the built by modifying the file “Colibri-iMX7-eMMC_LXDE-Image-Tezi_2.8b6-20200306.tar”. In U-Boot I hat to modify the Env-Var fdt_board to Aster as well, so that the newly built dtb will be considered.

The dmesg you find attached. Just let me know if you need more information.

Text-File including dmesg and console output with the error message

Have a good day,
Adrian

Dear @EmbeddedPID ,

Thank you for your information.

I tried to reproduce your problem at my device. And started with building the image using OpenEmbeeded. My build failed because the layer:aravis could not be found. Is it custom?
https://layers.openembedded.org/layerindex/branch/master/recipes/?q=aravis

We have not much experience with the FLTK application. Could you maybe provide us with sample application and libraries folder, so that we could try at our desk?

Best Regards,

Janani

Hello Janani,

you can download the aravis layer here:
https://github.com/astarasikov/meta-aravis
There is also an instruction that covers a Toradex Environment, it worked for me out of the box:

cd layers/
git clone https://github.com/astarasikov/meta-aravis.git
cd ..
Now, edit bblayers.conf to add the "meta-aravis" layer to the list of layers so that OpenEmbedded build system (bitbake) can see the new package.
vim build/conf/bblayers.conf
# add "${TOPDIR}/../layers/meta-aravis \"
# similar to how other layers are defined
bitbake  angstrom-lxde-image

Regarding FLTK I will send you a demo application later that you can run. If you are able to compile the image, there is no need for additional libraries or headers.

Many thanks for your support,
Adrian

Hi Janani,

I have attached a fltk demo project that will show the failure XOpenIM(). In the zip file you will find an already compiled executable file called “FLTK-Examples”. Also I have attached the source file for the demo project and the fltk header- and library files.
If you run the example on the target you will find the follwing failure message on the terminal:

root@colibri-imx7-emmc:~# ./FLTK-Examples
XOpenIM() failed
^C
root@colibri-imx7-emmc:~#

If you copy also the png image file “test-img.png” to the target you will find even more error messages on the terminal:

root@colibri-imx7-emmc:~# ./FLTK-Examples
XOpenIM() failed
XRequest.138: BadMatch (invalid parameter attributes) 0x37
XRequest.138: RenderBadPicture (invalid Picture parameter) 0x1600007
XRequest.138: RenderBadPicture (invalid Picture parameter) 0x1600007
XRequest.138: BadMatch (invalid parameter attributes) 0x37
XRequest.138: RenderBadPicture (invalid Picture parameter) 0x160000d
XRequest.138: RenderBadPicture (invalid Picture parameter) 0x160000d
XRequest.138: BadMatch (invalid parameter attributes) 0x37
XRequest.138: RenderBadPicture (invalid Picture parameter) 0x1600010
XRequest.138: RenderBadPicture (invalid Picture parameter) 0x1600010
XRequest.138: RenderBadPicture (invalid Picture parameter) 0x1600010
^C
root@colibri-imx7-emmc:~#

IMHO the route cause is still the first error message XOpenIM() failed, which I guess is caused by a missing configuration of the X11 Input Methode on the Linux Image.

Have a good day,
Adrian

link text

Have you found a solution?

As I mentioned in my comment above, we don’t do FLTK developments, unfortunately. But, probably, @EmbeddedPID can help you with that here.

Best Regards,
Janani

Dear Adrian,

I have problem with cross compile FLTK application on my host PC.
https://community.toradex.com/t/how-to-cross-compile-fltk-application-in-toradex-version-2-8-lts-and-newer/16104/2
As I can see you also use Toradex V2.8 version could you please share your fltk-config file or how you succeed to compile fltk gui.

kind regards,
Klemen

Hi Klemen,

during that time I wrote a short document including the following content. Hope it helps you… unfortunately it is in German, but I guess you know the helpful online translation services (-;

Adding Libraries/Layers to OpenEmbedded

Damit Anpassungen der Hardwarebestückung flexible durchgeführt werden können, ist es notwendig die von Toradex zur Verfügung gestellte Linux Distribution anzupassen und zu erweitern. Auch das Cross-Compiling der Boost Bibliothek erfordert Anpassungen an der Distro.

Anleitung Toradex: https://developer.toradex.com/knowledge-base/board-support-package/openembedded-%28core%29#Additional_Layers

Adding layers to OpenEmbedded

Online-Anleitung: https://www.wolfssl.com/docs/yocto-openembedded-recipe-guide/

Alles was zu tun ist, damit unsere Bibliotheken boost und fltk miteingebunden werden ist die folgende Zeile im File build/conf/local.conf hinzuzufügen:

IMAGE_INSTALL_append = “boost fltk”

Have a good day,

Adrian

image002.jpg