This post is a repost of a blog entry from 12th November 2015 on Kerbal Space Program forum (soon to be defunct).
The K-42 project have been on the back burner for a while due to a near rage quit.
I had the whole thing up and running and all seemed well until I
actually started playing the game. I experienced crashes all the time
and couldn't quite figure out what caused them. Every time I tried to
fly a mission, the game crashed after around 2-10 minutes of play time.
I tried to remove all mods except KSPserialIO, it still crashed. I
thought it might be due to sending control packets asyncronously so I
limited the send rate to be the same as the receive rate. It became a
tiny bit more stable. I removed the control packets totally and
implemented the whole thing as two joystick controls with 20 buttons
each and only used KSPserialIO to get output from the game. Still
crashing. I decreased update frequency and transmision speed and thought
problem solved, but noooo, crashes came less frequent but seemed to be
proportional to the total amount of packets sent by the mod.
So, as it is never too late to give up, i decided to make a tactical retreat and forget about KSPserialIO.
Next choice was Telemachus. Looked nice but I would need to build a
demon that read json data and translated it into a serial byte stream. I
started to look for information about using web sockets and json when I
discovered a mod that could make my life much easier, kRPC.
Why parse json when you can use a Python lib to read parameters from KSP
by simple functions and variables? That was exactly what kRPC was
about. All I had to do was to install kRPC, a Python interpreter, a
serial communication library and ... learn Python.
Four days into the process I have a working daemon transferring data from KSP to my command panel.
All there is left to do now is to test if it is stable. Please wish me luck.
No comments:
Post a Comment