Welcome to Radarspotting. Please login or sign up.

May 30, 2026, 02:27:20 PM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

ModeSDeco2 and ModeSMixer2 - console programs for RTLSDR and transcoding

Started by sergsero, August 09, 2013, 03:08:08 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

sergsero

Last ModeSMixer2 installed and running in RadarCape receiver, receiving input data from the port 10003 and outputs them in RAW format for BaseStation.exe and Globe-S and WEB on port 8088:

./modesmixer2 --inConnect 127.0.0.1:10003 --outServer msg:30033 --web 8088 --db ~/data/basestation.sqb --frdb ~/data/flightroute-2015-02-18-1515.icao.sqb --silhouettes ~/data/Silhouettes  --outServer sbs10001:10001 --globes 31008:table2:UNNT


loch-loman

Sergsero,

Firstly, awesome software. After months of struggling with unstable RTL1090 and Dump1090, your software is solid. Many thanks.

A few questions.
Can you share the Database table layout ?
Does the software allow 'filtering' or messages ? I would like to filter the re-output messages. Ie; in beast and out beast minus the filtered conditions. Filter on ICAO code, ie :3A*. with a permit/deny or ultimately co-ordinate ranges ?

Cheers.

sergsero

Hello loch-loman,

1. Programs modesdeco2/modesmixer2 can works with a database in sqlite3 format. The database structure may be identical to basestation.sqb used in BaseStation.exe, VirtualRadarServer (plugin), PlanePlotter and others.

