PiScan - an SDR Radio Scanner

Status
Not open for further replies.

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
No, the only thing in the PiScan/data folder is a logs folder. None of the .json files were created.
 

davidVT

Member
Feed Provider
Joined
Aug 29, 2010
Messages
138
Location
Washington County,Vermont
Following DC31’s progress, I tried to copy your systems.json into the data directory. I see backend recognized it was there but immediately it kicked a ‘key’ error and crashed.
The other two config files do not exist in data.
 

davidVT

Member
Feed Provider
Joined
Aug 29, 2010
Messages
138
Location
Washington County,Vermont
Went back to start and ran without the systems.json

this is the logfile:


arguments: ./piScan_backend
Current dir: /home/pi/PiScan/build
File verbosity level: 3
date time ( uptime ) [ thread name/id ] v|
2020-06-09 20:48:31.933 ( 0.002s) [main thread ]INFO| Logging to '../data/logs/20200609-204831.log', mode: 'w', verbosity: 3
2020-06-09 20:48:31.934 ( 0.003s) [main thread ]INFO| Logging to '../data/logs/latest.log', mode: 'w', verbosity: 3
2020-06-09 20:48:31.934 ( 0.003s) [MessageManager ] 2| MessageManager started
2020-06-09 20:48:31.935 ( 0.004s) [Scanner ]INFO| No system list file found
2020-06-09 20:48:31.935 ( 0.004s) [Scanner ]INFO| Loaded 0 systems
2020-06-09 20:48:31.935 ( 0.004s) [Scanner ] 1| Sorting bandwidth chunks...
2020-06-09 20:48:31.935 ( 0.004s) [main thread ]INFO| Starting TCP server on port 1234
2020-06-09 20:48:31.935 ( 0.004s) [Scanner ] 1| System list is empty, nothing to sort
2020-06-09 20:48:31.935 ( 0.004s) [Scanner ] 1| ScannerSM ready
2020-06-09 20:48:31.936 ( 0.005s) [main thread ] 1| Starting audio RTSP server
2020-06-09 20:48:31.936 ( 0.005s) [main thread ]INFO| RTSP audio server available on port 8554
2020-06-09 20:48:31.936 ( 0.005s) [main thread ] 1| URL for stream clients: rtsp://192.168.162.167:8554/audio
2020-06-09 20:48:31.937 ( 0.006s) [main thread ] 1| Connection Manager started
2020-06-09 20:48:31.937 ( 0.006s) [main thread ] 1| Audio device #0 - PulseAudio:
Default output: Yes
Default Input: Yes
Input channels: 2
Output channels: 2
Duplex channels: 2
Native formats:
16-bit signed integer.
32-bit signed integer.
32-bit float normalized between plus/minus 1.0.
Supported sample rates:
8000hz
16000hz
22050hz
32000hz
44100hz
48000hz
96000hz
2020-06-09 20:48:31.939 ( 0.008s) [SDR Post Proc ]INFO| SDR Post-processing thread started
2020-06-09 20:48:31.939 ( 0.008s) [SDR Enumerator ] 1| SDR enumerator starting
2020-06-09 20:48:31.939 ( 0.008s) [SDR Enumerator ] 1| SoapySDR init..
API Version: v0.6.0
ABI Version: v0.6
Install root: /usr
Loading modules...
2020-06-09 20:48:32.016 ( 0.085s) [SDR Enumerator ] 1| Available factories:
airspy
audio
bladerf
hackrf
lime
null
osmosdr
redpitaya
remote
rtlsdr
uhd
default_input = True
default_output = True
device_id = 0
driver = audio
label = PulseAudio
2020-06-09 20:48:34.833 ( 2.901s) [SDR Enumerator ] 1| Make device
device_id = 0
origin = https://github.com/pothosware/SoapyAudio
available = Yes
driver = rtlsdr
label = Generic RTL2832U OEM :: 00000001
manufacturer = Realtek
product = RTL2838UHIDIR
rtl = 0
serial = 00000001
tuner = Rafael Micro R820T
2020-06-09 20:48:34.835 ( 2.904s) [SDR Enumerator ] 1| Make device
origin = https://github.com/pothosware/SoapyRTLSDR
rtl = 0
2020-06-09 20:48:35.261 ( 3.330s) [SDR Enumerator ] 1| Reporting enumeration complete
2020-06-09 20:48:35.261 ( 3.330s) [SDR Enumerator ] 1| SDR Enumerator done
2020-06-09 20:48:35.261 ( 3.330s) [main thread ]INFO| Auto-selecting SDR device
2020-06-09 20:48:35.261 ( 3.330s) [main thread ]INFO| Auto selected: Generic RTL2832U OEM :: 00000001
2020-06-09 20:48:35.261 ( 3.330s) [main thread ]INFO| Auto selecting sample rate
2020-06-09 20:48:35.653 ( 3.722s) [main thread ]INFO| Setting device sample rate to 2048000
2020-06-09 20:48:37.687 ( 5.756s) [main thread ] ERR| thread '9SDRThread' has not terminated in time ! (> 2000 ms)
2020-06-09 20:48:37.688 ( 5.757s) [main thread ]INFO| Creating modems
2020-06-09 20:48:37.688 ( 5.757s) [SDR Interface ]INFO| SDR Thread starting
2020-06-09 20:48:37.693 ( 5.762s) [SDR Interface ] 1| device init()
2020-06-09 20:48:37.694 ( 5.763s) [Audio ]INFO| Audio thread initializing
2020-06-09 20:48:37.694 ( 5.763s) [main thread ]INFO| Added modem NFM
2020-06-09 20:48:37.694 ( 5.763s) [Audio ]INFO| Audio thread started
2020-06-09 20:48:37.695 ( 5.764s) [NBFM Pre Proc ]INFO| Demodulator prepocessing thread started
2020-06-09 20:48:37.695 ( 5.764s) [Audio ]INFO| Audio thread initializing
2020-06-09 20:48:37.695 ( 5.764s) [Demod - NFM ]INFO| Demodulator thread started
2020-06-09 20:48:37.695 ( 5.764s) [Audio ]INFO| Audio thread initializing
2020-06-09 20:48:37.695 ( 5.764s) [AM Pre Proc ]INFO| Demodulator prepocessing thread started
2020-06-09 20:48:37.696 ( 5.765s) [main thread ]INFO| Added modem AM
2020-06-09 20:48:37.696 ( 5.765s) [Demod Worker ]INFO| Demodulator worker thread started
2020-06-09 20:48:37.696 ( 5.765s) [Demod - AM ]INFO| Demodulator thread started
2020-06-09 20:48:37.698 ( 5.767s) [main thread ] 1| Demodulator started
2020-06-09 20:48:37.698 ( 5.767s) [main thread ] 2| Begin accepting connections
2020-06-09 20:48:37.698 ( 5.767s) [main thread ] 1| Loading saved scanner state
2020-06-09 20:48:37.698 ( 5.767s) [main thread ] 1| ExtEvent: startScan
2020-06-09 20:48:37.698 ( 5.767s) [Scanner ]INFO| Database is empty, no entries to scan - defaulting to manual entry
2020-06-09 20:48:37.699 ( 5.767s) [Scanner ] 1| Setting manual frequency to 100.0000MHz
2020-06-09 20:48:37.699 ( 5.768s) [main thread ]INFO| System initialized
Stack trace:
0 0xb6565130 __default_rt_sa_restorer + 0
2020-06-09 20:48:37.699 ( 5.768s) [Scanner ]FATL| Signal: SIGSEGV
2020-06-09 20:48:37.699 ( 5.768s) [Demod Worker ]INFO| Demodulator worker thread started
 

