Welcome to Radarspotting. Please login or sign up.

May 03, 2024, 01:42:25 AM

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 4 Guests are viewing this topic.

sergsero

Hi Roby,

Quote from: robybenjy on August 01, 2015, 05:51:58 PM
today the software crashed with this error message: libusb_callback xfer status: 4
Is it a bug or my pc status?

This is not a bug of the program. But well known manifestation of problems with USB or power supply. Your message was received from the libusb-1.0 library, which is evident by the name - libusb_callback xfer status.

Data from dongle are delivered through a kind of sandwich:
- first libusb, which you replaced the original library (in Windows using zadig, in Linux - blacklist to kernel and new install libusb-1.0-0) and which provides the required SDR access to the hardware,
- than librtlsdr to control the hardware of dongle, and the end of the chain
- modesdeco2, which processes data, outputs data and/or displays their.

When librtlsdr is experiencing problems with stream from dongle, it asks libusb library about status of USB connection.

[size=8pt]static void LIBUSB_CALL _libusb_callback(struct libusb_transfer *xfer)
{
rtlsdr_dev_t *dev = (rtlsdr_dev_t *)xfer->user_data;

if (LIBUSB_TRANSFER_COMPLETED == xfer->status) {
if (dev->cb)
dev->cb(xfer->buffer, xfer->actual_length, dev->cb_ctx);

libusb_submit_transfer(xfer); /* resubmit transfer */
dev->xfer_errors = 0;
} else if (LIBUSB_TRANSFER_CANCELLED != xfer->status) {
#ifndef _WIN32
if (LIBUSB_TRANSFER_ERROR == xfer->status)
dev->xfer_errors++;

if (dev->xfer_errors >= dev->xfer_buf_num ||
    LIBUSB_TRANSFER_NO_DEVICE == xfer->status) {
#endif
dev->dev_lost = 1;
rtlsdr_cancel_async(dev);
fprintf(stderr, "cb transfer status: %d, "
"canceling...\n", xfer->status);
#ifndef _WIN32
}
#endif
}
}[/size]


In libusb-1.0-0 enum of libusb_transfer_status the transfer status codes "4" is "LIBUSB_TRANSFER_STALL - interrupt endpoints: halt condition detected (endpoint stalled)". http://libusb.org/static/api-1.0/group__asyncio.html#ga9fcb2aa23d342060ebda1d0cf7478856

In some programs, this problem is ignored until it is possible. However, in modesdeco2 I think that issues with connection dongle (or power quality) should be resolved, not silenced.

Check reliability of the USB connection cable to connectors, its quality.
Often USB cables are 28/28 AWG, meaning that their power wires are significantly smaller than the standard 28/24 AWG cable. (Unintuitively, "28" is a smaller size than "24.")

Another reason of the issues may be inability of the PSU to provide current to 2A, not less.

Regards,
sergsero

sergsero

Quotesome planes are displayed here before then in ModeSDeco2. In fact, in ModeSDeco2 coordinates do not appear in the "Flights" list if they are in Mode S and therefore the planes do not appear on the map, whereas they already appear on the map of ADSBScope. What is this due to?

This is because in modesdeco2 the stages of data processing for their output to network and to displaying them on own Google map are different.

For displaying we need not only decoding the positions of the aircraft, but make validation for unambiguous coordinates, that is a bit more complicated. Naturally, we would assume to read latitude and longitude directly from the data frame. Unfortunately its not that simple...

In fact, two different types of the position messages (odd and even frames) are needed to find out the LAT and LON of the aircraft. The position is described in so called Compact Position Reporting (CPR) format.

Before output the label from the aircraft on map, the program is analyzes the several CPR messages for: the stationary of increments, the admissibility condition and determine to the area.
All of this takes time. Until then, the aircraft will be displayed only in table, as without coordinates.

Opposite, output the CPR data (odd and even frames) to network from this new aircraft begins at once. The task of validating the position data, in this case, will be delegated to the receiving side (ADSBScope).

Regards,
sergsero

larsras

Hi Sergsero

You are very thorough in your replies, and doing a very good job in those apps here. Thanks for your effort! :-)

Win10: Works also great here.

Additions to an old issue. Dual display of aircrafts in the Flights list.
Some (strange) observations:
ICAO is different
Callsign is the same
Reg is different
Squawk is the same
Altitude is  (nearly) the same (i guess this is just due to update rate differences seen when planes are climb/decend).

I'm a bit confused now why some of the fields are different above?

Keep up the good work! :-)



[Attachment deleted by Admin to save file space]

sergsero

Hi larsras,

Yes, I remember about your issue. Unfortunately, I can't get this situation on a real aircraft signal in my area. But I'll look for a solution.

Maybe if you can record the output stream in text AVR format in that moment (1-2 minutes), when you see these paired rows for the same aircraft, it will help me.

Regards,
sergsero

robybenjy

Hi Sergey,

thanks for your answers always very thorough and clear, although I am not a programmer.

My dongle is connected to the PC with a USB cable of about 50 cm. and when the problem was there the room temperature was quite high (hot summer here on the coast of Tuscany!) then it may be that there was a problem of supply current to the dongle.

For different view on ADSBScope, I had already thought it was related to the different functioning of software in data management.

Have a good Sunday!

