I kinda thought for a second… -h is help.
I took that out and it worked.
I did go searching for the Python code that is running and I didn’t find it. miniforge3/envs/rsudp/bin
rs-client imports main from rsudp.client. But I don’t know where this code is located. I downloaded the source and will just forge through it until I understand it.
This rsudp really works great.
I have a 256 wide by 64 high RGB display controlled from a RPI 3B+. I’m going to have it display the “count” waveform, or the frequency display. I have two shakes and many places to display the information.
The displayed error is:
2024-11-02 00:42:25 [get_inventory] ERROR: Inventory fetch failed!
2024-11-02 00:42:25 [get_inventory] Error detail: HTTPSConnectionPool(host=‘fdsnws.raspberryshakedata.com’, port=443): Max retries exceeded with url: /fdsnws/station/1/query?network=AM&station=R8D37&level=resp&nodata=404&format=xml
(Caused by SSLError(SSLCertVerificationError(1, “[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: Hostname mismatch, certificate is not valid for ‘fdsnws.raspberryshakedata.com’. (_ssl.c:1000)”)))
this URI has changed. the solution is to udpate the FDSN service URL as per the following:
from : https://fdsnws.raspberryshakedata.com
to : https://data.raspberryshake.org
further details on the FDSNWS service for the AM / Shake network can be found here.
I’m adding the continuous plotting window created by rsudp to be displayed on an RGB matrix. This matrix is 256x64 RGB leds. I installed rsudp on the RPI 3B+ which drives the matrix. I modified c_plot.py in mainloop to save each image to the logdir. I was thinking to add a Module, but that really only gets ALARM messages. I could have updated rsudp with a new ‘FRAME’ message passing the filename of the saved png plot, or passed the entire png in the message. But, I think messages are 4k max, so I skipped that. I looked for the logdir so I could reuse that directory instead of screencap. I think my tmp directory is in RAM, where logdir is, so it doesn’t wear out the sdcard by writing every plot. My RGB program can look for changes to the file and update from that. This is kludgy. Ugh. But, I own a hammer and not afraid to use it.
I didn’t see any natural way to change rsudp to handle getting every plot. I also didn’t see much need in adding the feature if it hasn’t been added by now, nobody needs this feature except me.
I forsee changing the plots so they look better on the display. At that point, I guess I should hackup rsudp and rename it. Or, move the plotting part of rsudp into a new Module. Ideas? I know it has been years since this was written.
Below is my change to mainloop. It was the smallest update I tried.
in c_plot.py: see 'gdd' added line to save every screen plot to logdir as single file
def mainloop(self, i, u):
'''
The main loop in the :py:func:`rsudp.c_plot.Plot.run`.
:param int i: number of plot events without clearing the linecache
:param int u: queue blocking counter
:return: number of plot events without clearing the linecache and queue blocking counter
:rtype: int, int
'''
if i > 10:
linecache.clearcache()
i = 0
else:
i += 1
self.stream = rs.copy(self.stream) # essential, otherwise the stream has a memory leak
self.raw = rs.copy(self.raw) # and could eventually crash the machine
self.deconvolve()
self.update_plot()
if u >= 0: # avoiding a matplotlib broadcast error
self.figloop()
plt.savefig('/tmp/rsudp/rsudpPlot.png', facecolor=self.fig.get_facecolor(), edgecolor='none') # gdd save every plot
if self.save:
# save the plot
if (self.save_timer > self.save[0][0]):
self._eventsave()
u = 0
time.sleep(0.005) # wait a ms to see if another packet will arrive
sys.stdout.flush()
return i, u