If you run the command: $ sqlite3 basestation.sqb ".schema" > table_layout.txt,
you will have file table_layout.txt as:
CREATE TABLE DBInfo(OriginalVersion smallint not null,CurrentVersion smallint not null);
CREATE TABLE DBHistory(DBHistoryID integer primary key,TimeStamp datetime not null,Description varchar(100) not null);
CREATE TABLE Locations(LocationID integer primary key,LocationName varchar(20) not null,Latitude real not null,Longitude
real not null,Altitude real not null);
CREATE TABLE SystemEvents(SystemEventsID integer primary key,TimeStamp datetime not null,App varchar(15) not null,Msg
varchar(100) not null);
CREATE TABLE Sessions(SessionID integer primary key,LocationID integer not null,StartTime datetime not null,EndTime
datetime,CONSTRAINT LocationIDfk FOREIGN KEY (LocationID) REFERENCES Locations);
CREATE TABLE Aircraft(AircraftID integer primary key,FirstCreated datetime not null,LastModified datetime not null,ModeS
varchar(6) not null unique,ModeSCountry varchar(24),Country varchar(24),Registration varchar(20),CurrentRegDate
varchar(10),PreviousID varchar(10),FirstRegDate varchar(10),Status varchar(10),DeRegDate varchar(10),Manufacturer
varchar(60),ICAOTypeCode varchar(10),Type varchar(40),SerialNo varchar(30),PopularName varchar(20),GenericName
varchar(20),AircraftClass varchar(20),Engines varchar(40),OwnershipStatus varchar(10),RegisteredOwners varchar(100),MTOW
varchar(10),TotalHours varchar(20),YearBuilt varchar(4),CofACategory varchar(30),CofAExpiry varchar(10),UserNotes
varchar(300),Interested boolean not null default 0,UserTag varchar(5),InfoURL varchar(150),PictureURL1
varchar(150),PictureURL2 varchar(150),PictureURL3 varchar(150),UserBool1 boolean not null default 0,UserBool2 boolean
not null default 0,UserBool3 boolean not null default 0,UserBool4 boolean not null default 0,UserBool5 boolean not null
default 0,UserString1 varchar(20),UserString2 varchar(20),UserString3 varchar(20),UserString4 varchar(20),UserString5
varchar(20),UserInt1 integer default 0,UserInt2 integer default 0,UserInt3 integer default 0,UserInt4 integer default
0,UserInt5 integer default 0,OperatorFlagCode varchar(20));
CREATE TABLE Flights(FlightID integer primary key,SessionID integer not null,AircraftID integer not null,StartTime
datetime not null,EndTime datetime,Callsign varchar(20),NumPosMsgRec integer,NumADSBMsgRec integer,NumModeSMsgRec
integer,NumIDMsgRec integer,NumSurPosMsgRec integer,NumAirPosMsgRec integer,NumAirVelMsgRec integer,NumSurAltMsgRec
integer,NumSurIDMsgRec integer,NumAirToAirMsgRec integer,NumAirCallRepMsgRec integer,FirstIsOnGround boolean not null
default 0,LastIsOnGround boolean not null default 0,FirstLat real,LastLat real,FirstLon real,LastLon
real,FirstGroundSpeed real,LastGroundSpeed real,FirstAltitude integer,LastAltitude integer,FirstVerticalRate
integer,LastVerticalRate integer,FirstTrack real,LastTrack real,FirstSquawk integer,LastSquawk integer,HadAlert boolean
not null default 0,HadEmergency boolean not null default 0,HadSPI boolean not null default 0,UserNotes
varchar(300),CONSTRAINT SessionIDfk FOREIGN KEY (SessionID) REFERENCES Sessions,CONSTRAINT AircraftIDfk FOREIGN KEY
(AircraftID) REFERENCES Aircraft);
CREATE TABLE Active (ID integer primary key, ModeS varchar(6) not null, FlightID integer not null, SessionID integer not
null, FirstCreated DateTime not null, LastModified DateTime not null, Country varchar(24) null, Registration varchar(10)
null, Callsign varchar(10) null, Type varchar(50) null, ICAOType varchar(8) null, ConstructionNumber varchar(20) null,
Operator varchar(50) null, ICAOOperator varchar(4) null, SubOperator varchar(10) null, RadioCallsign varchar(20) null,
Route varchar(12) null, UserTag varchar(5) null, Interested boolean default 0, Populated boolean default 0, Alert
boolean default 0, FirstAltitude integer default 0, LastAltitude integer default 0, FirstLongitude real null,
LastLongitude real null, FirstLatitude real null, LastLatitude real null, FirstVerticalRate integer default 0,
LastVerticalRate integer default 0, FirstTrack real null, LastTrack real null, FirstSquawk integer default 0, LastSquawk
integer default 0, UserString1 varchar(20) null, UserString2 varchar(20) null, UserString3 varchar(20) null, UserString4
varchar(20) null, UserString5 varchar(20) null, UserInt1 integer default 0, UserInt2 integer default 0, UserInt3 integer
default 0, UserInt4 integer default 0, UserInt5 integer default 0, UserBool1 boolean default 0, UserBool2 boolean
default 0, UserBool3 boolean default 0, UserBool4 boolean default 0, UserBool5 boolean default 0, UserNotes varchar(300)
null, NeedsPopulating boolean default 0, NewEntry boolean default 0, Miscode boolean default 0, GroundCode boolean
default 0, Temp2 boolean default 0, CodeType varchar(2) null, SquawkTrans varchar(20) null);
CREATE TABLE Alerts (ID integer primary key, AlertType char(1) null, AlertValue char(10) null);
CREATE INDEX AircraftAircraftClass ON Aircraft(AircraftClass);
CREATE INDEX AircraftCountry ON Aircraft(Country);
CREATE INDEX AircraftGenericName ON Aircraft(GenericName);
CREATE INDEX AircraftICAOTypeCode ON Aircraft(ICAOTypeCode);
CREATE INDEX AircraftInterested ON Aircraft(Interested);
CREATE INDEX AircraftManufacturer ON Aircraft(Manufacturer);
CREATE INDEX AircraftModeS ON Aircraft(ModeS);
CREATE INDEX AircraftModeSCountry ON Aircraft(ModeSCountry);
CREATE INDEX AircraftPopularName ON Aircraft(PopularName);
CREATE INDEX AircraftRegisteredOwners ON Aircraft(RegisteredOwners);
CREATE INDEX AircraftRegistration ON Aircraft(Registration);
CREATE INDEX AircraftSerialNo ON Aircraft(SerialNo);
CREATE INDEX AircraftType ON Aircraft(Type);
CREATE INDEX AircraftUserTag ON Aircraft(UserTag);
CREATE INDEX AircraftYearBuilt ON Aircraft(YearBuilt);
CREATE INDEX FlightsAircraftID ON Flights(AircraftID);
CREATE INDEX FlightsCallsign ON Flights(Callsign);
CREATE INDEX FlightsEndTime ON Flights(EndTime);
CREATE INDEX FlightsSessionID ON Flights(SessionID);
CREATE INDEX FlightsStartTime ON Flights(StartTime);
CREATE INDEX LocationsLocationName ON Locations(LocationName);
CREATE INDEX SessionsEndTime ON Sessions(EndTime);
CREATE INDEX SessionsLocationID ON Sessions(LocationID);
CREATE INDEX SessionsStartTime ON Sessions(StartTime);
CREATE INDEX SystemEventsApp ON SystemEvents(App);
CREATE INDEX SystemEventsTimeStamp ON SystemEvents(TimeStamp);
CREATE INDEX ActiveModeS ON Active(ModeS);
CREATE INDEX ActiveRegistration ON Active(Registration);
CREATE INDEX ActiveAlert ON Active(Alert);
CREATE INDEX ActivePopulated ON Active(Populated);
CREATE INDEX ActiveInterested ON Active(Interested);
CREATE INDEX ActiveLastModified ON Active(LastModified);
CREATE INDEX ActiveNeedsPopulating ON Active(NeedsPopulating);
CREATE INDEX ActiveCallsign ON Active(Callsign);
CREATE INDEX ActiveRadioCallsign ON Active(RadioCallsign);
CREATE INDEX ActiveCountry ON Active(Country);
CREATE INDEX ActiveICAOType ON Active(ICAOType);
CREATE INDEX ActiveConstructionNumber ON Active(ConstructionNumber);
CREATE INDEX ActiveICAOOperator ON Active(ICAOOperator);
CREATE INDEX ActiveOperator ON Active(Operator);
CREATE INDEX ActiveSubOperator ON Active(SubOperator);
CREATE INDEX ActiveRoute ON Active(Route);
CREATE INDEX ActiveType ON Active(Type);
CREATE INDEX ActiveNewEntry ON Active(NewEntry);
CREATE INDEX ActiveMiscode ON Active(Miscode);
CREATE INDEX ActiveGroundCode ON Active(GroundCode);
CREATE INDEX ActiveCodeType ON Active(CodeType);
CREATE INDEX AlertsAlertType ON Alerts(AlertType);
CREATE INDEX AlertsAlertValue ON Alerts(AlertValue);
CREATE TRIGGER AircraftIDdeltrig BEFORE DELETE ON Aircraft FOR EACH ROW BEGIN DELETE FROM Flights WHERE AircraftID =
OLD.AircraftID;END;
CREATE TRIGGER SessionIDdeltrig BEFORE DELETE ON Sessions FOR EACH ROW BEGIN DELETE FROM Flights WHERE SessionID =
OLD.SessionID;END;


