Orb:Connect alpha released

Status
Not open for further replies.

yagni01

Addon Developer
Addon Developer
Donator
Joined
Feb 8, 2008
Messages
463
Reaction score
0
Points
16
Location
Atlanta, GA
Well, I finally got the nerve to release my first add-on. Orb:Connect allows remote access to the Orbiter API (or a lot of it) over sockets. There have been a lot of requests lately for reverend's OUIPC, and I hope this will be an adequate substitute. You can find it at: [ame="http://www.orbithangar.com/searchid.php?ID=3395"]Orb:Connect v1.0[/ame]

Its based on the OUIPC code, and many thanks to reverend for permission to build on it.

Those of you that fly Doug Beachy's excellent XR-series vehicles will find some special messages via an enhanced public interface. Any vessels that extend that interface (its public and available with the Orb:Connect source code) can also benefit from the extended messages.

I hope you enjoy it.
 

yagni01

Addon Developer
Addon Developer
Donator
Joined
Feb 8, 2008
Messages
463
Reaction score
0
Points
16
Location
Atlanta, GA
Just curious... What is the difference between this and OUIPC?
In a nutshell, it operates the same way, but it has more commands available and I think its message structure is a little shorter and more intuitive. For example, in OUIPC both commands and arguments had embedded decimals/dots, which made parsing more difficult, especially when many decimal arguments or return values were involved. In Orb:Connect, delimiters are colons and commas making for better readability and simpler parsing. at least for me.

Another huge advantage for me is the vessel extensions available with the XRVesselCtrl interface provided by dbeachy. Any vessel that implements that interface can have many systems accessible that are not available through the standard VESSEL2 interface, allowing external duplication of 2D panels. Brilliant for my flight deck.
 

Jax6213

Donator
Donator
Joined
Feb 22, 2008
Messages
36
Reaction score
0
Points
0
Location
Seattle
Perhaps I lack the understanding, but what is this program and what does it do?
 

Zatnikitelman

Addon Developer
Addon Developer
Joined
Jan 13, 2008
Messages
2,302
Reaction score
6
Points
38
Location
Atlanta, GA, USA, North America
Basically, it allows passing commands over a network interface. For many people this is simply running solo on their computer so the "network" exists solely in their computer. The IP address used in this case would be the loopback 127.0.0.1. However, this can be extended to operate over a LAN, or over the internet. So it could end up developing into a multiplayer system, but short term atleast, it is a good basis to a mission control system.
 

yagni01

Addon Developer
Addon Developer
Donator
Joined
Feb 8, 2008
Messages
463
Reaction score
0
Points
16
Location
Atlanta, GA
Basically, it allows passing commands over a network interface. For many people this is simply running solo on their computer so the "network" exists solely in their computer. The IP address used in this case would be the loopback 127.0.0.1. However, this can be extended to operate over a LAN, or over the internet. So it could end up developing into a multiplayer system, but short term atleast, it is a good basis to a mission control system.
Or in my case to drive my flight deck hardware and displays. Zat is correct in that the wider appeal might be mission consoles. The biggest advantage is that you don't have to write them in C++ - you can use any language that supports sockets.

LAN use is appropriate, but I wouldn't recommend it for internet use as the network handling is primitive and there is no ability to have commands execute at specific times. Network latency would make remote landing. . .exciting.
 

reverend

Addon Developer
Addon Developer
Beta Tester
Joined
Apr 14, 2008
Messages
221
Reaction score
2
Points
18
I have tested OUIPC extensively locally, on a LAN, and across the internet.

Since you're using the server from OUIPC, your application should work just as well over the Internet, however, this all depends on what you're actually trying to do with it.

If you're trying to query the simulation state, that'll be fine. If you're trying to use it to make a remote auto-pilot, you may be in trouble. You'd be better to have the autopilot code in the simulator and just use a network command to activate it.

Just a note for others too btw: it's not that I didn't complete OUIPC. For all intents and purposes, it could be considered complete. The server itself is complete. The ability to listen for and serve multiple clients simultaneously is complete. The command list is the only thing that wasn't 'complete' because I did not implement every possible available function in the Orbiter API. I implemented as many functions as I needed access to for my applications, and a few others.

OUIPC is complete in the aspect that it allows the programmer to extend the command list to their own needs.

OUIPC was also extended by Rob Conley for Project Mercury for Mercury Mission Control.

I will be doing more work on OUIPC at a later date when I implement it as the ASCII part of a ASCII/Binary system for telemetry data & audio, and video transmission.

I'm glad to see someone else making use of my stuff :)
 

davewave

Addon Developer
Addon Developer
Joined
Jun 17, 2008
Messages
92
Reaction score
0
Points
0
OUIPC

how do I access this using VB .net because you only have a JAVA version and the DLL isn't recognised.

Do you have an SDK or an API list for this?
 

Biscuit

Member
Donator
Joined
May 12, 2008
Messages
181
Reaction score
0
Points
0
Location
Navarre, FL
Hmmm ... this could have some nice possibilities ....

I could 'pilot' from home, and do 'mission control' while at work.

I like it!

:speakcool:
 

yagni01

Addon Developer
Addon Developer
Donator
Joined
Feb 8, 2008
Messages
463
Reaction score
0
Points
16
Location
Atlanta, GA
how do I access this using VB .net because you only have a JAVA version and the DLL isn't recognised.

Do you have an SDK or an API list for this?
You don't need to link the dll into your client. There are many example VB network clients on the web that you can use as a foundation. The source code is here [ame="http://www.orbithangar.com/searchid.php?ID=3394"]Orb:Connect v1.0 C++ Project[/ame] but its just a matter of sending a string to the port and receiving one back. The user manual explains all the currently implemented messages.
 

