The community websdr-plus-github can be found here: https://github.com/ny4qphil/PhantomSDR-Plus ..it is compatible with the normal version, but enhanced.

Recent posts

#21
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by Bas ON5HB - Jul 11, 2025, 04:36 PM
Next attempt....maybe the FIFO isn't working properly....

So I made 1 script and 1 systemd

start-websdr.sh

#!/bin/bash
cd /opt/PhantomSDR-Plus/

killall -s9 spectrumserver
killall -s9 rx888_stream

## Files to load
#FIFO=fifo.fifo
TOML=config-rx888mk2.toml

#[ ! -e "$FIFO" ] && mkfifo $FIFO

rx888_stream/target/release/rx888_stream -f ./rx888_stream/SDDC_FX3.img -s 60000000 --pga -d -r -g 50 -a 0 -m low -o - | build/spectrumserver --config $TOML

#exit

websdr.service

[Unit]
Description=PhantomSDRPlus WebSDR
Requires=network-online.target

[Service]
ExecStart=/opt/PhantomSDR-Plus/start-websdr.sh
Type=exec
Restart=on-failure
RestartSec=5

[Install]
Alias=websdr.service
WantedBy=multi-user.target

Let's see how this works.
#22
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by Bas ON5HB - Jul 08, 2025, 04:40 PM
Quote from: Emmanuel SV1BTL on Jul 07, 2025, 10:29 PMStrange behavior during the last month. RX-888 USB disconnections, but the server is still running!
The only new condition is the heat - 38 and even 42 °C
To be honest, I am tired....
No idea what you mean.

But we finally worked out the problem with the long-jmps, now testing.

The problems seem to be in buffering too much causing TCP-stack-problems.

In websocket.cpp you can change 2 lines, as we did for testing:

if (con->get_buffered_amount() > 100) {
            printf("Dropping Audio due to buffering slow client\n");
            continue;
        }

if (con->get_buffered_amount() > 100) {
              printf("Dropping Waterfall due to buffering slow client\n");
              continue;
           }

Could be your lines are without the message-printing, doesn't matter....change the value to 100.

We hope this ends the crashes for good, it seems the values where way too high. The code is pretty hard to read and messages unclear.

TCP in real-time should not buffer a lot as it fills the backlog for nothing. This is TCP-buffering, not the same as at the client side buffering.

Maybe 100 is still to high. Restarts by systemd will let us know....I hope.
#23
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by 9a7aof - Jul 08, 2025, 03:17 PM
Thanks Alan,

Sdr-list is now working stably, I'm including my server on the list again.

Best regards,
Darko, 9a7aof
#24
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by alanVK2ZIW - Jul 08, 2025, 02:08 PM
Just to let you know, I've fixed my cron script bug:
And you can see the RX-888 on the same antenna on port 9074
www.unixservice.com.au:9074 and port 9073 for the RSP1 and PhantomSDR

#!/bin/bash
PATH=/usr/local/bin:$PATH
cd /home/alanb/src/ny4q/PhantomSDR-Plus
 [  `pgrep -c  -u $USER miri_sdr` = 1 ] && \
 [  `pgrep -c  -u $USER spectrumserver` = 1 ] && exit 0


pkill -u $USER spectrumserver
pkill -u $USER miri_sdr

echo "" >> MiriErrors
data >> MiriErrors

sleep 2
 miri_sdr -m 252 -f 6900000 -s 2000000 - 2>MiriErrors | ./build/spectrumserver --config config-miri.toml >> specMiri 2>&1 &

exit
#25
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by Emmanuel SV1BTL - Jul 07, 2025, 10:29 PM
Strange behavior during the last month. RX-888 USB disconnections, but the server is still running!
The only new condition is the heat - 38 and even 42 °C
To be honest, I am tired....
#26
PhantomSDR Bugs / Re: SDR-list bug...
Last post by Bas ON5HB - Jul 07, 2025, 12:29 PM
It happens from time to time.
Steven is aware of it.

Normly it solves itself after a few minutes.
#27
PhantomSDR Bugs / Re: SDR-list bug...
Last post by 9a7aof - Jul 07, 2025, 09:57 AM
Is this normal?

Attached is a screenshot of https://sdr-list.xyz after 10++ minutes.

