Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Display Rotation #12

Closed
belangerpascal opened this issue Mar 26, 2024 · 7 comments
Closed

Display Rotation #12

belangerpascal opened this issue Mar 26, 2024 · 7 comments

Comments

@belangerpascal
Copy link

belangerpascal commented Mar 26, 2024

Hi, would it be possible to add the capability if rotating the display?
And also setting offsets, I'm using a 1.69 Waveshare display with rounded corners with a resolution of 280x240.

Thanks

@mehrdadfeller
Copy link
Collaborator

@belangerpascal we don't have access to that specific display at the moment. have you tried running the current implementation on your display? if so, does it work on your display other than the resolution and size difference?

@belangerpascal
Copy link
Author

It is working if I specify a width of 240 and a height of 240. If I put the displays 280x240 resolution, it's displays garbage.

@belangerpascal
Copy link
Author

I did try to modify the Adafruit board setup in the config.py by changing the offset and adding rotate=90 but why I execute the code it doesn't seem to pick it up.

@belangerpascal
Copy link
Author

belangerpascal commented Mar 26, 2024

This is with the native resolution (280x240)
IMG_5440

This is with a resolution of 240x240
IMG_5441

@sassanh
Copy link
Owner

sassanh commented Mar 26, 2024

@belangerpascal
I think it's a good idea to add rotation as a config parameter, I will work on it quickly.
I guess you have already tried both 280x240 and 240x280 and none are working, so assuming your HeadlessWidget's name is headless_widget, please let me know what is the value of headless_widget.size and headless_widget.pos. Is it the root widget of the application?

@belangerpascal
Copy link
Author

Thanks for that. Yes I did try playing with swapping the width and height and it shows all noise if I go higher then 240.

I do not specifically set the widget size or position.

@sassanh
Copy link
Owner

sassanh commented Apr 2, 2024

I do not specifically set the widget size or position.

I see, even if you are not specifying the pos and size, Kivy may set them by itself if the headless widget is not the root widget. I suggest printing those values and check them, you can do it like this:

print(widget.pos, widget.size)

Another troubleshooting step would be to run your application with HEADLESS_KIVY_PI_DEBUG environment variable set to True like this:

HEADLESS_KIVY_PI_DEBUG=True python /path/of/your/app

In this mode it will write the raw display data in a file named headless_kivy_pi_buffer.raw, if you share that file here I will be able to investigate the issue.

The output of this snippet would be helpful too:

import headless_kivy_pi.config
print headless_kivy_pi.config._config

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants