Zello feed from a Raspberry Pi

Status
Not open for further replies.

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
From my notes:
pip3 install pycryptodome
(if this doesn't work, try this:
pip3 uninstall crypto pip3 uninstall pycryptodome pip3 install pycryptodome
see here: Frequently Asked Questions — PyCryptodome 3.9.8 documentation)
Okay thanks for that, I had tried installing pycryptodome before but was getting an environment error, that uninstall/install business cured that.

It runs now, but errors out reporting "OSError: [Errno -9998] Invalid number of channels"... Seems like an underlying sound related thing? I am using a SYBA SD-CM-UAUD USB CM119 audio adapter.
 

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
@aaknitt I noticed the program crashes/exits when the vox level is tripped for me. Any words of wisdom?

I'm not sure if its supposed to be pip3 install websocket-client-py3 instead of pip3 install websocket. Maybe that is part of my problem?
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
What sort of error does it return when it crashes? Here is what mine looks like when streaming successfully:

Done sending audio
found audio - creating zello connection
{'error': 'channel is not ready', 'seq': 2}
{'command': 'on_channel_status', 'channel': 'Simulcast 1', 'status': 'online', 'users_online': 7, 'images_supported': False, 'texting_supported': True, 'locations_supported': False}
{'stream_id': 34951, 'success': True, 'seq': 3}
Fri Jul 3 21:47:50 2020
sending to stream_id 34951
Done sending audio
 

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
The last line or two after tripping the vox level and attempting to start steaming the audio is SSL related:

ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1056)

And I have run update-ca-certificates, with no difference

Nevermind, I have the wrong time zone selected! doh!
 
Last edited:

kb9mwr

Member
Joined
Apr 8, 2003
Messages
263
Location
Green Bay, WI
You know what would help here is if someone would write a how to, listing dependencies so I can stop guessing. Does this thing use jack server for audio? Kind of looks that way.

ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'defaults.bluealsa.device'
ALSA lib conf.c:4568:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5036:(snd_config_expand) Args evaluate error: No such file or directory
ALSA lib pcm.c:2565:(snd_pcm_open_noupdate) Unknown PCM bluealsa
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock

...

self._sslobj.do_handshake()
ssl.SSLError: [SSL: SSLV3_ALERT_HANDSHAKE_FAILURE] sslv3 alert handshake failure (_ssl.c:1056)

And I still get the SSL thing with the correct time, so I dunno
 

bunangst

Member
Joined
Mar 12, 2013
Messages
48
Location
Harmony, NJ
I was able to get Andy's python programming running and transmitting to Zello not long after he posted it.
Buttttttt I had some stability issues and I put it on the back-burner for other projects.

I'm definitely interested in getting a stable setup working and helping with development!
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
I have two instances of it running on a pi. The first Channel is standard feed of all radio traffic on the primary dispatch frequency:


The second is an instance which is triggered by TwoToneDetect with the -runtime 30 option. When TTD decodes a tone set, this channel broadcasts the dispatch message for 30 sec and then goes silent Until the next tone decode. So if you monitor this Zello Channel you only hear the dispatches, not all the other chatter.


Yes, I have had some stability issues also. They seem to be somehow related to pulseaudio. I haven’t made a serious attempt to solve them. My workaround has been a script that monitors the zello feed and restarts it if it is found down. It also seems that Zello occasionally misses some transmissions.

Listening on my iPhone, I find that the Zello feeds may disconnect when traveling between wifi AP’s and cell data. This typically requires a manual reconnect. I believe that this is unrelated to Andy’s program.
 

tsawyer

Newbie
Joined
Jul 2, 2014
Messages
3
hi @DC31 I am trying to run the Nrad code from @unmaintained on a RPI 4. I believe I have all the dependencies addressed, but am running into the below error. Any suggestions? For reference, I am also running the IAR / TwoToneDetect package on here to relay our dispatches and that part is working just fine.

Invoking Nrad with ---

nrad -user myusername -password mypassword -channel "PC 911 Dispatch" -token "blahblahblahdfsdafsad"

Seeing this error ... just seems to loop over and over.

TRACE SocketWrite message: {logon 17 mytokenstuff channelname username password false}
INFO HandleSocketWrite succes: true
TRACE HandleSocketRead rec: {"success":true,"seq":17}
INFO HandleSocketRead - found answer command: logon, sequence: 17
INFO HandleAnswerLogin - success: true
{"command":"on_nrad_status","status":4}

{"command":"on_login","success":true}

TRACE HandleSocketRead rec: {"command":"on_channel_status","channel":"PC 911 Dispatch","status":"online","users_online":3,"images_supported":false,"texting_supported":false,"locations_supported":false}
{"command":"on_nrad_status","status":5}

INFO HandleOnChannelStatus - channel: PC 911 Dispatch, status: online, users: 3, images: false, texting: false, locations: false
{"command":"on_channel_status","channel":"PC 911 Dispatch","status":"online","users_online":3,"images_supported":false,"texting_supported":false,"locations_supported":false}

TRACE HandleSocketRead rec: {"command":"on_error","error":"false"}
INFO HandleOnError - message: {"command":"on_error","error":"false"}
{"command":"on_error","error":"false"}

{"error":"websocket_closed"}

{"command":"on_nrad_status","status":6}

{"command":"on_nrad_status","status":1}

{"command":"on_disconnect","success":true}

INFO WsDisconnect disconnected from: wss://zello.io/ws
 

tsawyer

