Stream Aircraft AM ATC to Broadcastify using RTL-SDR

Status
Not open for further replies.

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
DC31, It just occured to me that using ps -aux and a text match with the error text output from ezstream could be used as a condition to reboot (or kill and restart related processes). Just not sure how to do that yet :)
 

krokus

Member
Premium Subscriber
Joined
Jun 9, 2006
Messages
6,231
Reaction score
1,685
Location
Southeastern Michigan
DC31, It just occured to me that using ps -aux and a text match with the error text output from ezstream could be used as a condition to reboot (or kill and restart related processes). Just not sure how to do that yet :)

That depends on where the error text is placed. If the program is not running, it will not show in the results of the ps. (Which can be used to trigger a restart, via a script.) If the error goes into a log file, grepping that log could work.

Sent via Tapatalk
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,628
Reaction score
175
Location
Massachusetts
One thing with working with rpi and VNC when working with the terminal windows and trying to copy and paste long lines of text, it truncates the text to the viewable area of the window so I can't see the full content of the output messages. There is no horizontal slider tab to move the content around. Any suggestions on how to solve that problem?
TIA :).

Copy and paste when using VNC is a pain. I avoid it whenever possible. Normally, i am working on a Mac and connect to the pi through an ssh connection in a Terminal window. Copy and paste works fine there. If you are working on a Windows computer, you could try using puTTY for an ssh connection. I think that copy/paste will work that way.

I have seen the "no more data" streaming error messages MANY times. I have not tried to figure them out. As i recall, the message is something like "no more data from stdin". That implies to me that the data feed (audio) into ezstream has been interrupted. So, rather than a problem with ezstream itself, it may be a problem with the data being piped from rtl to sox then to ez.

I got my bcfy stream sounding reasonably good (acceptable) toward the end of last week. Since then i have diverged into trying to get the audio into pulseaudio so I can do other things rather than just a Bcfy feed. After countless hours, i can report absolutely no progress. When I hit on the correct combination to get it to show in pulse, the audio from rtl locks up with no error messages within about 5 sec.
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
That depends on where the error text is placed. If the program is not running, it will not show in the results of the ps. (Which can be used to trigger a restart, via a script.) If the error goes into a log file, grepping that log could work.

Sent via Tapatalk

Hi krokus,
If I run $pstree when the problem happens, the related process' still show up:

├─lxterminal─┬─bash───pstree
│ ├─bash─┬─2*[sox]
│ │ ├─2*[sudo───rtl_fm───5*[{rtl_fm}]]
│ │ └─2*[sudo───ezstream]
│ ├─gnome-pty-helpe
│ ├─{gdbus}
│ └─{gmain}

2 instances of rtl_fm, 2 instances of ezstream with 2 instances of sox. (Running 2 sdr sticks and 2 feeds to Broadcastify),

When the problem happens, the associated instance of ezstream streams an error with something like "...no more data.." The tree above is result of running the script from a terminal window. Normally I run it from .sh file that rc.local loads.
So is there a way to use ps to detect the error message from ezstream and trigger a reboot of the rpi?

Details are appreciated as I'm new to linux scripting. TIA :)

ps: when the problem happens, the connection to Broadcastify is lost. That's why I originally thought it was a connection issue on my end. But now I am seeing it happen on one feed and not the other even though both feeds are sourced from the same rpi. So I don't think it's an internet connection problem every time it happens.
 
Last edited:

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
Copy and paste when using VNC is a pain. I avoid it whenever possible. Normally, i am working on a Mac and connect to the pi through an ssh connection in a Terminal window. Copy and paste works fine there. If you are working on a Windows computer, you could try using puTTY for an ssh connection. I think that copy/paste will work that way.

I have seen the "no more data" streaming error messages MANY times. I have not tried to figure them out. As i recall, the message is something like "no more data from stdin". That implies to me that the data feed (audio) into ezstream has been interrupted. So, rather than a problem with ezstream itself, it may be a problem with the data being piped from rtl to sox then to ez.

I got my bcfy stream sounding reasonably good (acceptable) toward the end of last week. Since then i have diverged into trying to get the audio into pulseaudio so I can do other things rather than just a Bcfy feed. After countless hours, i can report absolutely no progress. When I hit on the correct combination to get it to show in pulse, the audio from rtl locks up with no error messages within about 5 sec.

Thanks for the tip on putty. I was using that in the beginning but the newer Pixel for rpi gives a nice desktop style GUI and you can quickly do things easier than everything at the command line level. Also use pixel with VNC on my ads-b feeder which is an rpi2.

Turns out that it's possible to use VNC and ssh in parallel. So I can use putty for a full size command window and use VNC for convenience for other things.