Best Regards,
Darko, 9a7aof
#28
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by Bas ON5HB - Jul 06, 2025, 05:38 PM
Ok, I think I found the crashing, it has been running the entire day without longjumps....it's buffering of slow clients that causes this.

Edit the websocket.cpp

        //if (con->get_buffered_amount() > 1000) {
        //    printf("Dropping Audio due to buffering slow client\n");
        //    continue;
        //}

        //Fixed version, no need to output - Bas ON5HB
        if (con->get_buffered_amount() > 500) { continue; }

And it's there a second time for the waterfall

          // Fixed version,no need to output - Bas ON5HB
          if (con->get_buffered_amount() > 500) { continue; }

I removed the printing and adjusted the numbers.

We remmed those lines, but turns out websocket keeps buffering, some sort of bug and over time it crashes by keeping connections open.

start-websdr.sh script:

#!/bin/bash
cd /opt/PhantomSDR-Plus/

### STOP CRASH Injections!!!!
##If no other rules apply, flushing is easier

iptables -D INPUT -m string --algo kmp --string "%3C%" -j DROP
iptables -D INPUT -m string --algo kmp --string "device.rsp" -j DROP

iptables -A INPUT -m string --algo kmp --string "%3C%" -j DROP
iptables -A INPUT -m string --algo kmp --string "device.rsp" -j DROP

## Files to load
FIFO=fifo.fifo
TOML=config-rx888mk2.toml

[ ! -e "$FIFO" ] && mkfifo $FIFO

build/spectrumserver --config $TOML < $FIFO

#exit

start-receiver.sh script:

#!/bin/bash
cd /opt/PhantomSDR-Plus/

## Files to load
FIFO=fifo.fifo
TOML=config-rx888mk2.toml

[ ! -e "$FIFO" ] && mkfifo $FIFO

#Without PGA
rx888_stream/target/release/rx888_stream -f ./rx888_stream/SDDC_FX3.img -s 60000000 -g 45 -a 0 -m low -o - > $FIFO

#exit

systemd receiver.service

[Unit]
Description=PhantomSDRPlus WebSDR
Requires=network-online.target receiver.service
Before=websdr.service
[Service]
PIDFile=/run/receiver.pid
ExecStart=/opt/PhantomSDR-Plus/start-receiver.sh
Type=exec
Restart=on-failure
RestartSec=5
[Install]
Alias=receiver.service
WantedBy=multi-user.target

Systemd websdr.service

[Unit]
Description=PhantomSDRPlus WebSDR
Requires=network-online.target
After=receiver.service
[Service]
PIDFile=/run/websdr.pid
ExecStart=/opt/PhantomSDR-Plus/start-websdr.sh
Type=exec
Restart=on-failure
RestartSec=5
[Install]
Alias=websdr.service
WantedBy=multi-user.target

That seems to do the trick. We got mixedup because of these messages it was printing in the log, but at the same time people injected the system with nasty code and crashed the chatbox with weird characters.

It keeps running stable so far, not seen if it restarted, but I really don't care if it does. As long as it keeps online  ;D

Fingers crossed that this keeps it from crashing.
#29
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by 9a7aof - Jul 06, 2025, 06:38 AM
Hi,

Quote@reboot /bin/bash -lc 'cd /home/websdr/PhantomSDR-Plus/ && ./ipt.sh'
Quoteroot@Siemens:/home/websdr# iptables -L
Chain INPUT (policy ACCEPT)
target    prot opt source              destination       
DROP      all  --  anywhere            anywhere            STRING match  "%3C%" ALGO name kmp
DROP      all  --  anywhere            anywhere            STRING match  "device.rsp" ALGO name kmp


I run iptables from cron only once, when restarting the linux computer.
Thanks!
Darko, 9a7aof
#30
PhantomSDR Bugs / Re: Coredumps and crash.
Last post by Bas ON5HB - Jul 06, 2025, 06:21 AM
It tried to restart, but failed.
Changed some more parameters, test some more, if they work I post them.

As for putting IP-tables in cron, that is not a good idea.
They only need to be inserted once after a reboot, else they keep growing to no purpose.

See here to make them stick: https://linuxconfig.org/how-to-make-iptables-rules-persistent-after-reboot-on-linux

I just did a quick blocking as I have no other rules. ;)
Powered by EzPortal