Welcome to Certabo forum

Both posts in italian and in english are accepted on the forum to help everybody to provide contribution irrespective to geographical location. Object of the forum is to provide technical information on various items and help developer and users to personalise software for Certabo chessboards. User explicitly accepts the conditions of use of this forum here reported.

A brief introduction of user is always appreciated in section Welcome to….

Benvenuti nel forum di Certabo

Sul forum possono essere postati articoli sia in lingua italiana che inglese per permettere a tutti di dare il proprio contributo da diversi luoghi geografici. Il forum ha come scopo fornire informazioni tecniche in generale e aiutare gli sviluppatori ed utenti a personalizzare software per le scacchiere Certabo. L’utente accetta esplicitamente le condizioni del presente forum consultabili qui.

Un breve saluto del nuovo utente è sempre gradito nella sezione Benvenuti a….

Please or Register to create posts and topics.

Running Da Vinci on 5 inches touch screen (800x480) on Raspberry pi

Page 1 of 3Next

Hello All,

As I like to play around with IT stuff in every angles, I decided to setup my own Certabo computer based on a raspberry pi. And as I found the standard 3.5 inch screens a bit small I decided to go for a 5 inch display. after deploying the image to the raspberry and configuring the screen, everything was working properly but the Certabo Software interface, once launched did not fit properly to the screen size and resolution, showing large black zones:

The Rasbian OS is using the all screen properly, but not the certabo software.

So here is how I sorted it out (this is probably not the best solution, but at least it works :))

Steps

  1. Install the Da Vinci image on your rapsberry pi (here I used version 3.0 provided by Pietro, thanks to him): here
  2. plug your screen in (here is the model I bought) and follow the provider instruction to make it work as it should.
    1. For the model I use I had to modify the config.txt in the boot partition and add the following at the end:
      hdmi_group=2
      hdmi_mode=1
      hdmi_mode=87
      hdmi_cvt 800 480 60 6 0 0 0
      dtoverlay=ads7846,cs=1,penirq=25,penirq_pull=2,speed=50000,keep_vref_on=0,swapxy=0,pmax=255,xohms=150,xmin=200,xmax=3900,ymin=200,ymax=3900
      hdmi_drive=1
    2. Then launch :
      pi@raspberrypi:~/LCD-show $ sudo ./LCD5-show
      The "5" is standing for the screen size, here 5 inches, this command will also switch the main display to the touch screen. by default you will see the console only showing on the touch screen.
    3. Reboot
  3. now I needed to make the following modification to the main.py fileAt line 300, I added the screen resolution in the window_sizes array
    sprite_resolutions = (1920, 1366, 1024, 800, 480)
    window_sizes = ((1500, 1000),
    (900, 600),
    (800, 533),
    (800, 480),
    (625, 417),
    (480, 320))
  4. Also need to adjust the resolution multiplier around line 342 :
    cfg.x_multiplier = screen_width / 533
    cfg.y_multiplier = screen_height / 320
    This will allow the software to run in that resolution. The issue is that the Sprites are not sized or placed to fit this resolution, so I had to made a bit more modifications.
  5. Resize davinci/sprites/sprites_800/chessboard_xy.png with a resolution of : widht = 415px & height = 418px
  6. Move the following sprites in the code to make it more beautiful in the look :
    Line 491: show_sprite("start-up-logo", 60, 25)
    Line 557: show_sprite("start-up-logo", 60, 25)
    Line 610: show_sprite("logo", 20, 10)
    Line 640: show_sprite("welcome", 170, 6)
    If you are using another release, lines numbers will probably be differ, using a search function will do the trick.
  7. Restart the software, and you are done:

Of course a dynamic way of relocating Sprites position and sizes would be better, but I'm starting with Python and Certabo 😛

 

P.S: don't hesitate to move the topic if I'm not in the right section.

 

Uploaded files:
  • You need to login to have access to uploads.
tobias and Dominik Breitbeil have reacted to this post.
tobiasDominik Breitbeil
Hello G4LLY,

I had an old 5-inch screen forgotten at home (one like this: https://www.amazon.es/gp/product/B01F3JI58G/ref=as_li_ss_tl?ie=UTF8&psc=1&linkCode=sl1&tag=s0a3fe-21&linkId=732830949908flange=732830949908flange ) I found how to install it easily here (http://www.lcdwiki.com/5inch_HDMI_Display) I don't know if this is useful for other people.

I have modified the main.py file as you say (Thanks !!) but the board size in my case is not correct. The pieces were dislodged and two black stripes remained. Resizing chessboard_xy.png to 460x418 I have a long board but with the pieces well centered. I still have those black stripes. I don't know if you've had that problem or if you know how to solve it. I would appreciate the help.

I enclose the modified main.py file in case it is useful for anyone and a photo of how the screen looks now.

PS: To move files between the PC and the raspberry I have used WinSCP (https://winscp.net/eng/docs/lang:es) very convenient for those who are not used to SSH.

Greetings,
Uploaded files:
  • You need to login to have access to uploads.

The text in my previous post does not look good. I do not know the motive. I rewrite it:

 

Hello G4LLY,

I had an old 5-inch screen forgotten at home (one like this: https://www.amazon.es/gp/product/B01F3JI58G/ref=as_li_ss_tl?ie=UTF8&psc=1&linkCode=sl1&tag=s0a3fe-21&linkId=732830949908flange= 732830949908flange) I found how to install it easily here (http://www.lcdwiki.com/5inch_HDMI_Display) I don't know if this is useful for other people.

I have modified the main.py file as you say (Thanks !!) but the board size in my case is not correct. The pieces were dislodged and two black stripes remained. Resizing chessboard_xy.png to 460x418 I have a long board but with the pieces well centered. I still have those black stripes. I don't know if you've had that problem or if you know how to solve it. I would appreciate the help.

I enclose the modified main.py file in case it is useful for anyone and a photo of how the screen looks now.

PS: To move files between the PC and the raspberry I have used WinSCP (https://winscp.net/eng/docs/lang:es) very convenient for those who are not used to SSH.

Greetings,

Hello,

I did resized it to width = 415px & height = 418px as explained in step 4, here is the .png (I resized the one from sprite_1024)

 

chessboard_xy.png

But when I resize to 415x418 it looks like in the photo I have put (With black stripes too)

I cannot see your main.py, here is mine: http://www.marieetsimon.be/main.zip

I cannot see your main.py, here is mine: http://www.marieetsimon.be/main.zip

Ok G4LLY, With your main.py it looks perfect!! I don't know where I was wrong. Thanks a lot!

Hi Simon Nacho

Thank you for your help to the forum!

You can either clone if you need  the files you need from our repository directly on pi at this link

https://github.com/CERTABO/Release-4.1-BT/tree/master this is latest 4.1 version (3.0 release running on DaVinci)

Clone in any directory and you can do all check you like (this is bearing standard graphics GUI) but it easier to check debug.

All the best

Pietro

Quote from Nacho on March 29, 2021, 7:02 pm

Ok G4LLY, With your main.py it looks perfect!! I don't know where I was wrong. Thanks a lot!

Hello @Nacho,

Good news, I would be interested to compare your main.py as well to ensure I didn't miss anything in my guide 🙂

 

@pietro, thanks for the feedback on this !

Page 1 of 3Next