Jump to content

[1.0.4] (2015-07-04) Telemachus – Telemetry and Flight Control in the Web Browser


Rich

Recommended Posts

Hey I downloaded Telemachus, installed it as said.

I have the parts. When i right-click on them, i can see all the things, and when i click on open link, it opens.

But then there is written: Page not found 404.

Wen i check the debug console, it says that telemachus is listenning to the ip adresses.

I tried with the default config and then by setting the port and the ip adress, still not working.

Link to comment
Share on other sites

Is it just KSP or is there something specific I need to allow I turned the firewall off no change still hangs

Just KSP. Not sure why it is hanging - was OS are you using?

Hey I downloaded Telemachus, installed it as said.

I have the parts. When i right-click on them, i can see all the things, and when i click on open link, it opens.

But then there is written: Page not found 404.

Wen i check the debug console, it says that telemachus is listenning to the ip adresses.

I tried with the default config and then by setting the port and the ip adress, still not working.

Could you show me a screen shot of the 404 please?

Link to comment
Share on other sites

Sorry if I missed the information, but are there any plans for adding a planets alignment feature into Telemachus? With that plus a way to visualize current orbit or trajectory (real-time would be best, but even simplified version with a few updates each minute would be great), and Telemachus would become absolutely mandatory for 99% of players who have a second monitor available.

Link to comment
Share on other sites

Hello! Excellent plugin. I was looking for a data output plugin for a while and here it is! Question though: how difficult would it be to transmute the raw output to a terminal emulator rather than a webpage? I figure the plugin output is already via IP, so I assume it would only require a different formatting, but I honestly haven't looked at the source (at work) to see the inner workings.

Here is what I envision: A (green/amber) VT220 or equivalent terminal emulator that is outputting current vital statistical information from the craft. Since there is already the ability to manually control the craft from the web page, that of course would be exceptionally nerdy and amazing to do from terminal input also, as shown below!

->

ATTITUDE

'MANUAL ATTITUDE CONTROL'

'READY'

YAW 20

PITCH 50

EXECUTE

'EXECUTING...'

'COMPLETE'

This would be 'more better' for remote operation of probes and such. I can see it snowballing out of control and becoming a space text adventure, but that's a risk we should all be willing to take :D. Of course if this is beyond the scope of the mod I understand, and I will look into doing it myself, although it's been a good 10 years since I've programmed anything!

Link to comment
Share on other sites

Is there any possibility that you can give information about how to access Telemachus' data from within java code (e.g. what type of connection should a Java application make to the Telemachus server, what format is the data that Telemachus transmits over the connection, and what are the commands that Telemachus recognises)?

Is it done through the use of string data, or is some of the data converted to byte form for efficiency reasons?

