brainstorm / openpnp-kiosk

Auto-provisioned OpenPnP (kiosk mode)
7 stars 1 forks source link

Install from script for RPi #4

Closed dronecz closed 2 years ago

dronecz commented 4 years ago

Hi, with right version of OS, I tried install OpenPnP, but it does not run.

I used these commands from script, but I can not install few packages:

libopenblas0
libopenblas0-pthread
libopenblas64-0
libopenblas64-0-pthread
liblapack64-3
liblapacke64

Working commands:

sudo apt install maven ant libjna-jni libtiff5 libjpeg62-turbo libpng16-16 libpng-sixlegs-java libatlas3-base libgstreamer1.0-0 libgstreamer-plugins-base1.0-dev libgstreamer-gl1.0-0 libgstreamer-plugins-bad1.0-0 libavcodec-extra58 libavformat58 libswscale5 libv4l-0 libxvidcore4 libx264-155 python3-numpy liblapack3  liblapacke  libmpfr6 libmpfi0
wget https://corretto.aws/downloads/latest/amazon-corretto-11-aarch64-linux-jdk.deb
sudo dpkg -i *.deb
nano .bashrc (to setup env. variables)
sudo mkdir /usr/src/app
git clone --depth 1 https://github.com/CCHS-Melbourne/openpnp.git
cd openpnp/
sudo mvn -DskipTests install
cd
git clone https://github.com/CCHS-Melbourne/openpnp-kiosk
cd openpnp-kiosk/
sudo cp objs/libopencv_java342.so /usr/src/app
sudo cp objs/libopenpnp-capture.so /usr/src/app
sudo rm openpnp/target/lib/openpnp-capture-java-0.0.17.jar
sudo cp openpnp-kiosk/objs/openpnp-capture-java-0.0.17.jar openpnp/target/lib
sudo cp openpnp-kiosk/objs/libjnidispatch.so /usr/lib/aarch64-linux-gnu/jni/libjnidispatch.so
sudo ln -sf /usr/lib/aarch64-linux-gnu/jni/libjnidispatch.system.so /usr/lib/aarch64-linux-gnu/jni/libjnidispatch.so
sudo reboot

Here are environmental variables:

pi@raspberrypi:~ $ echo $JAVA_HOME
/usr/lib/jvm/java-11-amazon-corretto
pi@raspberrypi:~ $ echo $LD_LIBRARY_PATH
/usr/src/app:/usr/lib/aarch64-linux-gnu/jni
pi@raspberrypi:~ $ echo $CLASSPATH
/usr/src/app

Here is log from OpenPnP:

pi@raspberrypi: cat .openpnp2/log/OpenPnP.log 