2. No, the output data feed to network has full RAW data, as its are in source Mode S messages transmitted from transponder.

Thanks,
sergsero

loch-loman

Thanks Sergsero. Appreciate the detailed reply.

Let me open up my second question broadly. I have a feed from ADSBhub (which can have 8-900 aircraft). Its the one I use to test the ModeMixer software. Plenty of messages in the feed but I want to just be able to take the entire feed and strip out the regions I dont want to monitor at the time.

Thoughts ?

sergsero

Hello,

Version ModeSMixer2 for MIPS architecture Atheros AR9344 rev 2 (TP-LINK TL-WDR3600/4300/4310):
modesmixer2_mips_ar71xx_20150314.zip



Install for OpenWRT BarrierBreaker 14.07 with rootfs on External Storage (extroot on USB Storage):
   
1. Put the package modesmixer_20150314-1_ar71xx.ipk in any directory of your router.

2. Check if a previous version of modesmixer was installed earlier. If yes, then remove it:

opkg remove modesmixer

3. Installed the package modesmixer_20150314-1_ar71xx.ipk to router system:

opkg install modesmixer_20150314-1_ar71xx.ipk

4. In directory /etc/config find the settings file modesmixer. Make editing it for your needs. For example:

MODESMIXER_ARGS="--inConnect 192.168.1.10:10003 --web 8888 --db /root/data/basestation.sqb --frdb /root/data/flightroute.sqb --silhouettes /root/data/Silhouettes --log-noconsole"