davewave

Addon Developer
Addon Developer
Joined
Jun 17, 2008
Messages
92
Reaction score
0
Points
0
IP

yagni,
I'm using async sockets in VB .NET and I can connect to the server but I never get any reply from the server

I send data but I don't receive data and I know it should work because this socket works with my other applications and also the JAVA sample code provided with orbconnect works.

Whats the problem???
 

davewave

Addon Developer
Addon Developer
Joined
Jun 17, 2008
Messages
92
Reaction score
0
Points
0
m

I've made a threaded implementation and now its fine. Thanks
 

davewave

Addon Developer
Addon Developer
Joined
Jun 17, 2008
Messages
92
Reaction score
0
Points
0
elements

Yagni.
I got problems with OrbConnect.
I can't seem to get a return from Elements2
How do I call this.
Ive tried everything:

eg.
1) SHIP:FOCUS:Elements2:Arg1,Arg2
2) SHIP:FOCUS:Arg1,Arg2:Elements2

Also I don't understand why i need to input MJD and Frame as arguments. Why can't I just get access to the elements2 as per the orbiterAPI ?


Edit:
Also It seems that I am getting ERR02 when I try call any function which requires more then one argument.
Could you please specify the format and provide examples which you have tested for these, particularly Elements2
Just copy and paste the string you used to get elements2 given a specific MJD.

Also I was reading the API reference for orbiter and it states that if you pass an MJD=0 into elements2 function then it automatically assumes the current time. Does you OrbConnect take this into account.

Thanks for anyhelp
 
Last edited:

yagni01

Addon Developer
Addon Developer
Donator
Joined
Feb 8, 2008
Messages
463
Reaction score
0
Points
16
Location
Atlanta, GA
Sorry. Documentation error. You need to specify the reference body as the first argument. Example:
Code:
ship:focus:elements2:Earth:0:0
returning:
Code:
ship:focus:elements2:Earth:0:0=Earth,6580349.463387,0.006394,0.780446,3.785045,4.839981,5.955167,51982.736517,0,6580214.956788,6538275.923544,6622423.003230,2.871791,2.875174,1.428587,1.431970,2.873485,42073.539843,5312.322338,2884.273362,228.112193

I didn't create an optional arg version of the command, but I'll make a note to include it in the next version.
HTH
 

davewave

Addon Developer
Addon Developer
Joined
Jun 17, 2008
Messages
92
Reaction score
0
Points
0
thanks
Thanks so much, I was starting to manually calculate the elements using my own maths.

Also one other problem, to get the PeA from the PER I need the radius of the earth.
How to I get this using your API???
 

yagni01

Addon Developer
Addon Developer
Donator
Joined
Feb 8, 2008
Messages
463
Reaction score
0
Points
16
Location
Atlanta, GA
thanks
Also one other problem, to get the PeA from the PER I need the radius of the earth.
How to I get this using your API???
You'll find constants like that in Orbiters planetary config files (i.e. earth.cfg)
 

reverend

Addon Developer
Addon Developer
Beta Tester
Joined
Apr 14, 2008
Messages
221
Reaction score
2
Points
18
thanks
Thanks so much, I was starting to manually calculate the elements using my own maths.

Also one other problem, to get the PeA from the PER I need the radius of the earth.
How to I get this using your API???

OBJ:<object name or index>:Size returns the planet radius. subtract this radius from the PeR which is in the Elements2 Array as item number 10.

Perhaps the ORTS source would be helpful:
http://purinton.us/ORTS/

http://purinton.us/ORTS/ROTS/MainForm.vb
This shows all the old OUIPC commands for gathering all the data normally displayed on the orbit and surface and map huds. All the commands are basically the same except replace the . with a :
 

alrik

Alrik
Joined
Jul 30, 2008
Messages
75
Reaction score
0
Points
0
Location
Madrid
Help help help!!! With that...

PHP:
<?php
error_reporting(E_ALL);

echo "<h2>Connect by TCP/IP</h2><br>";

$da = stream_socket_client("tcp://127.0.0.1:37777", $errno, $errstr, 5, STREAM_CLIENT_ASYNC_CONNECT);
if (!$da) {
    echo "$errstr ($errno)<br />n";
} else {
    fwrite($da, "ORB:SysTime");
    while (!feof($da)) {
        echo fgets($da, 1024);
    }
    fclose($da);
}
?>

I've tried to make a socket connection with PHP to the OrbConnect but no response I dont know if im doing it well or not... i've tried also with socket functions but nothing. ¿Can anyone please help me?

Another questions about how can I connect that with visual c++ 2005 an example or something like that could be really good for me.

Well my idea is to try to export all data that OrbConnect can read to a XML sheet every X seconds but if I cant connect xD I cant do nothing xD... To read or whatever... but if I can connect with php to the server I should jump this step.

I need examples please :compbash: im becoming crazy... xD
 
Last edited:

kuddel

Donator
Donator
Joined
Apr 1, 2008
Messages
2,064
Reaction score
508
Points
113
Hi alik,

I think this forum is not "full of PHP-freaks", but I was curious...
It seems that orbConnect needs a DOS end-of line after each command.
So, if you put a "\r\n" after your command it should work.

I've tried it with this little code:

PHP:
<?php
$ fp = fsockopen("tcp://127.0.0.1", 37777, $ errno, $ errstr);

if (!$ fp) {
    echo "ERROR ($ errno) : $ errstr n";
} else {
    while (1) {
      fputs($ fp, "ORB:SimTime\r\n");
      echo fgets($ fp);
      sleep(1);
    }
    fclose($ fp);
}
?>
(...you know what to do with the dollars, right ;) )

Regards,

Kuddel
 
Status
Not open for further replies.
Top