4 inch display - inverted picture

Discussion about this major DATV Project. See https://wiki.batc.org.uk/The_Portsdown_Transmitter
Post Reply
g3zgz
Posts: 63
Joined: Thu Jul 16, 2015 1:36 pm

4 inch display - inverted picture

Post by g3zgz » Sun Aug 27, 2017 8:18 am

Hi all,
No experience with RPI and need a little assistance please.
I have a 3.5 inch display borrowed from a friend and a 4 inch one that I ordered from China.

Used my own memory card.
Loaded the BATC software to the card as per the BATC instructions, spent an hour updating software (fortunately this was all automatic and did'n't require use of the arm holding my liquid refreshment) and got the PI running with the 3.5 display - no problems.

Substituted the 4 inch display and the screen is now inverted and the touch screen out - for example pressing TX causes the SR to change.

I tried my friend Google and found a suggestion to edit the /boot/cmdline.txt file to change a command at the end.
It was suggested to change the last command fptft_device.rotate=0 to rotate=90
This was to change the screen from landscape to portrait.

Firstly the fptft command was not in or at the end of of the command line, so I added it.
This made no difference to the display (also tried 180 just in case).

With the display there is a CD that has an image file on it and the instructions say to copy this to a SD card etc. etc.
I was reluctant to do this as I fear it may overwrite the BATC files etc already on the card and it may contain rubbish that I don't need.

The upside down screen is not such a problem as I can always turn the PI round., but the touch screen does not respond in the correct area of the screen - it seems to be flipped top to bottom whilst the display is rotated 180 degrees

What can you suggest?

Thanks n 73

Dave

G3ZGZ

g0mjw
Posts: 2568
Joined: Sat Sep 20, 2014 9:15 am

Re: 4 inch display - inverted picture

Post by g0mjw » Sun Aug 27, 2017 8:56 am

There was a thread on this - http://www.batc.org.uk/forum/viewtopic. ... ted#p12525

Non-standard screens are not supported. Turning it the other way up can be done in software as well as physically. https://www.raspberrypi.org/forums/view ... p?t=121263

Have a look through the menu.sh code for clues on rotating the display. If that does not provide a solution if you modify the rpidatvtouch.c source code you should be able to fix the issue with the touch screen relatively easily.

Mike

G8GKQ
Site Admin
Posts: 2928
Joined: Sun Mar 22, 2009 1:21 pm

Re: 4 inch display - inverted picture

Post by G8GKQ » Sun Aug 27, 2017 9:53 pm

Hi Dave

As Mike says, this can be corrected in the software. From what I read above, you can get the buttons the right way round, you just need to be able to vertically flip the touch sense overlay?

Please confirm if that is correct?

The lines that will need adjustment are in ~/rpidatv/src/gui/rpidatvtouch.c. The code will then need to be recompiled, but this is easy.

If you can confirm your exact requirements, I should be able to suggest a change for you to try in rpidatvtouch.c. I can also provide compiling instructions.

You were right in your instinct not to load the manufacturer's CD!

Dave, G8GKQ

g3zgz
Posts: 63
Joined: Thu Jul 16, 2015 1:36 pm

Re: 4 inch display - inverted picture

Post by g3zgz » Mon Aug 28, 2017 7:52 am

Thanks Mike and Dave.

Mike, I looked at the links you gave and tried what was suggested but the display just stayed the same.

The controller chip on the two displays I have is the same - XPT2046.
John G3RFL who I borrowed the 3.5 inch display off, bought several a while ago and he commented that one was upside down to the others, so it is possible it may have been assembled incorrectly, or perhaps a reject one!

M&D, in my post I mentioned I was less than a nooby to RPI, so any help will be appreciated, but unfortunately needs to be step by step!

The display is rotated by 180 degress, but otherwise is OK

On the rotated display the touch panel is flipped vertically as far as I can see.
Tapping on the TX button (on the rotated display) changes the SR rate to 125.
Tapping in the middle of the sr125 and 71mhz boxes puts TX on/off
Tapping between SR4000 and 1296MHz changes menu 1 to 2 and back