5. Put the file wmm.cof in system root directory: (/wmm.cof)

6. Run command to start the program: /etc/init.d/modesmixer start

7. Run command to stop the program: /etc/init.d/modesmixer stop

8. Run command: /etc/init.d/modesmixer enable if you want to enable autostart the program after reboot system.




Thanks,
sergsero


sergsero

ModeSDeco2 version 20150303:

+ added option --flight-expire-time <arg>, sec (default: 3600). Specifies the time when aircraft leaves out from coverage area, after which data are written to database. Min 60, max 10800.
+ stalks after 5 km map scale

Thanks,
sergsero

Radio2.0

>>> I looking for People who want exchange the VRS Data with me. <<<
I life near LOWW / VIE and see Ground Traffic too.

sergsero

In the first message of this thread is new version of ModeSDeco2 v.20150308

+ fixed some bugs
+ added option --flight-expire-time <arg>, sec (default: 3600). Specifies the time when aircraft leaves out from coverage area, after which data are written to database. Min 60, max 10800.
+ stalks after 1 km map scale
+ no longer required libraries sqlite3.dll and rtlsdr.dll

Thanks,
sergsero

sergsero

In the third message of this thread is new version of ModeSMixer2 v.20150307

+ fixed some bugs
+ added option --flight-expire-time <arg>, sec (default: 3600). Specifies the time when aircraft leaves out from coverage area, after which data are written to database. Min 60, max 10800.
+ stalks after 1 km map scale
+ no longer required libraries sqlite3.dll

Thanks,
sergsero

sergsero

ModesBeast receiver is connected to second USB port of router TPLink TL-WDR3600:



Version ModeSMixer2 for MIPS modesmixer2_mips_ar71xx_20150307.zip https://drive.google.com/open?id=0B7NYXizl0U6iajNJSU1HRXVURHc&authuser=0 works on router.
Its command line:
MODESMIXER_ARGS="--inSerial /dev/ttyUSB0:3000000:none --web 8888 --db /root/data/basestation.sqb --frdb /root/data/flightroute.sqb --silhouettes /root/data/Silhouettes --outServer msg:30003 --outServer sbs10001:10001 --log-noconsole"

The program pulls output data from receiver through the serial port /dev/ttyUSB0 and displays them via the built-in WEB server.



Simultaneously modesmixer2 outputs a RAW data stream for program Basestation.exe.



String Driven Thing - Heartfeeder (1973)

LSZH

Hi great software,
just one question
I try to use --nmea 12345:/dev/ttyUSB0:19200 and --nmea-logfile nmea,
but w/o success no data in the logfile nor on the ttyUSB0, what I am doing wrong?

I use modesdeco2_rpi2_20150308.tgz

LSZH

Ah got it now,I have the data from one ICAO plane, but is it possible to stream all planes to ttyUSB0?

sergsero

Hello LSZH,

This option creates GPS - NMEA sentence for one aircraft with specific ICAO24.

In Linux you can use ptmx, pts - pseudoterminal master and slave through socat.

For example:
1. Install the program socat: sudo apt-get install socat

2. In first terminal run the program: socat PTY,link=/tmp/com0 PTY,link=/tmp/com1

3. In other terminal run modesdeco2: ... --nmea 4243CC:/tmp/com0:9600
Here the specified values (4243CC, 9600) should be changed for your needs.

4. The NMEA sentence available on the device com1: cat /tmp/com1

Thanks,
sergsero

sergsero

In the first/third messages of this thread are new versions of ModeSDeco2 v.20150315 for all and  ModeSMixer2 v.20150314 for some platforms:


modesmixer2_windows_20150314.zip
modesmixer2_i386_20150314.tgz
modesmixer2_x86_64_20150314.tgz
modesmixer2_osx_20150314.tgz
modesmixer2_rpi_20150314.tgz
modesmixer2_rpi2_20150314.tgz
modesmixer2_bbw_angstrom_radarcape_20150314.tgz


+ fixed bugs
+ changed operation read/write to database file
+ changed CPR control algorithm


Thanks,
sergsero

spotter.ssol

I've registered to this forum just to say thank you, sergsero! Great piece of work!
--