Roby
RTL-SDR dongle RTL2832U/R820T tuner
Selfmade 1090 MHz Spider GP antenna

larsras

Hi Sergsero

Dual flights displayed. Is this usable?

br Lars

[Attachment deleted by Admin to save file space]

robybenjy

Quote from: larsras on August 02, 2015, 08:21:01 AM
Additions to an old issue. Dual display of aircrafts in the Flights list.
Some (strange) observations:
ICAO is different
Callsign is the same
Reg is different
Squawk is the same
Altitude is  (nearly) the same (i guess this is just due to update rate differences seen when planes are climb/decend).

I'm a bit confused now why some of the fields are different above?

Keep up the good work! :-)

I have the same issue.

Roby
RTL-SDR dongle RTL2832U/R820T tuner
Selfmade 1090 MHz Spider GP antenna

sergsero

Hi,

Thanks for the detected problem and the log. It is obvious that the closest ICAO24 clones are formed from DF20/21 messages (and that are not used in my region). So the log is the only way to find the cause.
I'll look for a solution.

Sergey

sergsero

Hi all,

Raspberry Pi 2 test version of ModeSMixer2 for direct connection to SBS-1/3 receivers via USB port: modesmixer2_rpi2_sbs_20150715.tgz https://drive.google.com/open?id=0B7NYXizl0U6iNk5xSS03U1c4QmM


+ added direct connection to SBS-1/3 receivers via USB (serial) port.

When connecting the receiver to Linux, in the system creates two devices:

$ ls -l /dev/ttyUSB*
crw-rw---T 1 root dialout 188, 0 aug  2 17:15 /dev/ttyUSB0
crw-rw---T 1 root dialout 188, 1 aug  2 17:15 /dev/ttyUSB1

To output data used the second device in the pair.

Use the option --inSerial /dev/ttyUSB1:921600:none - for SBS-1 or --inSerial /dev/ttyUSB1:3000000:none - for SBS-3.




Regards,
sergsero


[Attachment deleted by Admin to save file space]

jmaurin

Quote from: sergsero on August 02, 2015, 03:50:40 AM
Hi jmaurin,
Quote from: jmaurin on July 31, 2015, 07:05:44 PM
Another report: Windows 10 + Chrome (fresh install) = doesn't show map.

1. Visual C++ Redistributable Packages for Visual Studio 2013 - 32 bit https://www.microsoft.com/en-US/download/details.aspx?id=40784
2. Microsoft Visual C++ 2010 SP1 Redistributable Package (x86) - 32 bit http://www.microsoft.com/en-us/download/details.aspx?id=8328
3. Zadig for Windows Vista or later http://zadig.akeo.ie/downloads/zadig_2.1.2.exe
4. Google Chrome v.44.0.2403.125 m
5. The result is shown in the screenshot

Regards,
sergsero

Actually, I managed to get this working. I've tested in 3 fresh-install of windows 10 and none of then showd the map (running modesdeco on linux machine, just acessing). BUT, after 2 or 3 refresh, everything started to work again. I don't know why

menglish

Let me add to the mystery.  I have not yet upgraded to Win10 (have not had the time this weekend), but I too have lost my map on all browsers.  I am running Win7 Home Premium 64 and have never had issues with the map before. All the aircraft appear in a stack in the upper left corner of the page on Chrome 44, Firefox 39, and IE 11.  I am am running modesdeco2 v20150628 with a single RTL820T and a homebrew 8-legged spider (only 7 really since one got knocked off in a storm) antenna on the roof.  VRS is showing the map correctly.
-Matt 

jmaurin

Quote from: menglish on August 03, 2015, 03:33:58 AM
Let me add to the mystery.  I have not yet upgraded to Win10 (have not had the time this weekend), but I too have lost my map on all browsers.  I am running Win7 Home Premium 64 and have never had issues with the map before. All the aircraft appear in a stack in the upper left corner of the page on Chrome 44, Firefox 39, and IE 11.  I am am running modesdeco2 v20150628 with a single RTL820T and a homebrew 8-legged spider (only 7 really since one got knocked off in a storm) antenna on the roof.  VRS is showing the map correctly.
-Matt 

Exactly what happens here!
After some refresh, was working again.

jmaurin

Sergey.

How long it takes to ModeSDeco2 commit changes to BaseStation.sqb? I'm buildind and LOG Webpage that shows Flights history reading direct from BaseStation (the same used by ModeSDeco2), but I can't see changed/updated in Flights table unless I shutdown modesdeco. I got no errors or locks, just not updated data (since last ModeSDeco2 start).

sergsero

jmaurin,

Some questions on this topic recently discussed in the message #426 of 18 July.
Briefly, the time interval is set by the option "flight-expire-time", by default, it is 3600 seconds, after receiving last message from this aircraft.

The program version not lower than v.20150628.

/sergsero

jmaurin

Quote from: sergsero on August 05, 2015, 02:10:27 AM
jmaurin,

Some questions on this topic recently discussed in the message #426 of 18 July.
Briefly, the time interval is set by the option "flight-expire-time", by default, it is 3600 seconds, after receiving last message from this aircraft.

The program version not lower than v.20150628.

/sergsero
Tks!
I didn't know this options also aftes database writtes....I thought it was just an internal control to expire or not flights (for example, when you don't use DB). But it make sense.

Tks anyway.