fire42man

Member
Joined
Sep 21, 2011
Messages
88
Location
Pittsburgh
No, the only thing in the PiScan/data folder is a logs folder. None of the .json files were created.
The config/state files will just be created with default values if they don’t exist, but only on the first clean exit. The systems file will need to be created first to give it something to scan. See “Usage” in the readme for guidance on how to produce the file

Following DC31’s progress, I tried to copy your systems.json into the data directory. I see backend recognized it was there but immediately it kicked a ‘key’ error and crashed.
The other two config files do not exist in data.
If you started with a 1:1 copy of the example, note that the comments cannot be included, because the internal parser doesn’t know how to deal with them. Otherwise it could be a formatting error on my part. The parser I used is pretty strict, I’ve noticed it throws a fit of a single comma is out of place
 

davidVT

Member
Feed Provider
Joined
Aug 29, 2010
Messages
138
Location
Washington County,Vermont
I managed to get the client working and connected to the backend.

Followed this link to get PySide2 on the Pi:

Then went back to your requirements file and manually ran the second line:
pip3 protobuf

I also tried
pip google
but not sure that was relevant or not. Would suggest try without first.

Then was able to run client and see it on the Gui (VNC screen remote via VPN).
I was able to VLC the stream over the VPN.

While I could not get any clear signally manually nor via edits to systems.json, I was able to play with squelch controls enough to hear changes coming across the stream (static only) but clearly changes made by the client controls.

