Connect to OFM without internet

Hi all, I have a question about the possibility to run the server without internet connection?

I am about to go to a location that is completely offline and all I have is a power cable and an ethernet cable. When I connect my mac and the OFM with the ethernet cable, I can ping the OFM, but the server does not start in the browser (I have a mac), says it is offline, which is accurate :slight_smile: But is it a necessary condition? Is there a way to work on an OFM in a complete offline mode?

I’ve seem amazing photos of people going field work in the jungle, so it is probably possible, I am just missing some pieces.

Thank you as always :slight_smile:

The OpenFlexure server does not require an internet connection. However there can be some issues with different computers which get very confused when there is a network connection which has no internet. I don’t use a mac, I think that I did try briefly on someone else’s mac and there was something that was an issue but it was not clear whether this was the mac or the ethernet dongle.

On Windows I regularly connect with no internet, using an ethernet cable and a USB-Ethernet dongle. To do this the computer and the Pi have to work out an ad-hoc network, and I think this is where sometimes it does not work. I find that there are some dongles which do not work with some computers, and I expect that Mac will deal with ad-hoc networks differently from Windows.

@j.stirling uses a small travel router which might work better in your situation. Again there is no internet connection to the router, but I think the router will take charge of the network. He did have some problems with Android devices which dropped connection to the microscope network as soon as they realised that there was no internet connection and went searching for other local networks instead.

Thanks @WilliamW.

The problem tends to be anything that is trying to hard to be clever.

So my Android tablet keeps disconnecting from WiFi when it finds there is no internet. There is an option in Android to turn this off for specific WiFi connections (but not in general), though Lenovo have a bug that ignores this setting. For my Lenovo table I fixed this with setting static DHCP for the android when it is connecting. By static DHCP, this is where you basically specify everything about the connection upfront, rather than letting the router assign you an IP. The bad thing about static DHCP is we loose MDNS. MDNS is the thing that allows us to use sensible human-readable names like microscope.local rather than IP addresses like 192.168.8.123.

In the case of connecting directly between the two devices over Ethernet I would assume there is no way it can disconnect, as it can with WiFi. I’d assume that one of two things is happening:

  • The local ethernet connection may also not support MDNS. So you need to find the IP address of the Pi
  • The local network also might not establish a “local-link” connection automatically without you going into network settings and changing

The internet seems to think that it should use the internal bridge connection and assign an IP address where the last digit is 1 higher than the address reported in ifconfig

Let us know if this helps

1 Like

If you can ping the OFM, that suggests there is a connection - but perhaps something else is getting confused. The first thing I’d check is what you mean by “ping the OFM” - if you mean running something like ping microscope.local in a terminal, it strongly suggests there is a working network connection. The output of the ping command likely also contains the IP address of the microscope, which can be very useful: I find that it’s sometimes the case that mDNS addresses (i.e. addresses ending .local) are resolved differently by different tools.

I’ve seen you have used the OFM quite extensively so please forgive the very basic question, but what exactly are you typing in the address bar when the web browser says it’s offline? About half the time when that happens to me, it’s because I made a typo, or I typed https instead of http, or I forgot to add the :5000. Sometimes it can also help to use the IP address rather than the hostname (e.g. entering http://169.254.123.456:5000/ instead of http://microscope.local:5000/). If ping has succeeded, you will often have the IP address in the output of that command.

If you were on Windows, I’d recommend using OpenFlexure Connect, because it does a reasonably good job of discovering the microscope using mDNS-SD (which, confusingly, has relatively little to do with resolving the microscope.local hostname using mDNS). However, we don’t have a mac build due to nobody on the developer team having a mac to build it on…

1 Like

It works! The solution was indeed using the IP address instead of the [OFM’s name.local]. Thank you so much for your advice!

Interestingly, since today, whether on wifi or on the local network, the OFM randomly loses network during scanning, sometimes after 4 images, sometimes after ~100. Very strange, especially when the OFM is connected with the laptop via the ethernet cable - how could the network break?

3 Likes

That sounds as though the mac is dropping the connection, possibly because there is no internet (like julian’s android tablet).

The scan should continue anyway, I think.

Glad I made the suggestion! It’s quite hard to determine whether it’s the OFM or your mac that disconnects - the OFM network configuration is set by the SD card image, so my suspicion is that your mac is periodically trying to “get connected” and losing its network connection to the microscope. It ought to come back again, and as William says the scan should continue. I can’t remember if you can easily get back to the “scan in progress” screen, but that is a feature we should consider adding if you can’t.

The network configuration is one of the most annoying aspects of making the microscope work: what we currently do is spend ~30 seconds looking for a DHCP server (e.g. if someone has connected the microscope to their home WiFi) and then default to a link-local address if not. Link-local addresses should be the right solution for this kind of thing, where you just want to connect two devices together. Unfortunately, many operating systems try to be helpful and consider link-local networks to be “broken” (because they don’t have internet access or a DHCP server). We have not yet found a universal solution to this…

It is a mystery - the network loss is reported only when I am doing the smart scanning, regardless whether I am on a hotspot or connected by an ethernet cable. It stops at variable intervals - sometimes after 3 images, sometimes after 30, or 60. I have to reload the page several time for the device to come back “online”. Outside of the smart scanning everything is perfect - I can navigate all over the slide for as long as I want, take pictures, no problem… Maybe I should just burn a fresh OS image?

In the logs I see “Module type “Illumination” not recognised.” but this doesn’t tell me much…

In the logs I see “Module type “Illumination” not recognised.” but this doesn’t tell me much…

That will be unrelated - the sangaboard firmware includes a module for controlling illumination which the default pysangaboard module doesn’t support (just means the features are unavailable).

1 Like