Open Gfurst opened 6 years ago
Did you select the proper connection manager when starting the game? I don't use RemoteTech and CommNet works as expected (my GUI gets very transparent, buttons cannot be used, but the script finishes its job even without signal).
I'm sure, connectivity manager setup properly, commsat disabled for the save.
two things not happening: 1- kOS loses control of the vessel, throttle and steering(possibly) when vessel is not connected 2- kOS loses connection to KSC even when there is a working connection
Some details as requested:
Case number 1: video Here you see kOS autopilot in action and a short reach antennae, kOS immediately stops controls when RT loses signal (excuse the bald rocket scientist in the background). This was a test in sandbox mode, new save, and somehow kOS didn't ask for the connectivity manager, in which case it may the where the fault is. Craft file.
Case number 2: video
What happens here is that I try to run a script from Volume 0, and as soon as it detaches kOS complains about lost connection, even though there is a working antennae and connection. I had to do this because I was trying to log some running data, where as controls were all on me. This works fine if script is run from the core's Volume. Craft file.
Here is a list of my Gamedata folder, though it may not be as accurate, since some mods have different folder names and some may have been uninstalled but had left overs (I use ckan for everything).
I may have found a potential reason for this issue. If you look at the vessel module code here:
https://github.com/KSP-KOS/KOS/blob/develop/src/kOS/Module/kOSVesselModule.cs#L319-L362
You'll find that we don't actually reset the counter used to continuously check for Remote Tech to change. I'm going to try modifying that section of the source and see if it helps. It could be that on your computer the race condition we're attempting to guard against takes more than two physics ticks.
I haven't had a chance yet to install your mods and try to replicate the issue, but I thought I'd at least check on the logic if I could.
So I have finally tried and have some results:
So maybe if you want to check for connection on a "manned only", there is a way to get that passive module from RT. Otherwise it seem that the main issue has been solved.
(Speaking as the tester/merger of hvacengi's PR)
I cannot confirm whether this fixed the problem because I never had the problem in the first place on RT and could not reproduce it. I could merely test that it didn't cause new problems when I tried using it, and that's the best I could do.
Therefore even though merging PR #2276 auto-closed this issue, I want to re-open this issue until @Gfurst has a chance to try it to confirm whether or not it fixed the problem. Even @hvacengi who created the PR was unsure whether the PR was sufficient to fix the issue - just that it was one possible cause of it.
@Gfurst - do you have the ability to compile this and try it or do you need one of us to create a ZIP for you to try?
I am also having this issue or an issue similar to it. started on my career mode save had an issue where when my rocket went to the radio dark side of the mun to do a circulation burn. script unwarped the ship properly but when it was time to do the maneuvers nothing happened.
Concerned with this I opened a new sandbox save to test. launched myself with script as usual did a rough circulation burn. when it came time to run my detailed circulation burn program the warps and prints worked properly but when i did not have a direct connection to the ksc no lines that controlled steering or throttle worked.
I had this today, would be great if anybody has any idea why KOS might be unable to control ship when RT connection is lost. Script keeps executing, unwarp works fine, can't change heading though. Also, I can still interact with the console.
@drachs Do you have the remote tech connectivity manager selected or do you have one of the other ones?
Also, Remote Tech doesn't load all the modules into vessels that lack relay antennas. It makes it a pain to query it and ask it if it thinks you should be allowed to have control. Sometimes you have to put a relay antenna (not just direct) on vessels just to get RT to answer properly to kOS's queries about connectivity. I don't know if that's the issue here.
@nuggreat I was on "PermitAllConnectivityManager". When I switched to "RemoteTechConnectivityManger" the script still can't crontol the ship when RemoteTech says, "No Connection". But if I cntrl+C the script I now get a message at the bottom of my terminal that says "Signal lost. Waiting to re-acquire signal." and I can't execute any commands, though I can still type them.
That is how it is suppose to work you can run a script before you loose connection and it will keep running but you can't send new stuff to kOS with out a connection. If you try to use kOS and RT with out using the "remoteTechConnectivityManager" then kOS does not know you are using RT and thus doesn't run the code it needs to so it can bypass the remote tech control lock outs.
@Dunbaratu I didn't realize Relay Antenna's were a thing in RemoteTech, I thought they were just a stock idea. I haven't unlocked any in the tech tree yet so I suppose that means I can't try this out yet.
@nuggreat Right, but my script which I started should be able to control attitude and thrusters right? It's still not able to control anything.
If you have the right connectivity manager set yes it should. The only other thing that can stop it is if you don't also have a normal probe core because RT is dumb thinks you can't control stuff unless you have a probecore/command pod.
Relay antenna are not a RT thing there is omni and directional. Unless something changed since I last looked at the mod
Nuggreat is right- you do need a robotic probe core. RT contains the following incorrect reasoning: "If the vessel is one that requires a kerbal in it to be controllable anyway then having signal is irrelevant so we won't bother loading the mechanism that tracks signal paths for that vessel. It's computationally expensive to track that so any excuse not to track it is welcome." The problem is that kOS needs that mechanism loaded because it defers to RT to tell it whether a connection exists, rather than trying to re-invent the wheel and do RT's work over again. RT tells kOS there is no controllable connection even though there is a kerbal in the capsule, because RT only checks when there's a probe core there.
So if you have a vessel with no probe core, and only a manned capsule, then yes RT will pretend there's no valid usable control mechanism when kOS calls its API method for that purpose.
I do have a probe core, so that's not it. I think I'll probably just un-install RT since I can't seem to get it to work.
It's also possible there is a real bug there. RT with kOS hasn't been tested in a while and RT might have changed.
I have put my craft in a sandbox game and tried it with a relay antenna. That didn't help.
Just as a sanity check, I also put a Kerbal on an external command seat and ran the launch to make sure there were no bugs in my script or problems with my ship.
Commands such as "PRINT ADDONS:RT:AVAILABLE." and "PRINT ADDONS:RT:HASCONNECTION(SHIP)." all seem to work as expected.
Remotetech v1.9.8, kOS 1.2.1, and KSP 1.10.1. I also have many other mods installed.
Additional tests: I was able to execute the node successfully with RemoteTech's flight computer.
The message from RemoteTech's API "RTLog.Verbose("Flight: {0} Adding Sanctioned Pilot", RTLogLevel.API, id);" never appears in my log, though that might be a LogLevel Issue. I have no idea if it would show normally or not.
Snippet from the part of my flight where things go wrong bellow. "ToggleFlyByWire: throttle False" spams the logs hundreads of times while my ascent program is running. Then I create the secularization node and run my "node" script. Node script directs craft into WARP, drops out of warp at T-60s from node and hangs as it is unable to align to the node's DELTAV vector.
That's all I got, I'm out of ideas. Happy to run tests if anyone wants.
[LOG 19:15:52.509] kOS: FlightControlManager: ToggleFlyByWire: throttle False [LOG 19:15:52.631] kOS: FlightControlManager: ToggleFlyByWire: throttle False [LOG 19:15:52.756] kOS: FlightControlManager: ToggleFlyByWire: throttle False [LOG 19:15:52.871] kOS: FlightControlManager: ToggleFlyByWire: throttle True [LOG 19:15:52.871] kOS: Breaking Execution Automatically Contexts: 2 [LOG 19:15:52.871] kOS: Popping context 2 [LOG 19:15:52.871] kOS: FlightControlManager: ToggleFlyByWire: throttle False [LOG 19:15:52.872] kOS: FlightControlManager: ToggleFlyByWire: steering False [LOG 19:15:52.872] kOS: Removed Context File Line:Col IP label opcode operand [LOG 19:15:52.872] kOS: Deleting 0 pointers and restoring 0 pointers [LOG 19:15:52.872] kOS: New current context File Line:Col IP label opcode operand [LOG 19:15:52.872] kOS: Execution Broken [LOG 19:15:58.903] kOS: Breaking Execution Manually Contexts: 1 [LOG 19:16:13.592] kOS: Pushing context staring with: File Line:Col IP label opcode operand [LOG 19:16:13.592] kOS: Saving and removing 4 pointers [LOG 19:16:16.632] [RemoteTech] ModuleRTAntenna: Remove TRANSMITTER success. [LOG 19:16:16.659] 9/5/2020 7:16:16 PM,kOS-IRWrapper,Attempting to Grab IR Types... [LOG 19:16:31.285] kOS: FlightControlManager: ToggleFlyByWire: steering True
Is it just me, or does craft loses control immediately when signal is lost, contradicting what is expected of the mod:
I happen to have a video if you like.