Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

readsb with mode-s beast problem #21

Open
vatprcyq opened this issue Aug 21, 2022 · 9 comments
Open

readsb with mode-s beast problem #21

vatprcyq opened this issue Aug 21, 2022 · 9 comments

Comments

@vatprcyq
Copy link

I have a modesbeast board but have problem with readsb
It seems readsb can't set baudrate to 1000000? Test with microcom and same baudrate is normal output beast message.
But if not add --beast-baudrate=1000000 readsb will abnormal exit
Test:
sudo readsb --device-type modesbeast --beast-serial=/dev/ttyUSB1 --beast-baudrate=1000000
Mon Aug 22 02:41:40 2022 CST readsb starting up.
readsb version: wiedehopf git: 365daf3 (committed: Fri Aug 12 02:36:00 2022 0200)
Beast cfsetispeed(/dev/ttyUSB1, 1000000): Invalid argument
Mon Aug 22 02:41:40 2022 CST sdrOpen() failed, exiting!
Mon Aug 22 02:41:40 2022 CST Abnormal exit.
tianyi@BPI-M2:~ $ sudo readsb --device-type modesbeast --beast-serial=/dev/ttyUSB0 --beast-baudrate=1000000
Mon Aug 22 02:41:52 2022 CST readsb starting up.
readsb version: wiedehopf git: 365daf3 (committed: Fri Aug 12 02:36:00 2022 0200)
Beast cfsetispeed(/dev/ttyUSB0, 1000000): Invalid argument
Mon Aug 22 02:41:52 2022 CST sdrOpen() failed, exiting!
Mon Aug 22 02:41:52 2022 CST Abnormal exit.
tianyi@BPI-M2:~ $
tianyi@BPI-M2:~ $ microcom -p /dev/ttyUSB0 -s 1000000
connected to /dev/ttyUSB0
Escape character: Ctrl-
Type the escape character to get to the prompt.
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+00FFB00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+00FFB00000000000000000000000;
+00FFB00000000000000000000000;
+0001B00000000000000000000000;
+00FFB00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0001B00000000000000000000000;
+0000B00000000000000000000000;
+0001B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+00FFB00000000000000000000000;
+00FFB00000000000000000000000;
+0000B00000000000000000000000;
+0001B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0001B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+0000B00000000000000000000000;
+00FFB00000000000000000000000;

Enter command. Try 'help' for a list of builtin commands
exiting
tianyi@BPI-M2:~ $ sudo readsb --device-type modesbeast --beast-serial=/dev/ttyUSB0
Mon Aug 22 02:43:54 2022 CST readsb starting up.
readsb version: wiedehopf git: 365daf3 (committed: Fri Aug 12 02:36:00 2022 0200)
Running Mode-S Beast via USB.
<3>FATAL: removeStale() interval 60.1 seconds! Trying for an orderly shutdown as well as possible!
<3> priorityTasksRun didn't run for 60.1 seconds!
<3> removeStale didn't run for 59.1 seconds!
Mon Aug 22 02:44:54 2022 CST Abnormal exit.
tianyi@BPI-M2:~ $
Try stty -F /dev/ttyUSB0 ispeed 1000000 ospeed 1000000
but not work for me.
tianyi@BPI-M2:~ $ lsusb
Bus 001 Device 005: ID 10c4:ea70 Silicon Labs CP2105 Dual UART Bridge
Bus 001 Device 004: ID 0bda:2838 Realtek Semiconductor Corp. RTL2838 DVB-T
Bus 001 Device 003: ID 0424:ec00 Microchip Technology, Inc. (formerly SMSC) SMSC9512/9514 Fast Ethernet Adapter
Bus 001 Device 002: ID 0424:9514 Microchip Technology, Inc. (formerly SMSC) SMC9514 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
readsb with RTLSDR is working.

@wiedehopf
Copy link
Owner

I don't have a modes beast to debug.

I'd recommend running https://github.com/flightaware/beast-splitter and connect to that using readsb.

Otherwise ... it doesn't seem you set the baudrate using the command line when using readsb ... check the help for that.

@vatprcyq
Copy link
Author

I don't have a modes beast to debug.

I'd recommend running https://github.com/flightaware/beast-splitter and connect to that using readsb.

Otherwise ... it doesn't seem you set the baudrate using the command line when using readsb ... check the help for that.

Not working
sudo readsb --device-type modesbeast --beast-serial=/dev/ttyUSB0 --beast-baudrate=1000000
Mon Aug 22 03:27:07 2022 CST readsb starting up.
readsb version: wiedehopf git: 365daf3 (committed: Fri Aug 12 02:36:00 2022 0200)
Beast cfsetispeed(/dev/ttyUSB0, 1000000): Invalid argument
Mon Aug 22 03:27:07 2022 CST sdrOpen() failed, exiting!
Mon Aug 22 03:27:07 2022 CST Abnormal exit.

@wiedehopf
Copy link
Owner

Try the most recent commit please.

@vatprcyq
Copy link
Author

Try the most recent commit please.

