nOTG cable for the WLAN Pi M4
Workaround the missing OTG feature of the WLAN Pi M4! It is possible to deliver power and establish an Ethernet connection to the WLAN Pi from a single USB Type-C port from your laptop using a nOTG cable.
At the time of writing there are two models of WLAN Pi available:
- WLAN Pi R4 - Built upon the Raspberry Pi 4
- WLAN Pi M4 - Built upon an Mcuzone Carrier board hosting a CM4
Detailed comparison here:
One 'missing' feature of the WLAN Pi M4 is OTG support by the USB Type-C port. (If you are reading this, I suspect you already know what OTG stands for and what this means [if true, scroll on])
OTG - On The Go
With respect to the WLAN Pi, OTG refers to the ability of a single USB cable able to provide both power and establish a data link between a laptop and WLAN Pi. The data link takes the form of a virtual network interface, using ethernet over USB, making it possible to browse to the webGUI or ssh into the WLAN Pi directly from the host laptop.
On the 'previous' generations NEO 2 and Pro models of WLAN Pi the data/power port (Micro-B and Type-C, respectively) the OTG interface was configured with a static IP address and DHCP server so that any connected laptop would establish a network connection and be served up an IP address in the correct subnet so that the two devices could communicate without further user intervention.
The USB Type-C port on the WLAN Pi M4 is UNABLE to support OTG.
nOTG for the WLAN Pi M4
It is possible to workaround the lack of native OTG on the WLAN Pi M4.
Essentially we 'need' to provide power and IP connectivity to the WLAN Pi from a single port on the laptop with as little configuration as possible.
This USB Type-C to Ethernet and USB-A adapter from Uni gives us roughly 90% of what we need!
https://www.amazon.co.uk/dp/B0871ZL9TG
There are many similar items out there that should work equally well!
If you throw in:
- a 90 degree USB-A to USB Type-C adapter
- a short braided ethernet cable
- a short braided USB Type-C to Type-C cable
and - an USB-A Ethernet adapter
...and assemble them together into something like this monstrosity
It is possible to deliver power and establish an Ethernet connection to the WLAN Pi from a single USB Type-C port from your laptop.
One further configuration step is required to enable IP connectivity between the laptop and the WLAN Pi. When the WLAN Pi is in 'Classic' mode ethernet interfaces are configured as DHCP clients, it needs to be served an IP address.
The short path of least resistance is to make use of the 'internet connection sharing' feature on macOS or Windows to serve up an IP address to your WLAN Pi. This should work whether you have an active internet connection or not and comes with the additional benefit of providing internet access to the WLAN Pi (assuming your laptop has access). Keep reading to find out how!
...
One final variable depending on your use-case.
Do you wish to keep eth0
free?
Approach 1 - nOTG
Requires an additional USB-A to Ethernet adapter
If you wish to keep eth0
free, you can add an additional Ethernet interface eth1
to the WLAN Pi, make use of this interface for the nOTG connection.
eth1
can be added to the WLAN Pi with an USB-A to Ethernet adapter, assemble all the parts, plug in the power cable and attach the USB-A to Ethernet adapter to an adjacent USB-A port on the WLAN Pi.
You may verify that your WLAN Pi recognises the USB-A to Ethernet adapter by navigating to Interfaces via fpms (the front panel menu system), you should see e1
appear and disappear if you remove the adapter, eth0
should remain present but blank. Next we need to serve up an IP address.
Approach 2 - nOTG lite
Assumes you do not need to keep [ eth0 ] free for some other task
This approach requires less hardware but, ties up eth0
and looks slightly less aesthetically pleasing due to cables being attached to both ends of your orange box.
Next we need to serve up an IP address.
Internet Connection Sharing
DISCLAIMER / WARNING
When Internet Connection Sharing is active you MUST be aware that your laptop will run a DHCP service and hand out IP addresses on the interface(s) you have selected.
That is good in this specific scenario, where you connect a WLAN Pi to the other side of that interface! That is exactly what we came here for.
BUT...
If you use that ethernet interface for other tasks, tasks that do not require your laptop to be acting as a DHCP server! BAD, BAD things will start to happen when you plug that ethernet interface into an operational network.
You should absolutely be disabling 'internet connection sharing' when you are not actively using it.
macOS Ventura
Step 1 - Launch System Settings
Click on the Apple icon in your Menubar (very top left corner of your screen)
Select 'System Settings'.
Step 2 - Navigate to the 'Sharing' Pane
General > Sharing
Step 3 - Configure Internet Sharing
Check that Internet Sharing is disabled, click on the i to the right of the toggle switch
You can mess around with the settings in here to your heart's content
Share your connection from: Wi-Fi
To computers using: The Ethernet interface from your dongle
(for me, the Uni product appears, reassuringly as 'AX88179A')
Click Done
Step 4 - Enable Internet Sharing
That is it, toggle Internet Sharing on
After ~30 seconds, fpms should display eth1
with an assigned IP address.
macOS pre-Ventura
Step 1 - Launch System Preferences
Click on the Apple icon in your Menubar (very top left corner of your screen)
Select 'System Preferences'.
Step 2 - Navigate to the 'Sharing' Pane
Step 3 - Configure Internet Sharing
Check that Internet Sharing is disabled, click on the i to the right of the toggle switch
You can mess around with the settings in here to your heart's content
Share your connection from: Wi-Fi
To computers using: Check the box against the Ethernet interface from your dongle
After ~30 seconds, fpms should display eth1
with an assigned IP address
Internet Connection Sharing Windows
Step 1 - Check that Windows recognises the USB to Ethernet adapter
Step 2 - Navigate to Network & Sharing Centre
Step 3 - Activate Connection Sharing on the network interface with an internet connection
That's it, you are done, Windows should hand out an IP address to the WLAN Pi within 30-40 seconds.