Adding a M.2 ethernet port
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 609
- Thank you received: 196
27 Mar 2025 19:07 - 27 Mar 2025 19:15 #325090
by Hakan
Adding a M.2 ethernet port was created by Hakan
For some time I have been setting up a plasma system using a N100 mini-PC and ethercat drives 3xECT60 and one of my own Metalmusing EaserCAT-7000 board for IO and torch height. It is working fine, but there is the occasional, sometimes more than occasional message in dmesg/journal, datagrams UNMATCHED
In this case it is not a catastrophe, the ethercat cards easily recovers.
It means that the EtherCAT server sends out a packet and expects a packet back. For some reason it doesn't come back in time (I think).
So the focus is on this mini-PC, a T8 Firebat pro plus. It has two network ports, both Realtek. It is small, draw around 10 W, three HDMI and three USB 3 ports. Had the network worker better it would have been good, but no.
The network ports areI have of course tested with the realtek dkms driver, and added boot options. It gets better with the dkms driver but there is still the occasional datagram UNMATCHED. I don't want them.
I have seen in the past that all Intel network adapter perform better than this. So I will add an Intel network adapter to this mini-PC.
What I have in mind is to replace the WiFi card with some kind of ethernet card. The WiFi is an M.2 card, size 2230.
That's the options I have. No PCIE, no mini-PCIE. Just a M.2 2230 E-key WiFi card position.
In this case it is not a catastrophe, the ethercat cards easily recovers.
It means that the EtherCAT server sends out a packet and expects a packet back. For some reason it doesn't come back in time (I think).
So the focus is on this mini-PC, a T8 Firebat pro plus. It has two network ports, both Realtek. It is small, draw around 10 W, three HDMI and three USB 3 ports. Had the network worker better it would have been good, but no.
The network ports are
Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15)
I have seen in the past that all Intel network adapter perform better than this. So I will add an Intel network adapter to this mini-PC.
What I have in mind is to replace the WiFi card with some kind of ethernet card. The WiFi is an M.2 card, size 2230.
That's the options I have. No PCIE, no mini-PCIE. Just a M.2 2230 E-key WiFi card position.
Attachments:
Last edit: 27 Mar 2025 19:15 by Hakan.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 609
- Thank you received: 196
27 Mar 2025 19:31 #325093
by Hakan
Replied by Hakan on topic Adding a M.2 ethernet port
My first experiment was to add an M.2 to PCIE adapter, and put in an Intel I210 card I have.Here is what that looks like
There is the small M.2 card that goes in the slot and then there is the rather stiff cable that connects to the PCIE slot. And I plugged in the I210 there.
The biggest problem with this setup is that relatively stiff cable. It runs right over the screw that secures the M.2 board in place. I had to bend the cable, it is quite stiff. The cable became sandwiched between the adapter board and the M.2 system disk that sits on top. I got it there in the end but not ideal.
As for the function - brilliant! After startup, the I210 showed up as a PCIE network adapter, it showed up in the interfaces list. I did nothing, just started the mini-PC.
There is the small M.2 card that goes in the slot and then there is the rather stiff cable that connects to the PCIE slot. And I plugged in the I210 there.
The biggest problem with this setup is that relatively stiff cable. It runs right over the screw that secures the M.2 board in place. I had to bend the cable, it is quite stiff. The cable became sandwiched between the adapter board and the M.2 system disk that sits on top. I got it there in the end but not ideal.
As for the function - brilliant! After startup, the I210 showed up as a PCIE network adapter, it showed up in the interfaces list. I did nothing, just started the mini-PC.
Attachments:
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 609
- Thank you received: 196
27 Mar 2025 19:38 #325094
by Hakan
I put in the MAC-address for the new adapter into /etc/ethercat.conf, and restarted ethercat service.
There were no initial datagram UNMATCHED messages, so I use the plasma table for some minutes.
Even after a day there were no datagram UNMATCHED messages, so I call that a win.
I even went back from isolcpus=1,2,3 to no isolpcus, it works just fine without that.
The verdict is: it works.
The stiff cable is a problem. And overall making a nice package of this will be a challenge.
Replied by Hakan on topic Adding a M.2 ethernet port
I put in the MAC-address for the new adapter into /etc/ethercat.conf, and restarted ethercat service.
There were no initial datagram UNMATCHED messages, so I use the plasma table for some minutes.
Even after a day there were no datagram UNMATCHED messages, so I call that a win.
I even went back from isolcpus=1,2,3 to no isolpcus, it works just fine without that.
The verdict is: it works.
The stiff cable is a problem. And overall making a nice package of this will be a challenge.
Attachments:
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 609
- Thank you received: 196
27 Mar 2025 19:58 #325099
by Hakan
Replied by Hakan on topic Adding a M.2 ethernet port
Next I tested a M.2 ethernet adapter, Intel I226 on a M.2 card and a cable to lead out to the RJ45 connector.
It's the same M.2 A+E key 2230 size card.
It turns out the cable runs over the screw also in this case. The cables are now much thinner and much easier to bend so it isn't particularly easy to make room for the securing screw but can be done. I think I broke the connector on the board but it continues to work.
The function was just as good with this M.2 network adapter. The adapter showed up in the pci listing automatically, showed up in the interfaces list also automatically and when I switched ethercat config to this new network adapter, ethercat worked just as well.
I decided to use this one, mostly because it was easier to make a nice installation. Here it is where the RJ45 connector is in a plastic housing, glued to the top of the T8.
The verdict: It works. Tricky with the cables on the M.2 board. Easier to make a nice installation of the RJ45 connector.
For both these ways of adding a network board to a mini-PC I must say that there are many ifs and buts and maybes that need to be figured out beforehand. The absolute recommendation is to buy the right system to start with.
I tried to follow that advice and looked around for another N100-based motherboard and there are a few out there, even with Intel network adapter.
I test-fitted it in the cabinet, I used my old trusty J1900 board. And while there is room for it, there isn't much extra room. And the QtPlasma interface can use more CPU power me think.
In the end I thought this could be a fun experiment. And as i happens both products work.
It's the same M.2 A+E key 2230 size card.
It turns out the cable runs over the screw also in this case. The cables are now much thinner and much easier to bend so it isn't particularly easy to make room for the securing screw but can be done. I think I broke the connector on the board but it continues to work.
The function was just as good with this M.2 network adapter. The adapter showed up in the pci listing automatically, showed up in the interfaces list also automatically and when I switched ethercat config to this new network adapter, ethercat worked just as well.
I decided to use this one, mostly because it was easier to make a nice installation. Here it is where the RJ45 connector is in a plastic housing, glued to the top of the T8.
The verdict: It works. Tricky with the cables on the M.2 board. Easier to make a nice installation of the RJ45 connector.
For both these ways of adding a network board to a mini-PC I must say that there are many ifs and buts and maybes that need to be figured out beforehand. The absolute recommendation is to buy the right system to start with.
I tried to follow that advice and looked around for another N100-based motherboard and there are a few out there, even with Intel network adapter.
I test-fitted it in the cabinet, I used my old trusty J1900 board. And while there is room for it, there isn't much extra room. And the QtPlasma interface can use more CPU power me think.
In the end I thought this could be a fun experiment. And as i happens both products work.
Attachments:
The following user(s) said Thank You: tommylight, rodw
Please Log in or Create an account to join the conversation.
- unknown
- Offline
- Elite Member
-
Less
More
- Posts: 269
- Thank you received: 92
27 Mar 2025 22:05 #325113
by unknown
Replied by unknown on topic Adding a M.2 ethernet port
Great work

