PhotonVision install on Romi

I’ve installed PhotonVision on the Romi following these instructions. When I start the server I get the errors shown below.
I’ve tried placing the Romi filesystem in Writable mode but that didn’t help. I know that photonvision is started on reboot, so I stopped the running photoVision process before I ran the following command see what was going on. I also tried this on a Pi 3 and 4. Any help would be appreciated. I’ve spent about three hours trying to diagnose issue and I’m out of ideas. Thank you.

pi@wpilibpi(ro):~$ java -jar /opt/photonvision/photonvision.jar
[2021-11-27 15:15:22] [General - Main] [INFO] Logging initialized in debug mode.
[2021-11-27 15:15:22] [General - ShellExec] [DEBUG] Executing “id -u”
[2021-11-27 15:15:22] [General - ShellExec] [DEBUG] Got exit code 0
[2021-11-27 15:15:22] [General - Main] [INFO] Starting PhotonVision version v2022.1.1-beta-1 on Linux Raspbian
[2021-11-27 15:15:23] [Camera - PicamJNI] [ERROR] Couldn’t load libpicam shared object
java.lang.UnsatisfiedLinkError: /home/pi/lib/libpicam.so: libtbb.so.2: cannot open shared object file: No such file or directory
at java.base/java.lang.ClassLoader$NativeLibrary.load0(Native Method)
at java.base/java.lang.ClassLoader$NativeLibrary.load(ClassLoader.java:2430)
at java.base/java.lang.ClassLoader$NativeLibrary.loadLibrary(ClassLoader.java:2487)
at java.base/java.lang.ClassLoader.loadLibrary0(ClassLoader.java:2684)
at java.base/java.lang.ClassLoader.loadLibrary(ClassLoader.java:2617)
at java.base/java.lang.Runtime.load0(Runtime.java:767)
at java.base/java.lang.System.load(System.java:1831)
at org.photonvision.raspi.PicamJNI.forceLoad(PicamJNI.java:75)
at org.photonvision.Main.main(Main.java:176)
[2021-11-27 15:15:23] [General - Main] [INFO] Native libraries loaded.
[2021-11-27 15:15:23] [General - ConfigManager] [INFO] Loading settings…
[2021-11-27 15:15:23] [General - ConfigManager] [INFO] Hardware config does not exist! Loading defaults
[2021-11-27 15:15:23] [General - ConfigManager] [INFO] Hardware settings does not exist! Loading defaults
[2021-11-27 15:15:23] [General - ConfigManager] [INFO] Network config file does not exist! Loading defaults
[2021-11-27 15:15:23] [General - PigpioSocket] [ERROR] Failed to create or connect to Pigpio Daemon socket
[2021-11-27 15:15:23] [General - PigpioSocket] [ERROR] java.net.ConnectException: Connection refused (Connection refused)
at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
at java.base/java.net.Socket.connect(Socket.java:591)
at java.base/java.net.Socket.connect(Socket.java:540)
at java.base/java.net.Socket.(Socket.java:436)
at java.base/java.net.Socket.(Socket.java:213)
at org.photonvision.common.hardware.GPIO.pi.PigpioSocketLock.reconnect(PigpioSocketLock.java:46)
at org.photonvision.common.hardware.GPIO.pi.PigpioSocketLock.(PigpioSocketLock.java:42)
at org.photonvision.common.hardware.GPIO.pi.PigpioSocket.(PigpioSocket.java:51)
at org.photonvision.common.hardware.GPIO.pi.PigpioSocket.(PigpioSocket.java:39)
at org.photonvision.common.hardware.HardwareManager.(HardwareManager.java:71)
at org.photonvision.common.hardware.HardwareManager.getInstance(HardwareManager.java:59)
at org.photonvision.Main.main(Main.java:187)

[2021-11-27 15:15:23] [General - NetworkManager] [INFO] Setting DHCP with team team 0
[2021-11-27 15:15:23] [General - NetworkManager] [ERROR] Cannot manage network without root!
[2021-11-27 15:15:23] [General - NetworkTablesManager] [INFO] Starting NT Client
[2021-11-27 15:15:23] [General - NetworkTablesManager] [ERROR] [NetworkTablesManager] Could not connect to the robot! Will retry in the background…
terminate called after throwing an instance of ‘std::out_of_range’
what(): basic_string_view::substr: __pos (which is 4294967295) > this->size() (which is 28)
Aborted

1 Like

I ran into a very similar looking issue last week, but haven’t had a chance to debug it to root cause yet, hoping to get to it early next week.

I’m not 100% sure where the issue started, but moving back to 2021.1.7 or .6 might be a workaround for now?

The biggest thing to romi is that the image has to be in writable mode, otherwise the logging thread gets stuck right as photon starts up.

1 Like

You fixed that for version 2021.1.6 here :slight_smile:
Anyone running 2021.1.6 or later won’t have to be in writable mode.

As for the crash, it’s likely unrelated to the two exceptions above, but we’re unclear as to where it’s coming from at this time.

2 Likes

Bah, Off by two versions, thought it was only in .8 . You rock!

1 Like

Thanks for bringing this up! Looks like it’s a bug in WPILib. Tracked here: https://github.com/wpilibsuite/allwpilib/issues/3740

You can give the previous non-prerelease jar a try?

2 Likes

I tried release v2021-1.8 and the UI now works, thank you. You do have to put it into Writable mode in order to create a new pipeline. I was able to create the pipeline but couldn’t figure out how to get it to send data to the Network Tables. I had the java program running the Simulator so the NTs were up and running. Also, there’s a TARGET INFO panel but it doesn’t display anything from the pipeline. I suspect that may have something to do with no NT data getting sent.

I really like what I see so far. It makes setting up a vision based program much easier. I can’t wait to try out the PhotonLib stuff. Please let me know how to get it to send the target data. I couldn’t find anything in the documentation.
Thank you.

2 Likes

If the target info panel is empty it sounds like your pipeline isn’t seeing any targets. Have you gone through the steps here to tune a pipeline? Pipeline Tuning - PhotonVision Docs