LED grid illumination

Hello, I’m assembling a Delta stage v1.1.0 (I’ve enjoyed the v1.0.0 so much I had to make another!), and I’ve assembled the LED grid illumination module for it. It doesn’t appear the ‘How to Install’ section of the gitlab repository has been populated, could someone provide guidance on how to properly install the extensions for the led grid illumination? Thanks!

To elaborate on the previous post, I’m attempting to install the grid illumination extension. I’ve installed the extension folder in the vars/openflexure/extensions/microscope_extensions folder per the documentation, but am unsure as to the granular details of how to get the extension to load in the microscope UI. Perhaps there is a step-by-step reference on how to install extensions, or someone could provide guidance? Thanks!

have you tried to “Force reload”?

Yes I have tried to “Force reload” to no avail. I am not an expert in python or raspberry pi, so I am very likely just missing a detail that one of greater skill might take for granted so is not explicitly stated in the instructions.

I’m downloading the extension packages from github here per the instructions: Files · master · OpenFlexure / microscope-extensions / LED grid illumination extension · GitLab

Then I’m installing the package per the documentation (install the module, then add another file to import the module): Introduction — OpenFlexure Microscope Software documentation

So far I’ve tried the grid_illumination and phase_contrast extensions with neither loading in the UI.

As an update, on a whim I installed the video_extension.py extension into /var/openflexure/extensions/microscope_extensions (with phase contrast and led grid extensions also included in the folder), after which the phase contrast extension began to load in the UI but not the video or led grid extensions. Perhaps there is some generalized issue with loading extensions?


There will be some python libraries that those extensions use which will be need to be installed into the ofm virtual environment: ofm activate. I will write how to do this in the extensions’ readme, and update this thread when I have done so. Once these modules have been installed, then if the extension is in the correct folder, it should load into the UI automatically.

The extensions installation experience is in the process of being improved to make it a lot simpler. If you have some suggestions, then please take a look at that OFEP. Thanks!

Great thank you very much!

Hello Samuel, would it be possible for you to list what libraries require installation in ofm activate here? Thanks!

Off the top of my head…

The video extension requires ffmpeg-python.

The LED extension requires adafruit-circuitpython-dotstar.

The phase contrast extension requires Pillow.

1 Like

Great thank you very much. I’m sure it will be covered in the updated readme, but just attempted installing the libraries in ofm activate via pip and received ‘errno13 permission denied’.

The default pi user dones’t have the correct permissions and so you will need to set the correct permissions with:

sudo chmod -R g+w /var/openflexure/
sudo adduser pi openflexure-ws
ln -s /var/openflexure/application/openflexure-microscope-server/ ~pi/

and then you should be able to install the modules

1 Like

Installation instructions for these extensions are now in the repo. Please let me know if you run into any problems following them.

Thank you for posting the instructions. The instructions are well aligned with what I tried based on Sam’s earlier guidance, but I went ahead and went through the instructions again with a new download of the raspberry pi image, a new card, and downloaded the extension again. After following the instructions (activating SPI, installing libraries, copying extensions folders to /var/openflexure/extensions/microscope_extensions) I am still having the same problem. The Phase Contrast extension does show in the UI, but I don’t see anything indicating the led grid illumination extension. If I attempt capture in the phase contrast extension it returns the error ‘object has no attribute ‘led_grid’’.

Hmm, that’s strange, can you check the logs if there are any errors? If there’s an error it will be during extension loading so the easiest way to see it would probably be to do

ofm restart; ofm journal

Please post the results here, that should help us figure out what’s going on.