Radarspotting

Mode-S Receivers => Kinetic's SBS-3 => Topic started by: junjun on April 08, 2022, 05:17:08 PM

Title: About receive Raw data from SBS-3
Post by: junjun on April 08, 2022, 05:17:08 PM
I got a SBS-3 used by someone for many years. But it's still workng. I want to receive raw data from it using python. I've read a lot of posts about receiving data using  network in our website,especially Guides.I don't get the points. So,i wonder is there  someone can  write something about SBS-3's network usages in detail. Thanks a lot.

Python program:
import socket
sk=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
address=('192.168.1.170', 10001)
sk.connect(address)
data= sk.recv(1024*2)
print(str(data))
sk.close()

return no data.
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 08, 2022, 05:58:37 PM
Welcome to the forum.

Does the SBS-3 deliver data to Basestation across your local network?  Maybe first confirm that the SBS-3 is receiving usable data which can be processed by Basestation connected over your network?

To do this you need to connect the SBS-3 via Ethernet cable to your network, either using your router or a network switch.  The SBS-3 isn't WiFi capable.

Then launch Basestation and set the Data Source to Network:

Settings -> Data Source -> Use Network

The default IP:Port address of the SBS-3 is 192.168.1.170:10001.

Make sure in Basestation you have this address set:

Settings -> Hardware Settings -> Network

But:

1. The SBS-3 IP address and port may have been changed by the person who supplied it?
2. Your local network range isn't 192.168.1.nnn

I suggest you first of all confirm the SBS-3 is receiving and processing data across your local network.  This also requires a suitable antenna.

If you can confirm this we can move onto Python and Raw Data.

Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 09, 2022, 09:16:57 AM
Thanks for your quick response. According to your suggests, Basestation can display plane's information using Ethernet interface. I want to design the third application such as python program to process raw data. The program is shown on the top post. It receives no data. I don't know the reasons. 
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 09, 2022, 09:28:53 AM
I have to go on a trip in a few minutes.

Please look at Page 95 of the Reference Manual:

https://radarspotting.com/forum/index.php?action=tportal;sa=download;dl=item456
Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 09, 2022, 01:27:37 PM
I post my SBS-3's firmwareOptions. Only option 1 and 8 are enabled. I don't know what is the meaning of each option. There is not any notes about it in the referenceManual. Can anyone explain it?Thanks !

[attachment deleted reduce file load]
Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 09, 2022, 05:04:29 PM
Thanks your help.I can receive the data from 10001 port with Ethernet using loop in my python program. The received data is strange and is not satisfied with API format.Are there any wrong.I post some received data below.
b'\x02\t\x00\x80\x1d\x00\x08\x0c\x10\x03c\x18'
b'\x10'
b'\x02\t\x00\xfc\xa1\x01\x08\x0c\x10\x03|f\x10\x02\t\x00`I\x03\x1c\xab\x10\x03\xb44\x10\x02\t\x00\xaeu\x04\x08\x0c\x10\x03\xa4\xd5'
b'\x10'
b'\x02\t\x00:\xb9\x07\x08\x0c\x10\x03\xae\x9f\x10\x02\t\x00\xe2\xe6\t\x08\x0c\x10\x03!\x84'
b'\x10'
b'\x02\t\x00\xa8*\r\x08\x0c\x10\x03V\x14'
b'\x10'
b'\x02\t\x00\xc4/\x12\x08\x0c\x10\x03\x17\xf4'
b'\x10'
b'\x02\t\x002{\x1d\x08\x0c\x10\x03v\xdc'
b'\x10'
b'\x02\t\x00\x05n!\x08\x0c\x10\x03\n\xc0'
b'\x10'
b'\x02\t\x00i\xe67\x1c\xab\x10\x03;\xb5'

Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 09, 2022, 05:59:26 PM
Ignore the firmware options.

The raw data should be on port 30006 - check the Reference Manual.  I am still away from home.
Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 10, 2022, 06:03:42 AM
I try to use port 30006 in my python program. SBS-3 refused to visit. The result is posted in attachment.
import socket

sk=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
address=('192.168.1.170', 30006)
sk.connect(address)

while True:
    data= sk.recv(1024)
    if not data:
        break
    print(data,len(data))
sk.close()

[attachment deleted reduce file load]
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 10, 2022, 07:57:13 AM
Do you have any other application using port 30006?

Do you see data on that port using Telnet?
Title: Re: About receive Raw data from SBS-3
Post by: Faramir on April 10, 2022, 05:51:06 PM
Port 30006 is available via the BaseStation Software, so you need to connect to the IP of the computer running BaseStation and not the SBS3 itself. Maybe the stream from the SBS unit needs to be enabled too as was the case with a user trying to connect a Rpi to a SBS3 (or a SBS1eR, I forgot). Basestation does 'negotiate' with the hardware to enable the stream. To check, see if the green LED on the SBS is lit (when using Ethernet).
Title: Re: About receive Raw data from SBS-3
Post by: rikgale on April 10, 2022, 06:35:20 PM
I presume that you are trying to replicate what ModeSMixer2 does? Pull in the data from the SBS-3 and re-broadcast?

Don't know if there is anyway you can examine ModeSMixer2 input port. I.E. run ModeSMixer2 and run NetCat and examine what is shown in the datastream on the input port. Might be worth a shot?

Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 10, 2022, 06:37:02 PM
Quote from: Faramir on April 10, 2022, 05:51:06 PM
Port 30006 is available via the BaseStation Software, so you need to connect to the IP of the computer running BaseStation and not the SBS3 itself.

