cl- Geschrieben November 24, 2021 at 11:05 Geschrieben November 24, 2021 at 11:05 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 Zitieren
photron Geschrieben November 24, 2021 at 15:07 Geschrieben November 24, 2021 at 15:07 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. Zitieren
cl- Geschrieben November 29, 2021 at 16:23 Autor Geschrieben November 29, 2021 at 16:23 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. Zitieren
photron Geschrieben November 30, 2021 at 12:12 Geschrieben November 30, 2021 at 12:12 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? Zitieren
cl- Geschrieben December 1, 2021 at 14:50 Autor Geschrieben December 1, 2021 at 14:50 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. Zitieren
photron Geschrieben December 1, 2021 at 15:20 Geschrieben December 1, 2021 at 15:20 29 minutes ago, cl- said: It has a problem with tzlocal No, the problem is with PyQt5_sip, but the version numbers confuse me. Zitieren
photron Geschrieben December 1, 2021 at 15:23 Geschrieben December 1, 2021 at 15:23 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 Zitieren
cl- Geschrieben December 1, 2021 at 15:42 Autor Geschrieben December 1, 2021 at 15:42 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. Zitieren
photron Geschrieben December 1, 2021 at 16:31 Geschrieben December 1, 2021 at 16:31 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. Zitieren
cl- Geschrieben December 1, 2021 at 17:16 Autor Geschrieben December 1, 2021 at 17:16 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. Zitieren
photron Geschrieben January 4, 2022 at 15:59 Geschrieben January 4, 2022 at 15:59 I think I found out the problem. According to my tests the problem should be fixed in Brick Viewer 2.4.21. Zitieren
cl- Geschrieben January 19, 2022 at 14:27 Autor Geschrieben January 19, 2022 at 14:27 I'm happy to confirm that Brick Viewer 2.4.21 displays the 3D view on macOS (12.1) now. Thank you! Zitieren
cl- Geschrieben January 19, 2022 at 14:58 Autor Geschrieben January 19, 2022 at 14:58 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. Zitieren
photron Geschrieben January 24, 2022 at 17:10 Geschrieben January 24, 2022 at 17:10 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. Zitieren
photron Geschrieben January 28, 2022 at 15:24 Geschrieben January 28, 2022 at 15:24 Please try the attached Brick Viewer vrsion, that has these problems fixed. brickv_macos_2_4_21_snapshot_685f6c0.dmg Zitieren
cl- Geschrieben February 1, 2022 at 14:06 Autor Geschrieben February 1, 2022 at 14:06 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! Zitieren
photron Geschrieben February 1, 2022 at 14:51 Geschrieben February 1, 2022 at 14:51 A vertical line indicates a gap in the plot. The plot stops recording data if you switch away from the tab. Zitieren
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.