Closed green-codes closed 5 years ago
Can you access other kRPC services in C-nano/SerialIO, such as SpaceCenter? If so, please post a log file and a time (HH:MM) when you tried to access the MechJeb service. You can find the log file KSP.txt
in KerbalSpaceProgram
directory.
Now this is strange, I just managed to connect to MechJeb via C-nano in one game scene, but now I lost it again. I'm still trying to find out the exact sequence that reproduces the successful connection.
Also sorry for not including the logs before, got some bad pointers on where the log file is (EDIT: pardon the pun). Here are the errors:
[LOG 10:07:58.177] [KRPC.MechJeb] Initializing MechJeb instance... [ERR 10:07:58.179] [KRPC.MechJeb] No instance of ManeuverPlanner found
[EXC 10:07:58.179] TargetException: Non-static field requires a target
System.Reflection.MonoField.GetValue (System.Object obj)
KRPC.MechJeb.Maneuver.Operation.InitInstance (System.Type t)
KRPC.MechJeb.MechJeb+<>c.1 action) AssemblyLoader+LoadedAssembyList.TypeOperation (System.Action
1 action)
KRPC.MechJeb.MechJeb.InitInstance ()
KRPC.MechJeb.InitInstance.Start ()
And thanks for your time!
Okay, interesting thing, I can connect to KRPC.MechJeb as long as I have a MechJeb (AR202) control module on the ship, but not when I'm using the "MechJeb and Engineer for all!" mod. I'm guessing this is not something you can help with?
Isn't MechJeb included in all command modules (manned and unmanned) by default? I mean, I don't need any mod to use MechJeb without AR202 case.
I removed the old mod and the problem seems to persist.
(MAJOR EDIT: was inaccurate) This is how to reproduce the error: restart game, then load a ship straight from stock. I get the following error in the meantime:
[EXC 11:01:28.288] NullReferenceException: Object reference not set to an instance of an object KRPC.Server.SerialIO.ByteServer.Update () KRPC.Server.Message.RPCServer.Update () KRPC.Core.RPCServerUpdate () KRPC.Core.Update () KRPC.Addon.FixedUpdate ()
If I revert and load the same ship again, the error goes away.
Well, in all honesty you don't really need to look into this anymore, as I now know exactly how to circumvent the problem. Sorry for all the fuss and have a good day!
Which MechJeb2 module is your feature request related to? Please update the C-nano client to work with kRPC 0.4.8 and MechJeb 2.8.3 over C-nano/SerialIO.
Is your feature request related to a problem? Please describe: The C-nano client cannot connect to MechJeb, (the python client works, and so do other kRPC C-nano services). More specifically, I get a 'false' when running the krpc_MechJeb_APIReady() function linked from MechJeb.c. Attempting to perform actions (such as enabling an autopilot) doesn't do anything.
Describe the solution you would like: Given that kRPC.MechJeb currently works over TCP and the python client, hopefully it won't be too difficult to make the C-nano client work too. I'm making an Arduino interface (https://github.com/green-codes/LDSKY) that can take advantage of MechJeb, and it'll be wonderful if you can help make that possible.
Describe alternatives you have considered: As I can't get past krpc_MechJeb_APIReady(), all I can think of is making my Arduino interface an actual flight computer, a task that I'm in no shape to do at the moment. I really hope adding back C-nano support is something you can do relatively quickly.
Additional context: Nothing of importance. Thank you for your attention!