fhp14
Posts: 5
Joined: Wed Apr 15, 2015 11:34 pm

Terminal displays through running program

Thu Apr 16, 2015 12:26 am

Hi folks,

I am working on a school project that is coming down to the wire (of course). Any help ASAP would be really appreciated.

I am attempting to test the tutorial found here: http://ozzmaker.com/2013/09/10/controll ... uchscreen/
The code can be found here. https://github.com/mwilliams03/Pi-Touchscreen-basic

I am running on a Raspberry Pi B+
I am using a JBtek screen: found herehttp://www.amazon.com/JBtek-Raspberry-T ... B00L15FOF4
I am using the image that I downloaded from this site
I installed bcm2835 1.44
I installed wiringPi

The problem is that when I run the program, the buttons flash very quickly but do not stayed displayed. Instead, the terminal and the regular desktop behind the program start to display through.

The program is seeing and registering the touch. It is turning on the GPIO pins appropriately when the correct button is touched.

Any help is sincerely appreciated! I am desperate as I have little experience and the project is due soon. THANKS!

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Terminal displays through running program

Thu Apr 16, 2015 4:18 am

Hi,

Your issue is that the Pi-Touchscreen-basic program directly addresses the framebuffer. That is fine if you aren't using the desktop, but causes issues if you are. When the Desktop is running it effectively owns the framebuffer and expects programs to access the display through the X server.

Hope that helps!

fhp14
Posts: 5
Joined: Wed Apr 15, 2015 11:34 pm

Re: Terminal displays through running program

Thu Apr 16, 2015 4:39 am

Yes! That fixed it. This crossed my mind, but I wasn't focusing on it when I was troubleshooting.

Thank you so much!

fhp14
Posts: 5
Joined: Wed Apr 15, 2015 11:34 pm

Re: Terminal displays through running program

Fri Apr 17, 2015 2:26 am

The problem continues....

I need the program to autostart. I have that figured out by modifying the etc/local.rc. However, the same error occurs that the the background text shows through the program image. Is there a way to control this? I basically need the program to always execute in the foreground and never be covered by text.

Many thanks!

User avatar
AndyD
Posts: 2334
Joined: Sat Jan 21, 2012 8:13 am
Location: Melbourne, Australia
Contact: Website

Re: Terminal displays through running program

Fri Apr 17, 2015 3:03 am

Is it console messages that you are seeing now?

Edit: OK I see from your other post that it is.

Looks like the OS image you are using has mapped the console to your TFT display. First let us confirm this. Run the folllowing:-

Code: Select all

con2fbmap 1
You should see the following

Code: Select all

console 1 is mapped to framebuffer 1
The framebuffer 1 is the important bit, if it says framebuffer 0 then the following won't work!

To change it back to the default use the command

Code: Select all

sudo con2fbmap 1 0
Now the console messages will be displayed on the default display (HDMI/analog output), rather than on your TFT screen.

fhp14
Posts: 5
Joined: Wed Apr 15, 2015 11:34 pm

Re: Terminal displays through running program

Fri Apr 17, 2015 4:47 am

Yes, that worked perfectly. I added that to /etc/rc.local so that it does this automatically upon boot. Thanks for your quick and accurate help. I really appreciate it! :D

Return to “Graphics programming”