Use readsb-install.sh can't use new ver,showing ver is Aug 19
HEAD 现在位于 37865ea better spread full trace writes after startup
rm -f .o compat/clock_gettime/.o compat/clock_nanosleep/*.o readsb viewadsb cprtests crctests convert_benchmark
cc -std=c11 -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2 -DMODES_READSB_VERSION=""wiedehopf git: 37865ea (committed: Fri Aug 19 19:18:45 2022 0200)"" -Wdate-time -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -Wno-format-truncation -DSC16Q11_TABLE_BITS=8 -DAIRCRAFT_HASH_BITS=16 -DENABLE_RTLSDR -g -O3 -march=native -c readsb.c -o readsb.o

Unable make manually:
make -j3 RTLSDR=yes
cc -std=c11 -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2 -DMODES_READSB_VERSION=""wiedehopf git: d345be4 (committed: Sun Aug 21 22:10:23 2022 0200)"" -Wdate-time -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -Wno-format-truncation -DSC16Q11_TABLE_BITS=8 -DENABLE_RTLSDR -g -c readsb.c -o readsb.o
cc -std=c11 -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2 -DMODES_READSB_VERSION=""wiedehopf git: d345be4 (committed: Sun Aug 21 22:10:23 2022 0200)"" -Wdate-time -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -Wno-format-truncation -DSC16Q11_TABLE_BITS=8 -DENABLE_RTLSDR -g -c globe_index.c -o globe_index.o
cc -std=c11 -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2 -DMODES_READSB_VERSION=""wiedehopf git: d345be4 (committed: Sun Aug 21 22:10:23 2022 0200)"" -Wdate-time -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -Wno-format-truncation -DSC16Q11_TABLE_BITS=8 -DENABLE_RTLSDR -g -c api.c -o api.o
globe_index.c: In function ‘load_blob’:
globe_index.c:2772:25: error: comparison of integer expressions of different signedness: ‘int’ and ‘uint32_t’ {aka ‘unsigned int’} [-Werror=sign-compare]
2772 | if (end - p < compressed_len) {
| ^
cc -std=c11 -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2 -DMODES_READSB_VERSION=""wiedehopf git: d345be4 (committed: Sun Aug 21 22:10:23 2022 0200)"" -Wdate-time -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -Wno-format-truncation -DSC16Q11_TABLE_BITS=8 -DENABLE_RTLSDR -g -c minilzo/minilzo.c -o minilzo.o
cc -std=c11 -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2 -DMODES_READSB_VERSION=""wiedehopf git: d345be4 (committed: Sun Aug 21 22:10:23 2022 0200)"" -Wdate-time -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -Wno-format-truncation -DSC16Q11_TABLE_BITS=8 -DENABLE_RTLSDR -g -c threadpool.c -o threadpool.o
cc -std=c11 -W -D_GNU_SOURCE -D_DEFAULT_SOURCE -Wall -Werror -fno-common -O2 -DMODES_READSB_VERSION=""wiedehopf git: d345be4 (committed: Sun Aug 21 22:10:23 2022 0200)"" -Wdate-time -D_FORTIFY_SOURCE=2 -fstack-protector-strong -Wformat -Werror=format-security -Wno-format-truncation -DSC16Q11_TABLE_BITS=8 -DENABLE_RTLSDR -g -c sdr_rtlsdr.c -o sdr_rtlsdr.o
cc1: all warnings being treated as errors
make: *** [Makefile:120:globe_index.o] 错误 1

@wiedehopf
Copy link
Owner

try once more ....

You can change the automatic script to use a different branch, it's not complicated.

@wiedehopf wiedehopf reopened this Aug 21, 2022
@vatprcyq
Copy link
Author

readsb now running with no error but no plane showing
use beast-splitter is OK
and beast-splitter show this is Radarcape-style ?
sudo beast-splitter --serial /dev/beast --listen 37193:B
Listening on 0.0.0.0:37193
Listening on [::]:37193
serial(/dev/beast): opening port at 3000000bps
serial(/dev/beast): configured with settings: BCDfgHIjk
serial(/dev/beast): configured with settings: RCDfgHIjk
serial(/dev/beast): opening port at 1000000bps
serial(/dev/beast): configured with settings: BCDfgHIjk
serial(/dev/beast): autobaud failed, trying again (consider specifying --fixed-baud)
serial(/dev/beast): opening port at 3000000bps
serial(/dev/beast): configured with settings: BCDfgHIjk
0.0.0.0:37193: accepted a connection from 127.0.0.1:58704 with settings B
serial(/dev/beast): configured with settings: BCdfgHijk
serial(/dev/beast): opening port at 1000000bps
serial(/dev/beast): configured with settings: BCdfgHijk
serial(/dev/beast): autobaud selected 1000000 bps
serial(/dev/beast): configured with settings: RCdfgHijk
serial(/dev/beast): connected to a Radarcape-style receiver
127.0.0.1:58704: connection closed
serial(/dev/beast): configured with settings: RCDfgHIjk
0.0.0.0:37193: accepted a connection from 127.0.0.1:56562 with settings B
serial(/dev/beast): configured with settings: RCdfgHijk

@vatprcyq
Copy link
Author

sudo beast-splitter --serial /dev/beast --listen 37193:B
./readsb --net-connector=127.0.0.1,37193,beast_in --net-only --interactive
is OK

@wiedehopf
Copy link
Owner

I don't know what hardware you have.

Honestly i'm not sure i have interest in further debugging this ... without the hardware it's kinda complicated.
Don't know what it needs beyond selecting 1000000 baud.

@wiedehopf
Copy link
Owner

Ok ... shot in the dark, try the most recent version of readsb with the baudrate specified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants