Hello,
I am having some trouble
getting p4p working reliably in a cloud based
network where UDP broadcasts are not possible. I
am only using a single VM, running both the IOC
and the p4p client on the same VM. The setup works
well with Phoebus, archiver, and
pvget/pvput/pvmonitor from EPICS base, just not
with p4p...
I am running an EPICS IOC with
PVXS and QSRV2 and just a few PVs. The IOC is
running with the following EPICS environment to
work around the fact that we can't use broadcast
(the 10.0.0.12 is the VMs IP on a private network
with archiver, etc.):
user02@uservm02:~$
env | grep -i pva | sort
EPICS_PVAS_AUTO_BEACON_ADDR_LIST=NO
EPICS_PVAS_BEACON_ADDR_LIST=10.0.0.12
EPICS_PVAS_BROADCAST_PORT=5076
EPICS_PVAS_SERVER_PORT=5075
EPICS_PVA_ADDR_LIST=10.0.0.12
EPICS_PVA_AUTO_ADDR_LIST=NO
EPICS_PVA_BROADCAST_PORT=5076
Then on for the p4p client, I
am running with this environment:
(epics-training-env)
user02@uservm02:~$ env | grep -i pva | sort
EPICS_PVAS_AUTO_BEACON_ADDR_LIST=NO
EPICS_PVAS_BEACON_ADDR_LIST=10.0.0.12
EPICS_PVA_ADDR_LIST=10.0.0.12
EPICS_PVA_AUTO_ADDR_LIST=NO
EPICS_PVA_BROADCAST_PORT=5076
(I know the PVAS variables are
not needed on the client. I have been tinkering a
lot with these today)
My python script with p4p looks
like this:
(epics-training-env)
user02@uservm02:~$ cat small.py
from
p4p.client.thread import Context
ctxt
= Context('pva')
print(ctxt.get('user02:va:01:gauge:pressure'))
ctxt.close()
Sometimes the script will run
successfully once or twice, but then it will
mostly timeout with this error dump:
(epics-training-env)
user02@uservm02:~$ python small.py
Traceback
(most recent call last):
File
"/opt/epics/python/.venv/lib/python3.12/site-packages/p4p/client/thread.py",
line 264, in get
value,
i = done.get(timeout=timeout)
^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/usr/lib/python3.12/queue.py", line 179, in
get
raise
Empty
_queue.Empty
During
handling of the above exception, another
exception occurred:
Traceback
(most recent call last):
File
"/home/user02/small.py", line 3, in
<module>
print(ctxt.get('user02:va:01:gauge:pressure'))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File
"/opt/epics/python/.venv/lib/python3.12/site-packages/p4p/client/thread.py",
line 268, in get
raise
TimeoutError()
TimeoutError
I am on an Ubuntu 24.04 VM.
Using system python 3.12.3, p4p==4.2.2
Hope someone can point out my
silly mistake here...