roboticslab-uc3m / pytrigno

Simple Python interface to the Delsys wireless EMG system ros2 publisher of IMU + EMG data
MIT License
1 stars 0 forks source link

Deploying on NUC #5

Open jgvictores opened 8 months ago

jgvictores commented 8 months ago

For some reason, the NUC was always only seeing 169.254.206.16

Thus: docker run -it --rm -e HOST_IP=169.254.206.16 --network host pytrigno via #2

Notes regarding IP in C:\Program Files (x86)\Delsys, Inc\EMGworks\SensorBaseControl.exe:

jgvictores commented 8 months ago

Sin título

jgvictores commented 8 months ago

Despite apparently there, docker run -e HOST_IP=172.17.0.1 --network host pytrigno does not work.

jgvictores commented 8 months ago
apt update
apt install inetutils-ping iproute2 # ping, ip
jgvictores commented 8 months ago

imagen

jgvictores commented 8 months ago

Changed the IP4 static address of vEthernet (WSL) from the above to the misterious 169.254.206.1 (note the 1 not 16; netmask 255.255.255.0) and now have a nice working compact:

docker run -e HOST_IP=169.254.206.1 pytrigno
jgvictores commented 8 months ago

Also works changing BOTH to 169.254.206.16.

jgvictores commented 8 months ago

Also works changing BOTH to 172.254.206.16.

So, essentially, IP_HOST has to match the IP of the vEthernet (WSL)

In any case, fixing #2 was a good idea and has proved to be a very good tool due to its flexibility.

jgvictores commented 7 months ago

In SensorBaseControl.exe it is not required to press top Start Analog, our Python script does it (in fact, if you do, you get a warning that already done). Upon connection, bottom Stopped passes to Remote (1 user).

jgvictores commented 7 months ago

https://learn.microsoft.com/en-us/windows/wsl/networking

jgvictores commented 7 months ago

Don't get your hopes up, only the TCU is running on the NUC. Docker is on other linux machine because Docker on Windows uses WSL and communications with WSL are complicated:

docker run -it --rm -e HOST_IP=windows.machine.ip.address --network host pytrigno

Where --network host is only required to see the websocket externally, so exposing port 9090 would have been enough (however, in real life we'll probably not be running the bridge here, so network host seems reasonable).

Screenshot from 2024-02-13 11-30-54

imontesino commented 7 months ago

The correct command should be:

docker run -it --rm -e HOST_IP=windows.machine.ip.address --network host --ipc host --pid host pytrigno 

pid: host and ipc:host allow the docker process to function as host process and communicate using shared memory when two dockers containers are run in a single machine