OpenFlexure Blockly

We have been working to develop OpenFlexure Blockly. OpenFlexure Blockly enables you to automate the microscope in a beginner friendly way, without writing any code! This is built with Google’s Blockly visual programming library which is commonly used in schools as an education tool.

We hope this will be useful for education as well as people using the microscope who want to quickly put together scripts.

Currently we have ‘blocks’ for the core functionality of the microscope. In the future we will expand to incoporate the functionality of user contributed extensions. If there are more ‘blocks’ you would like to see, please let us know.

Using OpenFlexure Blockly

OpenFlexure Blockly is available in a variety of ways but they are all compatible with each other (i.e. if you save a script from one method, it will work in all of them).

On the internet

The easiest way to use OpenFlexure Blockly is through the web app, no installation required! Just type in the IP address of the microscope (or microscope.local) which is connected to the same network as your computer. It works with Firefox by default, but you will need to change a flag with Chrome and Edge

As an extension

You can install OpenFlexure Blockly as an extension, meaning that it works inside the OpenFlexure GUI. By clicking App you can also launch the OpenFlexure Blockly web app which is hosted on your microscope and it will connect automatically. More information on installing the extension can be found in the repository.


Hopefully you will find this a useful tool, either for yourself or for teaching others. If you do use it, let us know! Please provide feedback either here or by raising an issue.


The source code can be found in the repository.

@samuelmcdermott gave me the opportunity to play with this pre-release. It is really fun, and a great half-way house between using the built-in functions of the Openflexure web app and control directly from Python. It will do most things and I don’t need to remember any syntax :slight_smile: .

I did hit the Chrome/Edge problem. You can get around having to set the flag by copying the Blockly files to your computer and opening them locally. This also means that you don’t need to be connected to the internet. Of course using the Extension in the normal microscope interface gets round both issues.

A final note, all of the Openflexure instructions have the network name of the microscope as microsope.local as this is what is set in the server. Some networks (like mine) somehow mangle this and you find the microscope at microscope instead, without the .local