This is as far as I can get being hours from the actual hardware but this still looks promising.

NOTE: The backend is still not saving the two config files.

Thank you!
 

fire42man

Member
Joined
Sep 21, 2011
Messages
88
Location
Pittsburgh
So the config files won't be generated until the backend exits cleanly - you have to use Ctrl+C, SIGINT or SIGTERM to initiate the exit. Closing the terminal while it's running will kill the process before it could save anything. Though if that wasn't the case, it's probably crashing at some point during exit. Saving config files is one of the last steps during exit, so if something goes wrong before that then they won't be saved.

If you want to use the GUI on your local system rather than directly on the Pi, then using a properly secured VPN isn't much riskier than connecting within your local network. I actually have a remote setup connected with VPN to my home network that I use to test latency (in addition to getting a better signal from the next county over)
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
I can report the same successes as DavidVT! Got the piscan_backend running and finally his clue on the PySide2 mystery allowed me to conquer the PiScan-Client. No pip google and it seems to be running fine. I have also exited cleanly thus saving all three .json files in the data folder.

Now to work with some audio.

Thank you
 

fire42man

Member
Joined
Sep 21, 2011
Messages
88
Location
Pittsburgh
Thanks for pointing that out davidVT! I forgot there was that distinction for installing PySide2 on Raspbian, but I now remember running into that problem when I was setting my Pi up a few months ago. Definitely will add that to the list of things I need to update in the readme

TL;DR for those who want to use the GUI on Raspbian: you have to install PySide2 through apt rather than pip
 

fire42man

Member
Joined
Sep 21, 2011
Messages
88
Location
Pittsburgh
As a test I started the backend with sudo and afterwards those missing config files were indeed created. Perhaps a permissions issue?
Sounds like it. What directory did you clone the repo into? Personally I’ve never had issues putting it in /home/pi, but you may need to do a chmod +w if it’s elsewhere
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Okay, I now feel that I can report success! I have piScan running Monitoring a single channel in Manual mode and routing the audio through pulseaudio to a copy of voxcall which is recording the transmissions. All is working well. My big discovery was that my ppm correction for that stick is -75 rather than +75. That made a world of difference. I simply adjusted the tuning frequency to account for it.

Next up is to work on scanning multiple frequencies.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Is PiScan_backend designed to run on Buster-Lite (non-gui)? I have tried that and the program seems to run fine. I can access it through PiScan-Client from another computer on the network. However, as soon as it detects audio the following message streams continuously across the open terminal window running the backend:

2020-06-13 15:43:22.758 ( 424.587s) [Demod - NFM ]WARN| DemodulatorThread::run() cannot push ati into audioOutputQueue, is full !
 

fire42man

Member
Joined
Sep 21, 2011
Messages
88
Location
Pittsburgh
Is PiScan_backend designed to run on Buster-Lite (non-gui)? I have tried that and the program seems to run fine. I can access it through PiScan-Client from another computer on the network. However, as soon as it detects audio the following message streams continuously across the open terminal window running the backend:

2020-06-13 15:43:22.758 ( 424.587s) [Demod - NFM ]WARN| DemodulatorThread::run() cannot push ati into audioOutputQueue, is full !
What audio library did you compile with? In my experience PulseAudio uses a ton of CPU to the point where it can't run on a Pi, but with ALSA everything works fine
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
What audio library did you compile with? In my experience PulseAudio uses a ton of CPU to the point where it can't run on a Pi, but with ALSA everything works fine
Yes, it was compiled with pulseaudio. I have installed PiScan with pulse on a pi3 running the full Buster with gui and it works fine. CPU in the high 20% range when scanning and in the 30%’s when processing audio. CPU temps less than 70C. I am using pulse to route the audio to other downstream programs (TTD and voxcall) and it works well.

I imaged a fresh card with Buster Lite and loaded PiScan on a pi2. It loaded and ran fine until audio was detected resulting in the aforementioned error. So I then shut the pi2 down and put that SD card into a pi4 (a 4gb Model, I think) and got the same error when audio was detected.

Yes, I have too many pi’s kicking around...
 

davidVT

Member
Feed Provider
Joined
Aug 29, 2010
Messages
138
Location
Washington County,Vermont
Can you please explain:
"persistent channel lockout"
in the systems.json I see it at the top and then on each channel.
If I want to have three channels in the scanner possible but default to only monitoring one channel on unattended reboot, what is the best course of action??
Thank you
 
Status
Not open for further replies.
Top