cl- Posted November 24, 2021 at 11:05 AM Share Posted November 24, 2021 at 11:05 AM The current macOS Brick Viewer version (2.4.20) can't find the OpenGL library to display the 3D view of the IMU 3.0 Bricklet. I'm on macOS 12.0.1. What OpenGl library are you looking for? PyOpenGL or something else? In the source I could only find QT packages which I'm sure I have installed. Cheers Claudio Quote Link to comment Share on other sites More sharing options...
photron Posted November 24, 2021 at 03:07 PM Share Posted November 24, 2021 at 03:07 PM I don't have macOS 12 at hand for testing. It works on macOS 10.15.7. We're using just Qt with directly loading the low level operating system OpenGL library. This is due to problems with the wrapping of the QtOpenGL module in PyQt at the time of developing this code. You can find the relevant code here: https://github.com/Tinkerforge/brickv/blob/master/src/brickv/render_widget.py Try running this two lines in Python on you Mac: import ctypes.util ctypes.util.find_library('OpenGL') I assume that the find_library call returns None for you, meaning it cannot find the system's OpenGL library. It's unclear to me why. In the long run we might just switch from OpenGL to Qt3D for this. Quote Link to comment Share on other sites More sharing options...
cl- Posted November 29, 2021 at 04:23 PM Author Share Posted November 29, 2021 at 04:23 PM After running import ctypes.util print(ctypes.util.find_library('OpenGL')) I get Quote /System/Library/Frameworks/OpenGL.framework/OpenGL It seems that it does find the library though. Quote Link to comment Share on other sites More sharing options...
photron Posted November 30, 2021 at 12:12 PM Share Posted November 30, 2021 at 12:12 PM Are you using the pre-build .dmg we provide for download? Or are you running brickv from source? If you're using the pre-build .dmg this might be some kind of packaging bug. If you're running from source, then I'm confused. On 11/24/2021 at 12:05 PM, cl- said: The current macOS Brick Viewer version (2.4.20) can't find the OpenGL library to display the 3D view of the IMU 3.0 Bricklet. Does it say "OpenGL library not found. Disabling 3D view." in the bottom on the brickv window? You can see from the code here, that this message is triggered by the ctypes.util.find_library('OpenGL') call returning None: https://github.com/Tinkerforge/brickv/blob/2e4a03ec4d5429144febe7d4a4eb2ed3e0503dd8/src/brickv/render_widget.py#L42 https://github.com/Tinkerforge/brickv/blob/2e4a03ec4d5429144febe7d4a4eb2ed3e0503dd8/src/brickv/render_widget.py#L100 So I don't really understand why that call works if you try it by hand, but doesn't seem to work in brickv. If you're currently using the pre-build .dmg, could you try running from source to see if this makes a difference? Quote Link to comment Share on other sites More sharing options...
cl- Posted December 1, 2021 at 02:50 PM Author Share Posted December 1, 2021 at 02:50 PM Unfortunately, I can't run Brick Viewer from source, as installing the requirements (pip3 install -r src/requirements.txt) fails. It has a problem with tzlocal Quote Collecting tzlocal Using cached tzlocal-4.1-py3-none-any.whl (19 kB) ERROR: Could not find a version that satisfies the requirement PyQt5_sip<4.20,>=4.19.11 (from pyqt5) (from versions: 12.7.0, 12.7.1, 12.7.2, 12.8.0, 12.8.1, 12.9.0) ERROR: No matching distribution found for PyQt5_sip<4.20,>=4.19.11 I'm using a Homebrew Python3 version and it seems that the dependencies cannot be made compatible. I'll try fixing it and get back to you asap. Quote Link to comment Share on other sites More sharing options...
photron Posted December 1, 2021 at 03:20 PM Share Posted December 1, 2021 at 03:20 PM 29 minutes ago, cl- said: It has a problem with tzlocal No, the problem is with PyQt5_sip, but the version numbers confuse me. Quote Link to comment Share on other sites More sharing options...
photron Posted December 1, 2021 at 03:23 PM Share Posted December 1, 2021 at 03:23 PM The PyQt5_sip dependency problem might be related to this line in requirements.txt PyQt5 == 5.11.3 Try changing that to PyQt5 == 5.15.6 or just to PyQt5 Quote Link to comment Share on other sites More sharing options...
cl- Posted December 1, 2021 at 03:42 PM Author Share Posted December 1, 2021 at 03:42 PM Sorry, you are right, tzlocal was not the problem indeed. I changed the PyQt5 dependency in requirements.txt to PyQt5 and that fixed it. I can now see the 3D view for the IMU v3 Bricklet. On 11/30/2021 at 1:12 PM, photron said: Does it say "OpenGL library not found. Disabling 3D view." in the bottom on the brickv window? Yes that was exactly what it said. Quote Link to comment Share on other sites More sharing options...
photron Posted December 1, 2021 at 04:31 PM Share Posted December 1, 2021 at 04:31 PM Okay, so it can work. But we still don't know if it is because of the packaging or the different PyQt5 version. You could try building the Brick Viewer .dmg file. For that you need to run "build_pkg.py --no-sign" in the virtualenv. The --no-sign option tells it to not sign the binaries, as you cannot do that on our behalf. Afterwards try the resulting .dmg file that is created in the same directory as the build_pkg.py file. If Brick Viewer from that .dmg has the same OpenGL problem, then it is triggered by the packaging. Quote Link to comment Share on other sites More sharing options...
cl- Posted December 1, 2021 at 05:16 PM Author Share Posted December 1, 2021 at 05:16 PM I did. The resulting .dmg in brickv/src/dist/macos/ doesn't have the OpenGL problem. It works just fine and renders the 3D view. So at least in my local case, packaging seemed to work all right. Quote Link to comment Share on other sites More sharing options...
photron Posted January 4, 2022 at 03:59 PM Share Posted January 4, 2022 at 03:59 PM I think I found out the problem. According to my tests the problem should be fixed in Brick Viewer 2.4.21. Quote Link to comment Share on other sites More sharing options...
cl- Posted January 19, 2022 at 02:27 PM Author Share Posted January 19, 2022 at 02:27 PM I'm happy to confirm that Brick Viewer 2.4.21 displays the 3D view on macOS (12.1) now. Thank you! Quote Link to comment Share on other sites More sharing options...
cl- Posted January 19, 2022 at 02:58 PM Author Share Posted January 19, 2022 at 02:58 PM There are two small things which might be worth improving in the next version, I guess: The dark mode uses bright font colours in the plot area, but the plot background does not adapt to the dark mode settings (it should be dark too). Hence, you cannot read the labels and measurements anymore, especially for magnetic field, Euler angles, etc. (see the arrow in the screenshot) One small problem with macOS: I cannot change the window dimensions while the plot is being filled with data. For the period of dragging the window to the new size, the plot stays unreadable, also after the dragging was done (see the rectangle in the screenshot) I can empty the plot, of course, and the data is ok again. Quote Link to comment Share on other sites More sharing options...
photron Posted January 24, 2022 at 05:10 PM Share Posted January 24, 2022 at 05:10 PM I've fixed the contrast issues with the plot widget. This was due to some hardcoded color choices. I can reproduce the plot overlapping itself when resizing the window. I need to look into more detail their why that happens. Alsmost looks like one misplaced datapoint that makes the plot jump back and forth once. Thanks for reporting. Quote Link to comment Share on other sites More sharing options...
photron Posted January 28, 2022 at 03:24 PM Share Posted January 28, 2022 at 03:24 PM Please try the attached Brick Viewer vrsion, that has these problems fixed. brickv_macos_2_4_21_snapshot_685f6c0.dmg Quote Link to comment Share on other sites More sharing options...
cl- Posted February 1, 2022 at 02:06 PM Author Share Posted February 1, 2022 at 02:06 PM The erroneous graphs are gone now. Great! What I do it (macOS 12.2) now is dark vertical lines in the plot whenever I switch to another tab in the Brick Viewer. I used two Accelerometers here for example and switched from the one to the other Bricklet many times. Each time the tab changed, the graphs plotted new vertical lines at the correlated time point. Or is that a feature that I don't understand? Cheers! Quote Link to comment Share on other sites More sharing options...
photron Posted February 1, 2022 at 02:51 PM Share Posted February 1, 2022 at 02:51 PM A vertical line indicates a gap in the plot. The plot stops recording data if you switch away from the tab. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.