2020-05-28 15:57:40.599 SystemLogger ERROR: kvÄ› 28, 2020 3:57:40 ODP. java.util.prefs.FileSystemPreferences$1 run
INFO: Created user preferences directory.
2020-05-28 15:57:47.802 Configuration INFO: No packages.xml found in configuration directory, loading defaults.
2020-05-28 15:57:48.422 Configuration INFO: No parts.xml found in configuration directory, loading defaults.
2020-05-28 15:57:48.499 Configuration INFO: No machine.xml found in configuration directory, loading defaults.
2020-05-28 15:57:48.651 SystemLogger ERROR: java.lang.Exception: Error while reading machine.xml (null)
2020-05-28 15:57:48.653 SystemLogger ERROR:     at org.openpnp.model.Configuration.load(Configuration.java:287)
2020-05-28 15:57:48.655 SystemLogger ERROR:     at org.openpnp.gui.MainFrame.<init>(MainFrame.java:641)
2020-05-28 15:57:48.657 SystemLogger ERROR:     at org.openpnp.Main$1.run(Main.java:152)
2020-05-28 15:57:48.659 SystemLogger ERROR:     at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:313)
2020-05-28 15:57:48.662 SystemLogger ERROR:     at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770)
2020-05-28 15:57:48.665 SystemLogger ERROR:     at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721)
2020-05-28 15:57:48.668 SystemLogger ERROR:     at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715)
2020-05-28 15:57:48.670 SystemLogger ERROR:     at java.base/java.security.AccessController.doPrivileged(Native Method)
2020-05-28 15:57:48.673 SystemLogger ERROR:     at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:85)
2020-05-28 15:57:48.676 SystemLogger ERROR:     at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740)
2020-05-28 15:57:48.678 SystemLogger ERROR:     at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
2020-05-28 15:57:48.681 SystemLogger ERROR:     at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
2020-05-28 15:57:48.684 SystemLogger ERROR:     at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
2020-05-28 15:57:48.687 SystemLogger ERROR:     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
2020-05-28 15:57:48.690 SystemLogger ERROR:     at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
2020-05-28 15:57:48.692 SystemLogger ERROR:     at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
2020-05-28 15:57:48.698 SystemLogger ERROR: Caused by: java.lang.reflect.InvocationTargetException
2020-05-28 15:57:48.701 SystemLogger ERROR:     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
2020-05-28 15:57:48.703 SystemLogger ERROR:     at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
2020-05-28 15:57:48.707 SystemLogger ERROR:     at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
2020-05-28 15:57:48.709 SystemLogger ERROR:     at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
2020-05-28 15:57:48.711 SystemLogger ERROR:     at org.simpleframework.xml.core.InstanceFactory.getObject(InstanceFactory.java:100)
2020-05-28 15:57:48.714 SystemLogger ERROR:     at org.simpleframework.xml.core.InstanceFactory$ClassInstance.getInstance(InstanceFactory.java:233)
2020-05-28 15:57:48.716 SystemLogger ERROR:     at org.simpleframework.xml.core.ObjectInstance.getInstance(ObjectInstance.java:95)
2020-05-28 15:57:48.718 SystemLogger ERROR:     at org.simpleframework.xml.core.ObjectInstance.getInstance(ObjectInstance.java:76)
2020-05-28 15:57:48.719 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite$Builder.read(Composite.java:1376)
2020-05-28 15:57:48.721 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.read(Composite.java:201)
2020-05-28 15:57:48.723 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.read(Composite.java:148)
2020-05-28 15:57:48.725 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.readVariable(Composite.java:623)
2020-05-28 15:57:48.727 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.readInstance(Composite.java:573)
2020-05-28 15:57:48.728 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.readUnion(Composite.java:549)
2020-05-28 15:57:48.729 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.readElement(Composite.java:532)
2020-05-28 15:57:48.731 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.readElements(Composite.java:445)
2020-05-28 15:57:48.733 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.access$400(Composite.java:59)
2020-05-28 15:57:48.734 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite$Builder.read(Composite.java:1383)
2020-05-28 15:57:48.736 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.read(Composite.java:201)
2020-05-28 15:57:48.738 SystemLogger ERROR:     at org.simpleframework.xml.core.Composite.read(Composite.java:148)
2020-05-28 15:57:48.740 SystemLogger ERROR:     at org.simpleframework.xml.core.Traverser.read(Traverser.java:92)
2020-05-28 15:57:48.742 SystemLogger ERROR:     at org.simpleframework.xml.core.Persister.read(Persister.java:625)
2020-05-28 15:57:48.744 SystemLogger ERROR:     at org.simpleframework.xml.core.Persister.read(Persister.java:606)
2020-05-28 15:57:48.746 SystemLogger ERROR:     at org.simpleframework.xml.core.Persister.read(Persister.java:584)
2020-05-28 15:57:48.748 SystemLogger ERROR:     at org.simpleframework.xml.core.Persister.read(Persister.java:543)
2020-05-28 15:57:48.749 SystemLogger ERROR:     at org.simpleframework.xml.core.Persister.read(Persister.java:521)
2020-05-28 15:57:48.751 SystemLogger ERROR:     at org.simpleframework.xml.core.Persister.read(Persister.java:426)
2020-05-28 15:57:48.752 SystemLogger ERROR:     at org.openpnp.model.Configuration.loadMachine(Configuration.java:416)
2020-05-28 15:57:48.754 SystemLogger ERROR:     at org.openpnp.model.Configuration.load(Configuration.java:280)
2020-05-28 15:57:48.756 SystemLogger ERROR:     ... 15 more
2020-05-28 15:57:48.758 SystemLogger ERROR: Caused by: java.lang.ExceptionInInitializerError
2020-05-28 15:57:48.760 SystemLogger ERROR:     at nu.pattern.OpenCV$SharedLoader.getInstance(OpenCV.java:232)
2020-05-28 15:57:48.764 SystemLogger ERROR:     at nu.pattern.OpenCV.loadShared(OpenCV.java:181)
2020-05-28 15:57:48.766 SystemLogger ERROR:     at org.openpnp.vision.pipeline.CvPipeline.<clinit>(CvPipeline.java:49)
2020-05-28 15:57:48.768 SystemLogger ERROR:     at org.openpnp.machine.reference.vision.ReferenceFiducialLocator.createDefaultPipeline(ReferenceFiducialLocator.java:481)
2020-05-28 15:57:48.770 SystemLogger ERROR:     at org.openpnp.machine.reference.vision.ReferenceFiducialLocator.<init>(ReferenceFiducialLocator.java:59)
2020-05-28 15:57:48.773 SystemLogger ERROR:     at org.openpnp.machine.reference.ReferenceMachine.<init>(ReferenceMachine.java:86)
2020-05-28 15:57:48.774 SystemLogger ERROR:     ... 44 more
2020-05-28 15:57:48.776 SystemLogger ERROR: Caused by: java.lang.UnsupportedOperationException: Architecture "aarch64" is not supported.
2020-05-28 15:57:48.778 SystemLogger ERROR:     at nu.pattern.OpenCV$Arch.getCurrent(OpenCV.java:91)
2020-05-28 15:57:48.780 SystemLogger ERROR:     at nu.pattern.OpenCV.extractNativeBinary(OpenCV.java:316)
2020-05-28 15:57:48.782 SystemLogger ERROR:     at nu.pattern.OpenCV.access$100(OpenCV.java:22)
2020-05-28 15:57:48.784 SystemLogger ERROR:     at nu.pattern.OpenCV$SharedLoader.<init>(OpenCV.java:204)
2020-05-28 15:57:48.785 SystemLogger ERROR:     at nu.pattern.OpenCV$SharedLoader.<init>(OpenCV.java:187)
2020-05-28 15:57:48.787 SystemLogger ERROR:     at nu.pattern.OpenCV$SharedLoader$Holder.<clinit>(OpenCV.java:228)
2020-05-28 15:57:48.788 SystemLogger ERROR:     ... 50 more

Many thanks for help. 🙂

brainstorm commented 4 years ago

What does uname -a say?

That's one of the reasons why I packaged on a docker container, some packages get renamed/deprecated on each release, so now you'll have to track them and fix some divergences :-S

dronecz commented 4 years ago

My uname -am says: Linux raspberrypi 5.4.42-v8+ #1319 SMP PREEMPT Wed May 20 14:18:56 BST 2020 aarch64 GNU/Linux I do not know if I can help, but I can try, if I will know what for to look 😉 .

brainstorm commented 4 years ago

Here's something I would look into: I suspect that /usr/src/app is not where you are putting the .so objects, perhaps? Hard to tell, I might try at some point but hard to tell/debug without building it myself from scratch with that distribution you are using, unfortunately.

OTOH, now that you managed to have the Balena/docker setup up and running, I would leverage that and try to fix the i.e cameras not being detected? For that I would google something like "docker usb passthrough" and see what others are doing to have USB within the docker container? Or this:

https://forums.balena.io/t/docker-container-cannot-access-dynamically-plugged-usb-devices/4277

brainstorm commented 4 years ago

I also went through those kind of errors you are seeing in the past, see my README.md commits history, I kept pasting the error messages and current status in the README.md until I got it working.