Ethernet direct connection

Hi everyone,
I’m having problems connecting my laptop to the openflexure directly with an ethernet cable. The problem is that my laptop never gets an IP address. I don’t understand much about networks, but shouldn’t the raspberry be running a DHCP server? I’m running GNU/Linux in my laptop.
I’ve tried with a laptop running Windows and I could connect. Any clue?

That sounds as though the solution is in Linux networking rather than specific to the microscope. I would check again that it all works from a Windows laptop if you still have the Windows one. If it does work, then look for advice on general Linux to Raspberry Pi direct cable connection.

It may be that the network is in some wat ‘hosted’ by the laptop, and there is something that is automatic in Windows that needs a setting in Linux.

Hi @pcremades there’s no DHCP server: in order to work with a variety of different configurations, the Raspberry Pi’s ethernet port is left in more or less the default configuration (DHCP client). That means if you plug it into a network with a DHCP server, it will request an IP address, and use what it’s assigned. If you plug it in to a computer directly, both devices should end up with autoconfigured addresses in the link-local range 169.254... Once that’s happened (you may need to wait a moment for the devices to set up the link-local addresses), you should be able to acces the microscope via its mDNS name microscope (or microscope.local).

If your computer supports IPv6, this works even better - IPv6 interfaces always have a link-local address, and so there should always be a way to communicate whether or not the microscope is assigned another address.

I hope that makes sense - if you’re asking because you have tried microscope.local and it’s not working, perhaps we need to do a bit of debugging. I don’t often use mDNS from Linux, but I’m fairly sure it does work. You may need to download and/or configure it, depending on how your system is configured currently, though.

Hi @WilliamW, @r.w.bowman. Thank you for your reply. The thing is that my laptop (running Debian) keeps saying that it couldn’t setup the network when I connect the OpenFlexure directly with an ethernet cable. I don’t know much about network config, but I’ll ask some friends at the university for help. I’m sure that with the information you’ve provided me, they’ll figure out what’s going on.


1 Like

Hi @pcremades it sounds like whatever network manager tool you are using is trying to be helpful, but ultimately stopping the (usually fairly reliable) default behaviour. It’s odd that Linux does this and Windows doesn’t - usually it’s the other way around!

I think you should be able to get it working if you configure a static IP address on your ethernet card, starting with 169.254... Your network manager may still complain that there’s no internet connection on that interface - the key then would be to find a way to ignore the warning and keep it “up” anyway.

The other possibility is to add a DHCP server to the link - either set one up on the Pi (there are various guides online) or enable internet connection sharing from your computer to the Pi - though there are various good reasons why that might not be an ideal option (in particular, if you’re on a University network it may breach your terms of use).

Hi everyone,
I just wanted to tell you that we solved the problem. There is a “link-local” option in the network manager that I haven’t seen before.
I leave a screencast in case someone faces the same issue.



Hi @pcremades thanks for sharing that - that’s really helpful. It is a bit annoying to have to select it manually, but it’s great that you figured out how to make it possible. I’d like to figure out a way to make this automatic, but I think that could be quite hard…