Using rasp-ap to turn OFM into an access point

Summary

A common scenario are users who would like to connect their computer to the microscope over WiFi, but aren’t able to connect via a WiFi router (for example if their institution uses eduroam or there is no WiFi router). A couple of users have reported using rasp-ap and this week I set it up for a user who needed their setup configured like this. It was very easy to do and allows you to directly correct to your Raspberry Pi over WiFi, without an intermediary router. This is just a quick note to say that it works and so that others are able to replicate.

What rasp-ap does

Rasp-ap is an open source tool that turns a Raspberry Pi into an WiFi access point (AP). Once installed it also provides a web interface for changing the AP settings and more complex functionality.

How to install

I followed the quick start guide to installing the tool. I did not follow their steps to update the packages on the Raspberry Pi, in case it broke the microscope software. I followed their recommended settings during the installation wizard.

The default IP address for your Raspberry Pi will now be: 10.3.141.1

Connecting to the microscope

On your computer, connect the WiFi to the new AP of the Raspberry PI. By default the SSID is raspi-webgui and the password is ChangeMe.

Viewing/changing AP settings

You should probably change the default passwords (both for the AP admin web interface and the AP). Either on your computer or the microscope’s web browser, go to 10.3.141.1 and use the web interface to make the changes (default username: admin, password: secret).

Controlling the microscope

If you are using OpenFlexure Connect, mDNS should work as expected and your microscope will show up in ‘Nearby Devices’. Alternatively, the default IP address will be 10.3.141.1 and the port is 5000. If you are controlling via a web browser, you will therefore need to connect to 10.3.141.1:5000.

1 Like

Thanks for this, it works great indeed.
I only have one issue, it looks like we need a way to control the scope wia the web interface, other than just send it to specific coordinates.
Maybe adding some arrow buttons on the web page will do the job?
Who can do this? :slight_smile:

I think buttons would be useful, there is an issue suggesting that in the repository ((#241) · Issues · OpenFlexure). We have not got round to discussing it yet.
If you have calibrated the motors on the stage then you can ‘click to move’ from the webapp, using a mouse or touchscreen. If you have a keyboard then the arrow keys navigate by steps of the size that you set in the navigate tab. Focus steps by page up and page down. This is not totally clear to a first user. One of the advantages I see for putting buttons in the interface is that there could be a mouseover popup that tells you the shortcut keys.

Thanks a lot, I am looking forward to trying this out. So far I have been using a separate router but I think this solution would be more streamlined when connecting to the microscope from other devices. Wouldn’t this summary be valuable to have on the webpage under how to Use your microscope?

As this is now possible as standard in Raspberry Pi OS, these instructions are likely obsolete, except for some edge cases. It can even be activated from the GUI (see drop down under advanced options).

1 Like

@samuelmcdermott Is that option present in Raspbian Buster, which is the basis of the the current released version OpenFlexure operating system, v2.11?

1 Like

First of all, I am not too familiar with Raspberry Pi OS’s and even less with network configuration work.

I followed the “Quick installer” steps from ( RaspAP — Simple wireless router setup for Debian-based devices ) except for updating the packages on the Raspberry Pi. (Out of curiosity. Does anyone know if running an update (“sudo apt-get update” and “sudo apt-get full-upgrade”) effects the Openflexure OS/img and functionality?)

Anyway, all in all I connected my OpenFlexure microscope to a monitor, keyboard, mouse and power supply. I had internet access via available Wi-Fi. In the terminal I ran:

sudo raspi-config

I did not do any changes, so in the end I guess it is redundant.

then I ran:

curl -sL https://install.raspap.com | bash

this installs RaspAp as well as configures and sets up a default wireless access point called “RaspAp”. I answered “Y” on all recommended settings and once finished, rebooted the raspberry.

Success! I can now directly control the microscope from other devices by just being connected to the network “RaspAP”, a network broadcasted by the microscope itself!

Afterwards, when using monitor+keyboard+mouse, I notice that the microscope does not seem to detect other wireless networks any longer.

RaspAp

Maybe turning the microscope into an access point disables regular Wi-Fi functions? I have no idea. To see if my loss of Wi-Fi had to do with RaspAp i tried to disable RaspAp using:

sudo systemctl disable hostapd dnsmasq raspapd

This worked and I could once again detect other wireless networks.

To re-enable the access point i ran:

sudo systemctl enable hostapd dnsmasq raspapd
sudo systemctl start hostapd dnsmasq raspapd

and the “RaspAp” network is back up and we are able to wirelessly connect and control the microscope!

Thanks again @samuelmcdermott !

2 Likes