Please Log in or Create an account to join the conversation.
- rodw
-
- Away
- Platinum Member
-
Less
More
- Posts: 11135
- Thank you received: 3699
28 Mar 2025 10:05 - 28 Mar 2025 10:06 #325149
by rodw
Replied by rodw on topic Adding a M.2 ethernet port
Great stuff. I have always maintained the more efficient Ethercat protocol makes it more robust than the hm2_eth protocol used by Mesa and I think you proved that with your tests.
There are a few additional optimisations you can do for either Intel or Realtek NIC's and I cover them here
docs.google.com/document/d/1jeV_4VKzVmOI...diY/edit?usp=sharing
Some settings to disable Energy Efficient Ethernet which causes latency excursions and the forum scripts to set IRQ affinity
I might also suggest disabling coalescing as discussed in man hm2_eth as I think it might also help
linuxcnc.org/docs/devel/html/man/man9/hm2_eth.9.html
Anyway, my J1900 PC with Realtek NIC's is loving these settings and it running Ethercat perfectly. Currently running Trixie on it.
With regard N100 PC's with Intel NIC's, this one looks interesting even though it has a few too many NIC's. What is interesting is the RS485 serial port already built in for plasma cutters and VFD's
www.alibaba.com/product-detail/Linkleaps...N_1601225258750.html
This will be my next Linuxcnc PC
There are a few additional optimisations you can do for either Intel or Realtek NIC's and I cover them here
docs.google.com/document/d/1jeV_4VKzVmOI...diY/edit?usp=sharing
Some settings to disable Energy Efficient Ethernet which causes latency excursions and the forum scripts to set IRQ affinity
I might also suggest disabling coalescing as discussed in man hm2_eth as I think it might also help
linuxcnc.org/docs/devel/html/man/man9/hm2_eth.9.html
Anyway, my J1900 PC with Realtek NIC's is loving these settings and it running Ethercat perfectly. Currently running Trixie on it.
With regard N100 PC's with Intel NIC's, this one looks interesting even though it has a few too many NIC's. What is interesting is the RS485 serial port already built in for plasma cutters and VFD's
www.alibaba.com/product-detail/Linkleaps...N_1601225258750.html
This will be my next Linuxcnc PC
Last edit: 28 Mar 2025 10:06 by rodw.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 609
- Thank you received: 196
28 Mar 2025 11:52 #325156
by Hakan
Replied by Hakan on topic Adding a M.2 ethernet port
Regarding robustness, I have downloaded new firmware to my IO card on a running linuxcnc system. It still works and comes back online. One can always wonder how good it was that it was away for half a minute. But nothing crashed, nothing stopped.
Thanks for that document. I had already looked into it and tested what you write there.
Unfortunately it wasn't sufficient on this mini-PC and these realtek network adapters to make the datagrams UNMATCHED go away.
On another system I have it worked fine on the builtin realtek driver though. If I remember, your settings worked on the J1900 I briefly tested.
I am aware of the coalesce settings, but I didn't have to set them to zero on the Intel cards. It worked fine anyway, they are at 3 usecs still.
When I come around to it I will set them to zero in the interfaces file.
I can't find a good way to enter non-energy-efficient mode. It doesn't seem possible (at least easily) to set it in the interfaces file.
If I remember it resets the interfaces when entering or leaving ee mode so nothing I want to do too often.
There are plenty of those mini PC but it is exhausting to search for them. They have product listings with CPU options that are dirt cheap, but after choosing the N100, memory and disk they cost quite a bit more. The one you list look alright, not that I need RS485. Found it on AliX as well. There is now the N150 which is almost identical to the N100. I wouldn't pay much more for that one, maybe a fiver more.
Thanks for that document. I had already looked into it and tested what you write there.
Unfortunately it wasn't sufficient on this mini-PC and these realtek network adapters to make the datagrams UNMATCHED go away.
On another system I have it worked fine on the builtin realtek driver though. If I remember, your settings worked on the J1900 I briefly tested.
I am aware of the coalesce settings, but I didn't have to set them to zero on the Intel cards. It worked fine anyway, they are at 3 usecs still.
When I come around to it I will set them to zero in the interfaces file.
I can't find a good way to enter non-energy-efficient mode. It doesn't seem possible (at least easily) to set it in the interfaces file.
If I remember it resets the interfaces when entering or leaving ee mode so nothing I want to do too often.
There are plenty of those mini PC but it is exhausting to search for them. They have product listings with CPU options that are dirt cheap, but after choosing the N100, memory and disk they cost quite a bit more. The one you list look alright, not that I need RS485. Found it on AliX as well. There is now the N150 which is almost identical to the N100. I wouldn't pay much more for that one, maybe a fiver more.
Please Log in or Create an account to join the conversation.
- rodw
-
- Away
- Platinum Member
-
Less
More
- Posts: 11135
- Thank you received: 3699
29 Mar 2025 01:25 #325218
by rodw
Replied by rodw on topic Adding a M.2 ethernet port
Point 22 refers to eee for intel
Disable energy efficient ethernet. Add this to kernel parameters with isolcpus
igb.EEE=0
Sorry,the document is a bit haphazard as I kept adding stuff as I found it.
Disable energy efficient ethernet. Add this to kernel parameters with isolcpus
igb.EEE=0
Sorry,the document is a bit haphazard as I kept adding stuff as I found it.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
Less
More
- Posts: 609
- Thank you received: 196
29 Mar 2025 11:05 - 29 Mar 2025 11:32 #325235
by Hakan
Replied by Hakan on topic Adding a M.2 ethernet port
Doesn't work. The i226 uses the igc driver.
Neither igc.EEE=on or igc.EEE=off does work, entered just by chance.
As it turns out, eee is disabled by default on the new i226 card so all is good there.
Coalesce is set like thiswhich is perhaps how it always have been done. No need for any tx-usecs, that was the point. In fact, that is an error to add tx-usecs.
Neither igc.EEE=on or igc.EEE=off does work, entered just by chance.
As it turns out, eee is disabled by default on the new i226 card so all is good there.
Coalesce is set like this
iface enp2s0 inet manual
hardware-irq-coalesce-rx-usecs 0
Last edit: 29 Mar 2025 11:32 by Hakan. Reason: colesce
Please Log in or Create an account to join the conversation.
- rodw
-
- Away
- Platinum Member
-
Less
More
- Posts: 11135
- Thank you received: 3699
29 Mar 2025 11:59 - 29 Mar 2025 12:00 #325238
by rodw
Replied by rodw on topic Adding a M.2 ethernet port
Yes you are doing it as PCW does it in man hm2_eth
Untested but you could try adding this to /etc/network/interfacesthen restart
You can check if enabled with
Untested but you could try adding this to /etc/network/interfaces
iface enp2s0 inet manual
hardware-irq-coalesce-rx-usecs 0
pre-up /usr/sbin/ethtool --set-eee $IFACE eee off
You can check if enabled with
sudo ethtool --show-eee enp2s0
Last edit: 29 Mar 2025 12:00 by rodw.
Please Log in or Create an account to join the conversation.
Time to create page: 0.310 seconds