Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct Windows Serial Interface Config COSMOS5 #1387

Closed
Donny3000 opened this issue Oct 21, 2021 · 8 comments
Closed

Correct Windows Serial Interface Config COSMOS5 #1387

Donny3000 opened this issue Oct 21, 2021 · 8 comments
Labels
Milestone

Comments

@Donny3000
Copy link

Donny3000 commented Oct 21, 2021

Good Afternoon,

I've been able to successfully install/build COSMOS5 from main/master and have been able to successfully migrate my COSMOS4 target (following the upgrade guide) to COSMOS5, build and upload my target gem file into COSMOS5 running on my Windows 10 host. However, my target is unable to connect to my hardware over serial, as it's producing the following error in the Command and Telemetry Server log output over and over:

image

To provide more context, this is my migrated target's plugin.txt file

image

From the log output, it appears that COSMOS 5 is trying to use the posix_serial_driver.rb instead of the win32_serial_driver.rb backend for the serial interface.

Am I missing additional configuration steps necessary to get my target's serial interface working properly? Or is there a way to somehow force or configure and interface to use the Win32 Serial Driver? I read through the COSMOS 5 Interface Configuration documentation and it seems that my plugin.txt is correct. But, I might be overlooking something. Thanks in advance for any assistance!

@ghost
Copy link

ghost commented Oct 21, 2021

You've run into the one real downside to Docker, in that you can't access local hardware (like serial ports), without running on a linux host and running a container with --priviledged (which is not ideal from a security standpoint).

The solution is to run an ethernet speaking bridge directly on the host computer, and configure COSMOS to talk to that.

This is implemented but not documented yet. Take a look at bridge and bridgesetup in the cosmos command line executable:
https://github.com/BallAerospace/COSMOS/blob/master/cosmos/bin/cosmos

You will also need to change your plugin to be a tcpip interface to connect to the bridge.

@Donny3000
Copy link
Author

Thanks, @ryanatball for your quick response and clarification! I will take a look at the information you have provided to get COSMOS 5 talking to my hardware.

@ghost ghost added the question label Oct 22, 2021
@ghost ghost added this to the questions milestone Oct 22, 2021
@ghost
Copy link

ghost commented Oct 22, 2021

Feel free to update with any additional information that would be useful to the community.

@ghost ghost closed this as completed Oct 22, 2021
@Donny3000
Copy link
Author

I'm running into an issue trying to set up the TCP bridge that @ryanatball mentioned earlier. I'm assuming the first step would be to create the bridge configuration file via bridgesetup. But, when I execute the bridgesetup command I get the following ruby error traceback

cosmos-control cosmos bridgesetup ruby error

From the error in the traceback, it appears that a connection is trying to be made to the redis COSMOS5 container at localhost:6379. So, I checked to make sure the redis container is indeed running with docker ps -a, of which it is.

docker ps -a confirmation output

So, to confirm we should create the configuration file first, and then use the configuration file to start the bridge? If so, why would I be seeing this ruby error when trying the create the bridge configuration file?

@ghost
Copy link

ghost commented Nov 3, 2021

Couple issues here. I have a fix in an internal pull request. If you are running Ruby 2.7, you can set the environment variable COSMOS_NO_STORE=1 and it should work as a temporary workaround.

@Donny3000
Copy link
Author

Thanks for the guidance, @ryanatball! I'll give that a try and see how I progress.

@ghost
Copy link

ghost commented Nov 4, 2021

@Donny3000 The full fix is now pushed to the master branch

@abdelrahman47
Copy link

Couple issues here. I have a fix in an internal pull request. If you are running Ruby 2.7, you can set the environment variable COSMOS_NO_STORE=1 and it should work as a temporary workaround.

I have the same problem. could you please explain how to set the environment variable cuz I tried to set it to the linux variables but the error is still there

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants