We have some Python vision code that runs on the 2023 WPILibPi 2.1 image.
We run the Pi as a NetworkTable server and set the Shuffleboard server preference to be the Pi. We do this to do standalone dev and debug of vision code without a Rio.
After starting, the Shuffleboard displays all the NT entries and data for about 4 seconds, then the NT Outline Viewer stops displaying entries, all the fields out on the Shuffleboard layout display stop updating, then a second later, the Outline Viewer and the fields on the layout pop back up for another 4 seconds, and it just keeps cycling this way. When things stop updating for this 1 second outage, the lower right corner of the Shuffleboard says “not connected” then flips back to “connected”.
But this does not happen with the 2023 Shuffleboard 2.1. All the NT entries and fields on the layout display fine and it never drops the connection…all works fine.
The Pi code and WPILibPi image are the same; only thing changing is the Shuffleboard.
We have not yet tried Pi to Rio instead of Pi to 2024 Shuffleboard to see if this kind of issue exists in the normal (Pi to Rio) usage case.
We were thinking that this problem might be because of changes to NetworkTables for 2024, so we tried to update the NT package in the WPILibPi image. Pulled the 2024.2.1.2 pyntcore Wheels package from Artifactory:
https://wpilib.jfrog.io/ui/packages/pypi:%2F%2Fpyntcore/2024.2.1.2?name=ntcore&type=packages¤tTabb=xray
Tried to “pip install pyntcore-2024.2.1.2-cp39-cp39-linux_armv7l.whl”
Had to switch to a 32-bit WPILibPi image first
This Wheels install didn’t work:
ERROR: Could not find a version that satisfies the requirement robotpy-wpiutil==2024.2.1.2 (from pyntcore)
ERROR: No matching distribution found for robotpy-wpiutil==2024.2.1.2
So it maybe this looks to install only into a robotpy environment ??
Then went for hacking by hand copying the following:
libntcore.so
_ntcore.cpython-39-arm-linux-gnueabihf.so
types.py
_init_ntcore.py
pkgcfg.py
init.py
util.py
version.py
_logutil.py
into the right locations in /usr/local/lib/python3.9/dist-packages/ntcore in the WPILibPi file system.
But when the Pi vision code starts it hits an exception:
ImportError: cannot import name ‘GenericAlias’ from partially initialized module ‘types’ (most likely due to a circular import) (/home/pi/types.py)
Just wondering if anyone has seen this behavior. Or maybe someone has NT communication working just fine between WPILibPi and 2024 Shuffleboard and can offer some hints?
Thanks for your help!