Newbie
Joined
Jul 2, 2014
Messages
3
@DC31 and @unmaintained -- So, I solved my own problem by removing the channel password. It didn't seem to like that, but now that it is removed, things are working fine. My next question would be, how are you guys handling VOX to start/stop the stream? I can manually send the start_stream and stop_stream, but I am admittedly at a loss as to how to trigger it based on a squelch trip. Any suggestions would be greatly welcome.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
hi @DC31 I am trying to run the Nrad code from @unmaintained on a RPI 4. I believe I have all the dependencies addressed, but am running into the below error. Any suggestions? For reference, I am also running the IAR / TwoToneDetect package on here to relay our dispatches and that part is working just fine.

Invoking Nrad with ---

nrad -user myusername -password mypassword -channel "PC 911 Dispatch" -token "blahblahblahdfsdafsad"

Seeing this error ... just seems to loop over and over.

TRACE SocketWrite message: {logon 17 mytokenstuff channelname username password false}
INFO HandleSocketWrite succes: true
TRACE HandleSocketRead rec: {"success":true,"seq":17}
INFO HandleSocketRead - found answer command: logon, sequence: 17
INFO HandleAnswerLogin - success: true
{"command":"on_nrad_status","status":4}

{"command":"on_login","success":true}

TRACE HandleSocketRead rec: {"command":"on_channel_status","channel":"PC 911 Dispatch","status":"online","users_online":3,"images_supported":false,"texting_supported":false,"locations_supported":false}
{"command":"on_nrad_status","status":5}

INFO HandleOnChannelStatus - channel: PC 911 Dispatch, status: online, users: 3, images: false, texting: false, locations: false
{"command":"on_channel_status","channel":"PC 911 Dispatch","status":"online","users_online":3,"images_supported":false,"texting_supported":false,"locations_supported":false}

TRACE HandleSocketRead rec: {"command":"on_error","error":"false"}
INFO HandleOnError - message: {"command":"on_error","error":"false"}
{"command":"on_error","error":"false"}

{"error":"websocket_closed"}

{"command":"on_nrad_status","status":6}

{"command":"on_nrad_status","status":1}

{"command":"on_disconnect","success":true}

INFO WsDisconnect disconnected from: wss://zello.io/ws
Sorry, but I am no help on that one. The error doesn’t mean anything to me. I have no experience with nrad.
 

tsawyer

Newbie
Joined
Jul 2, 2014
Messages
3
Sorry, but I am no help on that one. The error doesn’t mean anything to me. I have no experience with nrad.

Thanks for the quick reply regardless! For your streams, are you using the zello python code then or did you stick with the Lineage or Emteria route?
 

Mark181

Member
Feed Provider
Joined
Jun 18, 2020
Messages
37
Location
Ocean County, NJ
I got Andy's Zello stream script running on my Raspberry Pi 3 with the help of @DC31 but after a few minutes of transmissions. The whole Pi crashes and shuts off. Can anyone help me? Or explain why this is happening?
 

ktx21

Member
Joined
Jul 25, 2021
Messages
7
Hello all,

I'm working on setting up zellostream using my Pi4 and having a bit of trouble. I think/hope I'm close, but getting the following when I try to execute python3 zellostream.py:

ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c :2565: (snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_oss.c :377: (_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c :377: (_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c :823: (_snd_pcm_a52_open) a52 is only for playback
ALSA lib pcm_usb_stream.c :486: (_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c :486: (_snd_pcm_usb_stream_open) Invalid type for card
Expression 'paInvalidSampleRate' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2048
Expression 'PaAlsaStreamComponent_InitialConfigure( &self->capture, inParams, self->primeBuffers, hwParamsCapture, &realSr )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2719
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2843
Traceback (most recent call last):
File "zellostream.py", line 88, in <module>
input_device_index = input_device_index,)
File "/home/pi/.local/lib/python3.7/site-packages/pyaudio.py", line 750, in open
stream = Stream(self, *args, **kwargs)
File "/home/pi/.local/lib/python3.7/site-packages/pyaudio.py", line 441, in __init__
self._stream = pa.open(**arguments)
OSError: [Errno -9997] Invalid sample rate

Any assistance would be greatly appreciated. I am using UGREEN PNP usb audio adapter. Thanks!
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Try changing your input device index number around in zello.cfg. I find that trial and error works on this. Mine currently uses index 6
 

ktx21

Member
Joined
Jul 25, 2021
Messages
7
Try changing your input device index number around in zello.cfg. I find that trial and error works on this. Mine currently uses index 6
Do you mean config.json? If so, I tried others (0-12) in there with no luck. When look in aplay -l it lists the audio devices and the USB card is on 2. So I have the index currently set to 2. When I move it off of 2, I get a "invalid number of channels" error at the bottom. So I'm thinking "2" is correct and my issue might be something else.
 

DC31

Member
Feed Provider
Joined
Feb 19, 2011
Messages
1,547
Location
Massachusetts
Yeah, I think I have an old version of the program. Config.json is probably correct. Do you have the LevelMeter program in your Zello or dist directory that you can run? That shows the indexes and which goes with which.
 

bunangst

Member
Joined
Mar 12, 2013
Messages
48
Location
Harmony, NJ
File "/home/pi/.local/lib/python3.7/site-packages/pyaudio.py", line 441, in __init__
self._stream = pa.open(**arguments)
OSError: [Errno -9997] Invalid sample rate

This error is cause by an unsupported sampling rate being set to your usb sound card.
You will have to do some research and/or test common sampling rates to see which are supported by that specific sound card.

The sample rate is set on line 81 in Andy's original code and default is 16,000Hz (16kHz)
 
Status
Not open for further replies.
Top