Micropython Build with LVGL for Omega2?
-
I saw you were working on getting a build of micropython with lvgl for the Omega2 working here. I was wondering were it stood and if you were able to get it working?
-
@Nate That's right, I spent some time trying to get micropython with lvgl working for the Omega2 Dash. Here's where everything stands.
Current Status
In summary:
- lvgl's micropython implementation was adjusted to work with the linux framebuffer and xpt7603 touch driver chip on the Omega2 Dash
- micropython with lvgl can be compiled for the Omega2 platform
- It runs and lvgl can be used to create UI components
Touch input does not workTouch input works 100%! See the update below.
And there are the Onion forks of the two lvgl micropython repos:
You can follow the thread on lvgl's forum to see how it went step by step: https://forum.lvgl.io/t/support-for-python3/1098
What's Wrong with Touch Input?
As of July 4, 2020: Nothing! Touch input works 100%!
See the update below for all of the details
That's actually a good question.You can see in my last post in the lvgl forum thread:Thexpt7603_read()
function in the touch driver correctly reads the touch input coordinatesBut it does not properly pass along the coordinates to the rest of lvgl
I got pulled away to other projects and was not able to continue debugging. However, if anybody wants to carry on with the debug I'll do my best to point you in the right direction.What's Next
- We'll publish the current version as a package so everyone can try it out on their Omega2 Dash.
I'll post on this thread again when this is available.Done, see post below If anybody from the community is willing to carry on debugging, feel free to post in this thread and I'll give any pointers that I can.Fixed
-
Update!
The current version of micropython + lvgl for the Omega2 platform has been published as a package!
You can install it on your Omega2 Dash by running:
opkg update opkg install lv_micropython
The binary will be installed to
/usr/bin/micropython
.You can launch the REPL by running
micropython
or run a scriptmicropython <SCRIPT FILE>
All of this info and more is available in the OnionIoT/lv_micropython README on Github
For those interested in tackling the issue with touch input: We've also added instructions to the README on how to modify the code and build your own version of micropython
See https://github.com/OnionIoT/lv_micropython#build-instructions-for-openwrt and https://github.com/OnionIoT/lv_micropython#compiling-local-code
-
Another Update! Micropython+LVGL is now 100% working!
See the LVGL+Micropython section in the Omega2 Dash guide for all of the details on how to install and use lvgl-enabled micropython.
What was wrong?
In the lvgl bindings for micropython, there is a function for reading touch input from the XPT7603 device. This function's arguments did not match what the lvgl input device driver structure expected. So the touch input coordinates were getting read correctly, but they were not being propagated to the rest of the lvgl code.
See the commit that fixes it on GitHub.
Let us know how you like it!
We're stoked to see what everybody makes with LVGL + micropython and hear about your experiences with it!
-
Thanks, so far I am having good success with micropython and lvgl. I have been working through the lvgl widget examples on the document site and posting videos of my progress. Is there any plan to add a version of MQTT to micropython? I was able to install python-light and use it as the subscriber then handling the information exchange through a file, primitive but workable. It would be more elegant if I could just subscribe/publish from within the micropython code.
-
@Carey-Capaldi You can get mqtt (and a whole lot more) for micropython with the
micropython-lib
package.Just updated the Omega2 Dash guide with a new section on installing
micropython-lib
Let us know how it goes!