I ask because I want to write an Android interface so that I can directly use my tablet to control KSP without having to open a web browser (I don't like unnecessary middle-men) and so I can design my own interface scheme. I'm in the process of learning Java and have just covered sockets and InetAddress methods, and would prefer to work in Java as opposed to using Javascript and HTML if possible (if not, then I'll adapt).

Link to comment
Share on other sites

I have to look in the specifications but as far as I know you can simply access it like a webpage. I don't know how exactly you can do this in Java, but when you access something like HOSTNAME/?pe=o.timeToPe you should get a JSON document with the time to periapsis. You can add additional like HOSTNAME/?pe=o.timeToPe&ap=o.timeToAp to get also the time to apoapsis.

Oh you actually need something to decode the JSON document too.

Fabian

Link to comment
Share on other sites

I now have this working both in sandbox and career and its awesome as I can now plot my rockets. If I wanted to use the MIR's standard aerial is it just a simple cfg edit to add this bit to MIR's antenna part

MODULE

{

name = TelemachusDataLink

}

MODULE

{

name = TelemachusPowerDrain

powerConsumptionBase = 0.01

powerConsumptionIncrease = 0.02

}

Now that this working super impressed can i ask is it posibile to get multiple information graphs onto one page like altitude temp fuel etc

Edited by Virtualgenius
Link to comment
Share on other sites

Sorry if I missed the information, but are there any plans for adding a planets alignment feature into Telemachus? With that plus a way to visualize current orbit or trajectory (real-time would be best, but even simplified version with a few updates each minute would be great), and Telemachus would become absolutely mandatory for 99% of players who have a second monitor available.

There are plans for this, but I currently lack time.

Hello! Excellent plugin. I was looking for a data output plugin for a while and here it is! Question though: how difficult would it be to transmute the raw output to a terminal emulator rather than a webpage? I figure the plugin output is already via IP, so I assume it would only require a different formatting, but I honestly haven't looked at the source (at work) to see the inner workings.

Here is what I envision: A (green/amber) VT220 or equivalent terminal emulator that is outputting current vital statistical information from the craft. Since there is already the ability to manually control the craft from the web page, that of course would be exceptionally nerdy and amazing to do from terminal input also, as shown below!

->

ATTITUDE

'MANUAL ATTITUDE CONTROL'

'READY'

YAW 20

PITCH 50

EXECUTE

'EXECUTING...'

'COMPLETE'

This would be 'more better' for remote operation of probes and such. I can see it snowballing out of control and becoming a space text adventure, but that's a risk we should all be willing to take :D. Of course if this is beyond the scope of the mod I understand, and I will look into doing it myself, although it's been a good 10 years since I've programmed anything!

Is there any possibility that you can give information about how to access Telemachus' data from within java code (e.g. what type of connection should a Java application make to the Telemachus server, what format is the data that Telemachus transmits over the connection, and what are the commands that Telemachus recognises)?

Is it done through the use of string data, or is some of the data converted to byte form for efficiency reasons?

I ask because I want to write an Android interface so that I can directly use my tablet to control KSP without having to open a web browser (I don't like unnecessary middle-men) and so I can design my own interface scheme. I'm in the process of learning Java and have just covered sockets and InetAddress methods, and would prefer to work in Java as opposed to using Javascript and HTML if possible (if not, then I'll adapt).

I have to look in the specifications but as far as I know you can simply access it like a webpage. I don't know how exactly you can do this in Java, but when you access something like HOSTNAME/?pe=o.timeToPe you should get a JSON document with the time to periapsis. You can add additional like HOSTNAME/?pe=o.timeToPe&ap=o.timeToAp to get also the time to apoapsis.

Oh you actually need something to decode the JSON document too.

Fabian

Pretty much what xZise says is true, so you can simply use Java's support for HTTP requests to access the JSON data. The only real gotcha is to make sure you use a polling strategy which doesn't request more information until the previous request has completed, otherwise you end up DDoS'ing the Telemachus server.

I now have this working both in sandbox and career and its awesome as I can now plot my rockets. If I wanted to use the MIR's standard aerial is it just a simple cfg edit to add this bit to MIR's antenna part

MODULE

{

name = TelemachusDataLink

}

MODULE

{

name = TelemachusPowerDrain

powerConsumptionBase = 0.01

powerConsumptionIncrease = 0.02

}

Now that this working super impressed can i ask is it posibile to get multiple information graphs onto one page like altitude temp fuel etc

It is possible if you have a little bit of HTML/CSS knowledge, but it is not something I plan to add inbuilt support for.

Link to comment
Share on other sites

Could you show me a screen shot of the 404 please?

As "Sarcotome" I'm also experiencing the 404 page as the only response of the Telemachus server. I'm under OSX 10.9. I checked with netstat, and found that the plugin is listening on the IPADDRESS PORT for *.* connections but whatever page I try to access it always responds with it's 404 page... I checked KSP.log and everything seems normal. Cheked also the plugin installation and everything is there ... all html pages dll etc... at the right place under Gamedata/Telemachus... The part is working: deploying/retracting antenna, showing menu.... Don't know where to look to solve this and I WANT to make this work...

Edited by alains
Link to comment
Share on other sites

Sounds like this could be a Telemachus issues localised to OSX. I will look into it.

Is there a way (in the config) to enable detailed debug to see what's happening, request handling, file access for a request, where the 404 response is triggered ???

I don't have Unity sdk but can I compile Server.dll alone from your git sources and put some debug print lines to track this thing?

Link to comment
Share on other sites

Is there a way (in the config) to enable detailed debug to see what's happening, request handling, file access for a request, where the 404 response is triggered ???

I don't have Unity sdk but can I compile Server.dll alone from your git sources and put some debug print lines to track this thing?

Unfortunately a recompilation is required to turn debug mode on, and even then it isn't complete enough to help in this case.

If you want to compile Telemachus from the source you only need to have a copy of KSP, so that you can reference its API. This is the file you will need to instrument - https://github.com/richardbunt/Telemachus/blob/master/Telemachus/src/IOPageResponsibility.cs

I am away from my development box for 2 weeks otherwise I would take a look myself.

Link to comment
Share on other sites

Unfortunately a recompilation is required to turn debug mode on, and even then it isn't complete enough to help in this case.

If you want to compile Telemachus from the source you only need to have a copy of KSP, so that you can reference its API. This is the file you will need to instrument - https://github.com/richardbunt/Telemachus/blob/master/Telemachus/src/IOPageResponsibility.cs

I am away from my development box for 2 weeks otherwise I would take a look myself.

OK, Thanks... I'll try this and I let you know my findings....

Link to comment
Share on other sites

OK here are my first results: the file path generated for the OKResponsePage in IOPageResponsibility.process method is wrong for OSX:

I injected a throw new PageNotFoundResponsePage in the exception catching of the process method in IOPageResponsibility.cs. like this:

publicboolprocess(Servers.AsynchronousServer.ClientConnectioncc,HTTPRequestrequest)

{

if(request.path.StartsWith(PAGE_PREFIX))

{

try

{

OKResponsePagepage=newOKResponsePage(

KSPByteReader,KSPTextReader,

request.path.Substring(PAGE_PREFIX.Length));

((Servers.MinimalHTTPServer.ClientConnection)cc).Send(page);

returntrue;

}

catch(Exceptione)

{//ALAIN

thrownewPageNotFoundResponsePage(

"IOPageResp::process()exception:'"+e.Message+"'<br/>"+e.StackTrace+"<br/><br/>"+

"fileName='"+request.path.Substring(PAGE_PREFIX.Length)+"'<br/>"+

"escapeFileName(fileName)='"+escapeFileName(request.path.Substring(PAGE_PREFIX.Length))+"'<br/>"+

"buildPath(escapeFileName(fileName))='"+buildPath(escapeFileName(request.path.Substring(PAGE_PREFIX.Length)))+"'<br/>"

);

//returnfalse;

}

}

returnfalse;

}

when I open telemachus/information.html in chrome the result is:

IOPageResp::process() exception: 'Could not find a part of the path "/Volumes/RAWSTORAGE/KSP_0_22/KSP.app/GameData/Telemachus/Plugins/PluginData/Telemachus/information.html".'

at System.IO.FileStream..ctor (System.String path,

at System.IO.File.ReadAllText (System.String path) [0x00000] in :0

at Telemachus.IOPageResponsibility.m__9F (System.String fileName) [0x00000] in :0

at Servers.MinimalHTTPServer.HTTPResponse.m__1 (Servers.MinimalHTTPServer.ByteReader br, Servers.MinimalHTTPServer.TextReader tr, System.String filename, System.Collections.Generic.Dictionary`2& attr, Servers.MinimalHTTPServer.HTTPResponse r) [0x00000] in :0

at Servers.MinimalHTTPServer.HTTPResponse..ctor (Servers.MinimalHTTPServer.ByteReader br, Servers.MinimalHTTPServer.TextReader tr, System.String fileName) [0x00000] in :0

at Servers.MinimalHTTPServer.OKResponsePage..ctor (Servers.MinimalHTTPServer.ByteReader br, Servers.MinimalHTTPServer.TextReader tr, System.String fileName) [0x00000] in :0

at Telemachus.IOPageResponsibility.process (Servers.AsynchronousServer.ClientConnection cc, Servers.MinimalHTTPServer.HTTPRequest request) [0x00000] in :0

fileName = '/information.html'

escapeFileName(fileName) = '/information.html'

buildPath(escapeFileName(fileName)) = '/Volumes/RAWSTORAGE/Kerbal_Space_Program/KSP_0_22/KSP.app/Contents/../GameData/Telemachus/Plugins/PluginData/Telemachus//information.html'

I suspect that the method UnityEngine.Application.datapath used in buildPath() gives a different string under Windows and OSX... since on OSX GameData folder is on the same level than KSP.app....

as a quick test I changed the static path in buildPath to:

"/../../GameData/Telemachus/Plugins/PluginData/Telemachus/"

...and this worked!!

I hope this helps, regards, Alain

Edited by alains
Link to comment
Share on other sites

Thanks for your investigative work alains; this is helpful in 2 ways: 1) It will make it easier for me to create a hotfix when I return to base; and 2) while I do have an OSX machine, it is strictly a work only device so it is useful to have some OSX testing once in a while.

Rich

Link to comment
Share on other sites

Thanks for your investigative work alains; this is helpful in 2 ways: 1) It will make it easier for me to create a hotfix when I return to base; and 2) while I do have an OSX machine, it is strictly a work only device so it is useful to have some OSX testing once in a while.

Rich

You're welcome to PM me if I can help... and I forgot to say that, but thanks for the plugin, it's great!

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...