You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just released a new ev3dev kernel on ev3dev-stretch that updates from 4.9.x to 4.14.x. This comes with a new display driver for the EV3 from the mainline kernel.
The new driver still provides a fbdev device (/dev/fb0) however, the memory layout is different. Because of limitations in the mainline kernel, there is no monochome. Instead it uses a 32-bit XRGB pixel format.
It's not clear to me whether the update() function in the 22 April Stretch image has been fixed. Is there something different I should be doing to be able to update the LCD? Should I expect a fix for this any time soon? Am I right in thinking that all the Stretch images released so far for the EV3 suffer either from the brickd hyperactivity bug or the update() function not working?
given the fact that this issue is still marked as open, I don't see why one would expect that it has been fixed.
in the meantime, if you want an older kernel with fixed brickd, I would suggest using an image older than 14 April and just upgrade the brickd package, but not the kernel (sudo apt update && sudo apt install brickd).
@ndward, you can help by testing if 3b34f78 works. You can do it by doing something like this in the EV3 command line:
git clone -b display-4.14 https://github.com/ev3dev/ev3dev-lang-python test-display-fix
cd ./test-display-fix
# test display by running some script from this directory,# or interactively by opening python3
If you run any script while in test-display-fix directory, then this version of ev3dev should be picked up instead of the one installed system-wide.
I followed your instructions, then put this script in the test-display-fix folder (specifically, I used SFTP Net Drive to copy this script from another folder, which caused the copy to no longer be executable, so I then made it executable with chmod). Is it correct that I put the script directly in the test-display-fix folder and not in a subfolder?
#!/usr/bin/env python3
from ev3dev.ev3 import *
from time import sleep
lcd = Screen()
lcd.clear()
lcd.update()
sleep(5)
When I ran that script (right-click + Run in the EV3 browser) I got
Starting: brickrun --directory=/home/robot/test-display-fix /home/robot/test-display-fix/lcdtestshort.py
Started.
----------
Traceback (most recent call last):
File "/home/robot/test-display-fix/lcdtestshort.py", line 6, in <module>
lcd.update()
File "/usr/lib/python3/dist-packages/ev3dev/core.py", line 3325, in update
raise Exception("Not supported")
Exception: Not supported
----------
Exited with error code 1.
I got the same result using python3 interactively.
If the font is large in the above paragraph then that is not deliberate.
This is an important point, not only for Python library and users related. We should announce and track all changes to synchronize the changes or at least try. For Java, I will have to see how to solve the Display issue too, and it is complex. :(
@ndward, thanks for testing! I've pushed a fix that should address the problem. You can get it by doing git pull from inside test-display-fix directory. Can you try if that works?
Hmm... I think I would add a special case for EV3 int Display.__init__(). If platform == EV3 and self.var_info.bits_per_pixel != 1 then create an 8-bit grayscale (PIL type 'L') image.
Then, for the conversion function, take the 'L' image one byte at a time and expand it to a 32 bit value, making R, G and B each having the same value.
def_gray_xrgb(self, value):
"""Convert grayscale to a 32-bit XRGB value. Value should be values 0 to 255. """return ((value<<16) | (value<<8) |value)
Activity
dlech commentedon Apr 15, 2018
In reality, though, the display will now use 2-bit (4 color) grayscale 😮
ddemidov commentedon Apr 16, 2018
So it looks like we should add a case for
self.var_info.bits_per_pixel == 32here with an appropriate encoder:ev3dev-lang-python/ev3dev/core.py
Lines 3314 to 3319 in 55f57ad
ddemidov commentedon Apr 22, 2018
3b34f78 might help, but I did not have time to update to the 4.14 kernel and actually test it.
ndward commentedon Apr 24, 2018
It's not clear to me whether the update() function in the 22 April Stretch image has been fixed. Is there something different I should be doing to be able to update the LCD? Should I expect a fix for this any time soon? Am I right in thinking that all the Stretch images released so far for the EV3 suffer either from the brickd hyperactivity bug or the update() function not working?
dlech commentedon Apr 25, 2018
given the fact that this issue is still marked as open, I don't see why one would expect that it has been fixed.
in the meantime, if you want an older kernel with fixed brickd, I would suggest using an image older than 14 April and just upgrade the brickd package, but not the kernel (
sudo apt update && sudo apt install brickd).ddemidov commentedon Apr 25, 2018
@ndward, you can help by testing if 3b34f78 works. You can do it by doing something like this in the EV3 command line:
If you run any script while in
test-display-fixdirectory, then this version of ev3dev should be picked up instead of the one installed system-wide.ndward commentedon Apr 25, 2018
I followed your instructions, then put this script in the test-display-fix folder (specifically, I used SFTP Net Drive to copy this script from another folder, which caused the copy to no longer be executable, so I then made it executable with chmod). Is it correct that I put the script directly in the test-display-fix folder and not in a subfolder?
When I ran that script (right-click + Run in the EV3 browser) I got
I got the same result using python3 interactively.
If the font is large in the above paragraph then that is not deliberate.
ddemidov commentedon Apr 25, 2018
The main module is now named
ev3dev2I think. Can you change the lineto
?
ddemidov commentedon Apr 25, 2018
Also, the
Screenclass is now calledDisplay. There was some big restructuring recently in thestretchbranch.ndward commentedon Apr 25, 2018
When I ran this script
I got
Starting: brickrun --directory=/home/robot/test-display-fix /home/robot/test-display-fix/lcdtestshort.py
Apart from Screen() becoming Display(), are there many other changes that need to be made in scripts? Is there a list of necessary changes somewhere?
jabrena commentedon Apr 25, 2018
This is an important point, not only for Python library and users related. We should announce and track all changes to synchronize the changes or at least try. For Java, I will have to see how to solve the Display issue too, and it is complex. :(
ddemidov commentedon Apr 25, 2018
@ndward, thanks for testing! I've pushed a fix that should address the problem. You can get it by doing
git pullfrom insidetest-display-fixdirectory. Can you try if that works?ddemidov commentedon Apr 25, 2018
The branch is yet to be released (this is a development branch). When that happens, I guess there will be a list of changes.
ndward commentedon Apr 25, 2018
Same simple script now gives:
ndward commentedon Apr 25, 2018
I added a line to draw text:
The script completed after 1m8s but no text was drawn.
ddemidov commentedon Apr 25, 2018
@dlech, does this look correct to you?
ev3dev-lang-python/ev3dev2/display.py
Lines 269 to 277 in de3029b
The only idea I have is to try and switch the byte order: now it is
0RGB, the other options to try areRGB0orBGR0.ndward commentedon Apr 25, 2018
dlech commentedon Apr 25, 2018
Hmm... I think I would add a special case for EV3 int
Display.__init__(). If platform == EV3 and self.var_info.bits_per_pixel != 1 then create an 8-bit grayscale (PIL type 'L') image.Then, for the conversion function, take the 'L' image one byte at a time and expand it to a 32 bit value, making R, G and B each having the same value.
ndward commentedon Apr 25, 2018
Update display for 4.14 kernel
ddemidov commentedon Apr 30, 2018
#462 is tested and works on stretch.
dlech commentedon May 5, 2018
Fix released in v1.2.0
Update display for 4.14 kernel (#462)
dwalton76 commentedon Nov 10, 2018
Can we close this one?
WasabiFan commentedon Nov 11, 2018
I think so. #501 covers the remaining work.