Raw data on port 30006 from an SBS-3 doesn't require Basestation to be running.  Page 95 of the Reference Manual:

https://radarspotting.com/forum/index.php?action=tportal;sa=download;dl=item456

[attachment deleted reduce file load]
Title: Re: About receive Raw data from SBS-3
Post by: Faramir on April 10, 2022, 08:05:45 PM
I stand corrected! The SBS-3 I never owned so I can't see the extra options in BaseStation that can be configured for a stand-alone SBS-3. I referred to the SBS-1 usage that referred to port 30006 on BaseStation
I'll have to try and get my hands on a SBS-3 or keep my mouth shut when that model is the one used. Or both  :)
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 11, 2022, 08:44:56 AM
Quote from: Faramir on April 10, 2022, 08:05:45 PM
I'll have to try and get my hands on a SBS-3 or keep my mouth shut when that model is the one used. Or both  :)

You were trying to help which is always a bonus.  Please continue to do so.
Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 11, 2022, 03:00:15 PM
Telnet:can not connect 192.168.1.170  30006
Title: Re: About receive Raw data from SBS-3
Post by: rikgale on April 11, 2022, 03:20:40 PM
You can't just Telnet into the SBS-3 and see what it is sending. You would need to get a connection up and running and then examine the data in that connection. Hence the NetCaT suggestion ;)
Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 12, 2022, 03:30:28 AM
Thanks for all of suggests,i  finally solve the problem. I order to use port 30006 or 30003, BaseStation should be on.In third application,the IP must use the one of computer running BaseStation,not the ip of sbs-3 box.
Thanks again.Thanks to Faramir.
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 12, 2022, 07:26:04 AM
Quote from: junjun on April 12, 2022, 03:30:28 AM
Thanks for all of suggests,i  finally solve the problem. I order to use port 30006 or 30003, BaseStation should be on.

Yes that will work.  But the SBS-3 can be used as a stand-alone receiver with raw data available without running Basestation, which is what you were trying to achieve.
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 12, 2022, 11:31:34 AM
OK.  Apologies for not testing this earlier but I have been away from home.

There are some prerequisites to using the SBS-3 as a stand-alone receiver.

1. Launch Basestation so you can access the Non-Volatile Memory Settings.  Settings -> Non Volatile Memory Settings (see attachment).  If you can't see this option you're not using an SBS-3!
2. On the Stand-Alone Data tab, enable the first three options (see attachment).
3. On the Ethernet Setup tab, check the Main Connection "SBS-3 as Server" and set the required port number, default should be 10001. (see attachment).  Also check IP address.

Close Basestation and your application should be able to access data on the IP address and port number configured on the Ethernet Setup tab.  Mine does.

[attachment deleted reduce file load]
Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 12, 2022, 03:25:53 PM
Thanks for your patience.In the mode of  Stand-alone receiver,i can receive raw data from port 10001 without running Basestation. The data just like the post.But I can not receive any data from port 30003 or 30006 if Basestation don't run.
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 12, 2022, 03:30:07 PM
Quote from: junjun on April 12, 2022, 03:25:53 PM
The data just like the post.But I can not receive any data from port 30003 or 30006 if Basestation don't run.

That's correct.  If you want to use the SBS-3 as a stand-alone receiver, the raw data is on port 10001.  If you want data on ports 30003 and/or 30006, you must run Basestation.  Or change the port number for "SBS-3 as Server" as described in my previous post.
Title: Re: About receive Raw data from SBS-3
Post by: rikgale on April 12, 2022, 03:47:43 PM
@junjun - once you are at a place that you have your python code up running/outputting data, let me know. I would  be happy to test as I can network my SBS-3 and run the code on a Raspberry Pi. I can not write code to save my life, but happy to test.
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 12, 2022, 03:57:07 PM
Quote from: junjun on April 12, 2022, 03:25:53 PM
Thanks for your patience.In the mode of  Stand-alone receiver,i can receive raw data from port 10001 without running Basestation.

Reading your first post, isn't this what you wanted to achieve?
Title: Re: About receive Raw data from SBS-3
Post by: DaveReid on April 14, 2022, 07:51:21 AM
Quote from: junjun on April 11, 2022, 03:00:15 PMTelnet:can not connect 192.168.1.170  30006

That would be the expected response - as Faramir explained above, you can't connect to the SBS (box) on port 30006.

You need to Telnet, not to the IP address of your SBS, but to the IP address of the PC running BaseStation.

Conversely, if your application is capturing data direct from the SBS (without BaseStation being in the loop), then it's port 10001 on the SBS that you need to connect to (unless you have changed it from the default).

Dave (getting back into SBS networking after a very long break).
Title: Re: About receive Raw data from SBS-3
Post by: Anmer on April 14, 2022, 08:23:30 AM
Quote from: DaveReid on April 14, 2022, 07:51:21 AM
Dave (getting back into SBS networking after a very long break).

Welcome back Dave, you've been missed.
Title: Re: About receive Raw data from SBS-3
Post by: Faramir on April 14, 2022, 03:27:01 PM
Quote from: DaveReid on April 14, 2022, 07:51:21 AM
Dave (getting back into SBS networking after a very long break).

Fantastic to welcome you back!!!
Title: Re: About receive Raw data from SBS-3
Post by: Graham Bell on April 14, 2022, 04:46:58 PM
It's like riding a bicycle young sir!Trust you are keeping well.
Regards-
G.B.
Title: Re: About receive Raw data from SBS-3
Post by: junjun on April 15, 2022, 01:10:05 PM
Thanks for all of your help.