shake-UDP-local.py no longer working

HI,

I tried to run the “shake-UDP-local.py” program in the /opt/settings/user folder but get the following error:

myshake@raspberryshake:/opt/settings/user $ python shake-UDP-local.py
Opening socket on (HOST:PORT) 192.168.1.65:8888
Traceback (most recent call last):
File “shake-UDP-local.py”, line 14, in
sock.bind((host, port))
File “/usr/lib/python2.7/socket.py”, line 228, in meth
return getattr(self._sock,name)(*args)
socket.error: [Errno 98] Address already in use
myshake@raspberryshake:/opt/settings/user $

I then checked what was running:

myshake@raspberryshake:/opt/settings/user $ ps -aef | grep python
root 1067 1056 0 02:06 ? 00:00:00 /usr/bin/python /usr/local/bin/gunicorn -b 0.0.0.0:8000 app:app -w 2 --chdir /usr/local/src/FE-CChan
root 1086 997 0 02:06 ? 00:00:00 python3 app.py
root 1087 997 0 02:06 ? 00:00:00 python3 alivesocket.py
root 1093 997 0 02:06 ? 00:00:01 /usr/bin/python3 /usr/bin/gunicorn -b 0.0.0.0:5000 app:app -w 4 --timeout 300000
root 1163 1067 0 02:06 ? 00:00:00 /usr/bin/python /usr/local/bin/gunicorn -b 0.0.0.0:8000 app:app -w 2 --chdir /usr/local/src/FE-CChan
root 1164 1067 0 02:06 ? 00:00:00 /usr/bin/python /usr/local/bin/gunicorn -b 0.0.0.0:8000 app:app -w 2 --chdir /usr/local/src/FE-CChan
root 1203 1093 0 02:06 ? 00:00:01 /usr/bin/python3 /usr/bin/gunicorn -b 0.0.0.0:5000 app:app -w 4 --timeout 300000
root 1204 1093 0 02:06 ? 00:00:01 /usr/bin/python3 /usr/bin/gunicorn -b 0.0.0.0:5000 app:app -w 4 --timeout 300000
root 1205 1093 0 02:06 ? 00:00:01 /usr/bin/python3 /usr/bin/gunicorn -b 0.0.0.0:5000 app:app -w 4 --timeout 300000
root 1206 1093 0 02:06 ? 00:00:01 /usr/bin/python3 /usr/bin/gunicorn -b 0.0.0.0:5000 app:app -w 4 --timeout 300000
myshake 3612 3484 0 02:09 pts/0 00:00:00 grep --color=auto python
myshake@raspberryshake:/opt/settings/user $

When I kill process 1086, 1087 and 1093 the “shake-UDP-local.py” works correctly but then the connection to the server is no longer working and the local web page is no longer displayed.
I have attached the log files.
(BTW When I download the log files on my Windows PC using the local web site it shows: “Insecure download blocked”. Only when i quickly press the “keep” it will correctly download the .tar file.)

Please let me know how to get the “shake-UDP-local.py” program working again.

Many thanks and best regards,
Ruud van der Pluijm
Cayman Islands

RSH.R43F9.2025-12-30T15_44_18.logs.tar (889.5 KB)

Hello Ruud,

Yes, by interrupting those processes the main web page would not work anymore.

Would it be possible to see your shake-UDP-local.py program so I can check what is causing the conflict you have found?

Thank you.

Good afternoon,
Thanks for your reply.
The shake-UDP-local.py is “your” python program that comes with the OS in the /opt/settings/user folder and reads as follows:

import socket as s

port = 8888 # Port to bind to

hostipF = “/opt/settings/sys/ip.txt”
file = open(hostipF, ‘r’)
host = file.read().strip()
file.close()

HP = host + “:” + str(port)
print " Opening socket on (HOST:PORT)", HP

sock = s.socket(s.AF_INET, s.SOCK_DGRAM | s.SO_REUSEADDR)
sock.bind((host, port))

print "Waiting for data on (HOST:PORT) ", HP

while 1: # loop forever
data, addr = sock.recvfrom(1024) # wait to receive data
print data

Best regards,
Ruud van der Pluijm
Grand Cayman

Thank you ruudvdp,

I’ve asked the software team for more details. Below is the recommended way to address this issue:

  1. Create a new UDP entry that points to a different port of your choosing.
    Please note that there is a known UDP bug, which will be fixed in the upcoming v21.1 patch.
    You can do this in one of two ways:

    • Option #1: Follow the instructions provided here; or
    • Option #2: Manually create a new entry in the UDP configuration file by either:
      • modifying an existing UDP-data-streams.conf file in /opt/settings/user; or
      • if needed, using the UDP-data-streams.conf.tpl in the same folder, as described here.
  2. Update the Python script.
    Open shake-UDP-local.py, change the port number to match the one you configured in the UDP settings, and save the file. Once this is done, the code should work again.

Let me know if there are more issues.