BallAerospace / COSMOS

Ball Aerospace COSMOS
https://ballaerospace.github.io/cosmos-website/
Other
360 stars 129 forks source link

UDP interface #1719

Closed AstreeDeshayes closed 2 years ago

AstreeDeshayes commented 2 years ago

Hello,

I am trying to connect a new interface to my computer with udp. I have configured the "plugin.txt" file as the following :

VARIABLE operations_target_name OPERATIONS

TARGET OPERATIONS <%= operations_target_name %> INTERFACE <%= operations_target_name %>_INT udp_interface.rb 127.0.0.1 8777 nil BURST MAP_TARGET <%= operations_target_name %>

However, once uploaded on COSMOS, the CmdTlmServer displays that my interface is connected but there is the following error message :

OPERATIONS_INT: ECONNREFUSED : Connection refused /usr/lib/ruby/3.0.0/socket.rb:456:in __write_nonblock' /usr/lib/ruby/3.0.0/socket.rb:456:inwrite_nonblock' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/io/udp_sockets.rb:93:in block in write' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/io/udp_sockets.rb:91:inloop' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/io/udp_sockets.rb:91:in write' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/interfaces/udp_interface.rb:165:inwrite_interface' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/interfaces/interface.rb:285:in block in write' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/interfaces/interface.rb:319:inblock in _write' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/interfaces/interface.rb:319:in synchronize' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/interfaces/interface.rb:319:in_write' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/interfaces/interface.rb:257:in write' interface_microservice.rb:145:inblock in run' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/topics/interface_topic.rb:38:in block in receive_commands' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:167:inblock (3 levels) in read_topics' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:165:in each' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:165:inblock (2 levels) in read_topics' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:164:in each' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:164:inblock in read_topics' /usr/lib/ruby/gems/3.0.0/gems/connection_pool-2.2.5/lib/connection_pool.rb:63:in block (2 levels) in with' /usr/lib/ruby/gems/3.0.0/gems/connection_pool-2.2.5/lib/connection_pool.rb:62:inhandle_interrupt' /usr/lib/ruby/gems/3.0.0/gems/connection_pool-2.2.5/lib/connection_pool.rb:62:in block in with' /usr/lib/ruby/gems/3.0.0/gems/connection_pool-2.2.5/lib/connection_pool.rb:59:inhandle_interrupt' /usr/lib/ruby/gems/3.0.0/gems/connection_pool-2.2.5/lib/connection_pool.rb:59:in with' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:160:inread_topics' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:66:in public_send' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/utilities/store_autoload.rb:66:inmethod_missing' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/topics/topic.rb:32:in public_send' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/topics/topic.rb:32:inmethod_missing' /usr/lib/ruby/gems/3.0.0/gems/cosmos-5.0.6.pre.beta0/lib/cosmos/topics/interface_topic.rb:37:in receive_commands' interface_microservice.rb:57:inrun' interface_microservice.rb:41:in `block in start'

Also, when I am trying to send a command I have : Error sending OPERATIONS EXAMPLE due to RuntimeError: Connection refused

Does someone know why ?

Thanks, Astrée

ghost commented 2 years ago

I'm assuming you are trying to connect to a UDP receiver on the host. 127.0.0.1 used in plugin.txt refers to localhost of the container. You probably want host.docker.internal (try first) or sometimes 172.17.0.1 (try second) which reference the Docker host computer.

AstreeDeshayes commented 2 years ago

I still have some errors but I succeeded to send a command and to receive it so thank you !