I have an ARM-based nanopi-m1 board. I have installed Armbian(Ubuntu-server 16.04) on it. Also I have installed :
xorg, openbox, xserver-x11-video-fbdev and libgtk-3-dev
on it. and made three .conf files:
Add to file /etc/modules-load.d/fbtft.conf
spi-bcm2835
fbtft_device
Add to file /etc/modprobe.d/fbtft.conf
options fbtft_device custom name=fb_ili9341 gpios=reset:1,dc:201,led:6 speed=16000000 rotate=90 bgr=1
Add to file: /usr/share/X11/xorg.conf.d/99-fbdev.conf
Section "Device" Identifier "myfb" Driver "fbdev" Option "fbdev" "/dev/fb8" EndSection
And
Add to /etc/rc.local
startx
So I have this screen after boot:
[
^]
That is openbox window.
Then I tried to show an image in my SPI LCD with .C code as you can see below:
#include <gtk/gtk.h>
void destroy(void) {
gtk_main_quit();
}
int main (int argc, char** argv) {
GtkWidget* window;
GtkWidget* image;
gtk_init (&argc, &argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
image = gtk_image_new_from_file(argv[1]);
g_signal_connect(G_OBJECT (window), "destroy",
G_CALLBACK (destroy), NULL);
gtk_container_add(GTK_CONTAINER (window), image);
gtk_widget_show_all(window);
gtk_main();
return 0;
}
But after compiling my code without error, when I try to run the executable via ssh, it gives me this message:
(process:1909): Gtk-WARNING **: Locale not supported by C library.
Using the fallback 'C' locale.
And my image shown in my laptop instead of my board's LCD!
How can I fix this?
I want my image shown inside my SPI LCD not in my laptop display!
What I have tried:
I searched a lot and asked in some other sites but couldn't find any solution till now!