So if I mount the display upside down all that needs changing is the touch screen flipping.

Dave I'll edit and recompile (I do need instructions) and give it a go, but heres a nooby question...
I'd like to make a back up copy of anything I change - can I do this to my PC, or to the SD card?

Also to save another post, my next question would be ..
How/where do I copy jpg's to that I would like to be able to TX as a slide show.
Is there a "how to" file anywhere?

Now there's another

Can I set a static IP address on the PI

Does the "show outgoing video" on display work, as I can't seem to get it to show the video from the easy cap?

Sorry for all these questions and appoligies as there WILL be many more!

73

Dave.

g0mjw
Posts: 2568
Joined: Sat Sep 20, 2014 9:15 am

Re: 4 inch display - inverted picture

Post by g0mjw » Mon Aug 28, 2017 8:50 am

Hi Dave,

If you are not that familiar with linux wouldn't it be better to save yourself some effort and get the correct display ? They are not very expensive on Ebay.

Mike

G8GKQ
Site Admin
Posts: 2928
Joined: Sun Mar 22, 2009 1:21 pm

Re: 4 inch display - inverted picture

Post by G8GKQ » Mon Aug 28, 2017 10:12 am

Hi Dave

I agree with Mike that you would be better off getting the correct display. It's a small proportion of the complete project cost. However, I will look at what changes are required to flip the display.... Some time this week.

Quick answers to your other questions:

- No need to backup. Replacement files can be downloaded from GitHub instantly. However, you could simply type

Code: Select all

cp path/filename path/filename.original
to make a copy on the SD Card; then reverse the filenames to restore. This is what I do for trying changes.

- .jpgs for the slideshow go in the /home/pi/rpidatv/video folder. I use the free Windows program WinSCP to copy them from my PC into the folder.

- Haven't tried static IP, but I'm sure it is possible. Try something like this: https://www.modmypi.com/blog/how-to-giv ... ess-update. Please report back here if it works and I'll put it on the Wiki (which is the nearest thing we have to to "how-to" file).

- It is not possible to show the outgoing video from the EasyCap. The load on the processor would interfere with the transmission. You can get an idea of the input video while not transmitting by selecting "View" on Menu 3.

Dave

G8GKQ
Site Admin
Posts: 2928
Joined: Sun Mar 22, 2009 1:21 pm

Re: 4 inch display - inverted picture

Post by G8GKQ » Sat Sep 02, 2017 8:50 pm

Hi Dave

As an illustration that anybody can alter or improve the Portsdown code (and I wish they would!) here is how to get your 4 inch display touch overlay the correct way up:

Start at line 687 of the file /home/pi/rpidatv/src/gui/rpidatvtouch.c. Make a copy of the line and insert it as an extra line before the original line 688. Put 2 slashes at the start of the original line 687; this makes it a comment, but allows you to revert to the original should you need it. Then amend the new line (688 now) so that it all reads:

Code: Select all

//    scaledY = shiftY+hscreen-x/(scaleYvalue+factorY);
    scaledY = shiftY+x/(scaleYvalue+factorY);
Then save the file.

To compile and run the file, copy and paste the following commands and run them at the Linux command prompt:

Code: Select all

cd /home/pi/rpidatv/src/gui
make clean
make
sudo make install

cd /home/pi
reset
sudo killall fbcp >/dev/null 2>/dev/null
fbcp &
/home/pi/rpidatv/bin/rpidatvgui 1
You will see some scaling and shifting factors that can be used to get the buttons exactly aligned at lines 671 - 675. You may need to play with these, but you'll need to recompile every time.

Have fun!

Dave

g3zgz
Posts: 63
Joined: Thu Jul 16, 2015 1:36 pm

Re: 4 inch display - inverted picture

Post by g3zgz » Sun Sep 03, 2017 6:25 am

Thanks Dave.
IT Works!!!!!!!!!!!!!!!

:lol: :D Thanks for taking the time to do this, it's really appreciated.

73

Dave.

Post Reply

Return to “The Portsdown Digital ATV System”