You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Recently I tried almost all the installation methods to work with Yarp.
Among all of them, I found the WSL2 way pretty interesting but limited for some scenarios.
Before discussing the limitations, let me describe the installation procedure that anyone can follow to work with Yarp using WSL2.
Download and Install everything you need to work with Yarp. In my case, I need to work with yarprobotinterface and embObjMotionControl device, so I had to install the following projects:
As of now, we had internet available (by default) to download and build the projects above, but now it's time to activate yarpserver and run the yarprobotinterface. To do that you need to change the IP address inside your WSL2 environment in order to be able to communicate with your device throughout an ETH Physical Network Interface.
#!/bin/bashdefroute=$(ip r |grep default |wc -l)ip a flush dev eth0ip addr add 10.0.1.104/24 dev eth0if [ $defroute == 1 ] then ip r delete defaultfi
Make this script executable:
chmod +x /root/scripts/network.sh
Finally, restart your WSL2 with PowerShell.
wsl --shutdown
Now if you enter your WSL2 environment and check the IP Address of your eth interface, it should be the one you set in point 5: 10.0.1.104, and you would have to be able to ping every device in the subnet (e.g. 10.0.1.1).
Limitations
If you choose to develop using WSL2, to the best of my knowledge, you have to consider that there is only one Network Interface available.
This is critical when you need both an internet connection and communication with your ETH device.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi guys,
Recently I tried almost all the installation methods to work with Yarp.
Among all of them, I found the WSL2 way pretty interesting but limited for some scenarios.
Before discussing the limitations, let me describe the installation procedure that anyone can follow to work with Yarp using WSL2.
Installation
yarprobotinterface
andembObjMotionControl
device, so I had to install the following projects:yarpserver
and run theyarprobotinterface
. To do that you need to change theIP address
inside your WSL2 environment in order to be able to communicate with your device throughout an ETH Physical Network Interface.Network Setup
A method I found is using the
Hyper-V
:First of all, you have to set the IP Address of your ETH adapter. In my case, I set IPv4 to
10.0.1.104
.List your host adapter with Powershell with administrative privileges:
Get-NetAdapter
In my case, it was
Ethernet
.Set-VMSwitch -Name WSL -NetAdapterName Ethernet
The VMSwitch automatic will change the type from internal to external
/etc/wsl.conf
file and write in it the following:Create
/root/scripts/network.sh
with:Make this script executable:
chmod +x /root/scripts/network.sh
wsl --shutdown
Now if you enter your WSL2 environment and check the IP Address of your eth interface, it should be the one you set in point 5:
10.0.1.104
, and you would have to be able to ping every device in the subnet (e.g. 10.0.1.1).Limitations
If you choose to develop using WSL2, to the best of my knowledge, you have to consider that there is only one Network Interface available.
This is critical when you need both an internet connection and communication with your ETH device.
Beta Was this translation helpful? Give feedback.
All reactions