Sorry I know nothing about pulse audio yet. Still determined to solve the up time reliability problem of the rpi rtl-sdr feeding Broadcastify. Good luck with that :).
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
One follow up question I have is, is there some kind of obscure requirement to feed Broadcastify at a 22.05Khz sample rate? My latest iteration of the rpi feed only needs 16Khz to feed high quality audio.
When I look at my statistics page it shows my feed at 22.05 Khz. Is that a potential problem if I feed at 16Khz?
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
Last edited:

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,628
Reaction score
175
Location
Massachusetts

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,628
Reaction score
175
Location
Massachusetts
So is there a way to use ps to detect the error message from ezstream and trigger a reboot of the rpi?

Details are appreciated as I'm new to linux scripting. TIA :)

.

Jack,

Take a read of the following:

https://broadcastify.zendesk.com/hc/en-us/articles/204172369-Feed-Owner-API-v0-9-Documentation

Using the feed method returns the details of your feed with one of the parameters being whether it is on-line or off-line. "status":1 indicates on-line and "status":0 indicates off-line. It might be a good learning exercise to write a script that monitors that state and triggers a restart when it detects an off-line status. I would use the script that I posted a few days ago as a starting point and run it via a cron job every minute or two. I experimented a little with the feed method and there seems to be a lag of a minute or two also between when the feed goes off-line and when the status parameter actually changes.

This isn't the ideal solution but gives you a starting point.
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
Jack,

Take a read of the following:

https://broadcastify.zendesk.com/hc/en-us/articles/204172369-Feed-Owner-API-v0-9-Documentation

Using the feed method returns the details of your feed with one of the parameters being whether it is on-line or off-line. "status":1 indicates on-line and "status":0 indicates off-line. It might be a good learning exercise to write a script that monitors that state and triggers a restart when it detects an off-line status. I would use the script that I posted a few days ago as a starting point and run it via a cron job every minute or two. I experimented a little with the feed method and there seems to be a lag of a minute or two also between when the feed goes off-line and when the status parameter actually changes.

This isn't the ideal solution but gives you a starting point.

Was hoping to hack away at a solution for this application, but now feel resigned to actually learning how to write linux script from a tutorial to solve the problems as no one else has yet.
ps: Thanks for that link :).
 
Last edited:

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
Jack,

Take a read of the following:

https://broadcastify.zendesk.com/hc/en-us/articles/204172369-Feed-Owner-API-v0-9-Documentation

Using the feed method returns the details of your feed with one of the parameters being whether it is on-line or off-line. "status":1 indicates on-line and "status":0 indicates off-line. It might be a good learning exercise to write a script that monitors that state and triggers a restart when it detects an off-line status. I would use the script that I posted a few days ago as a starting point and run it via a cron job every minute or two. I experimented a little with the feed method and there seems to be a lag of a minute or two also between when the feed goes off-line and when the status parameter actually changes.

This isn't the ideal solution but gives you a starting point.

Started looking at this api info and still have not figured out how to form a fully working url yet. I think that "feedid" is the mount value less the / and the user id is whatever your actual user id and the password is your logon password and not the password used by the feed?
Got past the "access denied" messages but still don't know how to query for online status. That link is not exactly detailed and all but one of the comments have to do with actually getting it to work. lol.
Any suggestions? TIA :).
 
Last edited:

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
Did an experiment to see if it was the USB sdr stick that was causing the problem by just pulling it out while everything was running and could not duplicate the problem that way. The app detected the event and attempted to exit the related processes. So it's not a problem with the stick itself.
 

JACK26

Member
Joined
Dec 7, 2016
Messages
298
Reaction score
0
Location
Milpitas, CA
Also, if the api query gives you more real time offline status, that's good because then it gives you a little time to get back online before your feed shows up as offline. Offline for more than about a minute or so triggers offline status and takes about 1 minute or so once you get back online before the Bcstfy servers show your feed as online again. No doubt that is intentional.

ps: Are you saying that the api status is 1 minute behind the actual online feed status to the public? If that's the case then it's not very useful. Hopefully you meant that the public status lagged a minute behind the api status.
 
Last edited:

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,628
Reaction score
175
Location
Massachusetts
Started looking at this api info and still have not figured out how to form a fully working url yet. I think that "feedid" is the mount value less the / and the user id is whatever your actual user id and the password is your logon password and not the password used by the feed?
Got past the "access denied" messages but still don't know how to query for online status. That link is not exactly detailed and all but one of the comments have to do with actually getting it to work. lol.
Any suggestions? TIA :).

Feedid are the numbers at the end of your links posted two posts above.

23831
And
25781

Userid and password are your user name and password used to sign in to use the RR forums. jack26 and your password.
 
Status
Not open for further replies.
Top