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
I have been working to set up OpenC3 COSMOS on my local computer and I am struggling to create a UDP interface in either Ruby or Python. I have a simple listener for UDP packets that I run locally and am able to send packets from within a docker container to that listener by using the host.docker.internal hostname. The OpenC3 documentation also states that when setting up a plugin interface, host.docker.internal is a valid host IP for the UDP interface. However, when I create a Python plugin and use the same port that I have tested before, I get the following error:
Microservice DEFAULT__INTERFACE__UDP_INT dying from exception
Traceback (most recent call last):
File "/openc3/venv/lib/python3.11/site-packages/openc3/microservices/microservice.py", line 51, in class_run
microservice.run()
File "/openc3/python/openc3/microservices/interface_microservice.py", line 589, in run
self.connect()
File "/openc3/python/openc3/microservices/interface_microservice.py", line 743, in connect
self.interface.connect()
File "/openc3/venv/lib/python3.11/site-packages/openc3/interfaces/udp_interface.py", line 132, in connect
self.write_socket = UdpWriteSocket(
^^^^^^^^^^^^^^^
File "/openc3/venv/lib/python3.11/site-packages/openc3/io/udp_sockets.py", line 147, in __init__
super().__init__(
File "/openc3/venv/lib/python3.11/site-packages/openc3/io/udp_sockets.py", line 56, in __init__
if UdpReadWriteSocket.multicast(external_address, external_port):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/openc3/venv/lib/python3.11/site-packages/openc3/io/udp_sockets.py", line 127, in multicast
return ipaddress.ip_address(host) in ipaddress.ip_network("224.0.0.0/4")
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3.11/ipaddress.py", line 54, in ip_address
raise ValueError(f'{address!r} does not appear to be an IPv4 or IPv6 address')
ValueError: 'host.docker.internal' does not appear to be an IPv4 or IPv6 address
The Ruby UDP interface does not throw the same error, however the command sender does error 30 seconds after sending the command, saying it failed due to not hearing a cmd ack within 30 seconds. I also don't see any packets on my listener from the Ruby interface, either. Is this a problem with me mis-configuring the docker network stack? AFAIK I have not made any changes to the default cosmos-project other than to create my new plugin and define my own base target and interface.
Any idea what the issue here might be? I have been able to get the TCPIP interface working with host.docker.internal but I am struggling with the UDP interfaces. Any advice or further documentation would be very useful. Thank you!
The text was updated successfully, but these errors were encountered:
I think your python issue is the fact we're using ipaddress.ip_address and passing in a host. The correct way to call this is host_ip = socket.gethostbyname('host.docker.internal') and then use the IP. I'll mark this as a bug and we'll get that corrected.
However, I don't know why the Ruby side would be misbehaving. If you're using docker compose note that it creates a network named after the directory with _default so typically that would be cosmos-project_default when using our cosmos-project. If you run your container with docker run --network cosmos-project_default <CONTAINER> hopefully that will work.
I have been working to set up OpenC3 COSMOS on my local computer and I am struggling to create a UDP interface in either Ruby or Python. I have a simple listener for UDP packets that I run locally and am able to send packets from within a docker container to that listener by using the
host.docker.internal
hostname. The OpenC3 documentation also states that when setting up a plugin interface,host.docker.internal
is a valid host IP for the UDP interface. However, when I create a Python plugin and use the same port that I have tested before, I get the following error:The Ruby UDP interface does not throw the same error, however the command sender does error 30 seconds after sending the command, saying it failed due to not hearing a cmd ack within 30 seconds. I also don't see any packets on my listener from the Ruby interface, either. Is this a problem with me mis-configuring the docker network stack? AFAIK I have not made any changes to the default cosmos-project other than to create my new plugin and define my own base target and interface.
Any idea what the issue here might be? I have been able to get the TCPIP interface working with host.docker.internal but I am struggling with the UDP interfaces. Any advice or further documentation would be very useful. Thank you!
The text was updated successfully, but these errors were encountered: