bdbcat / oesenc_pi

GNU General Public License v2.0
10 stars 17 forks source link

Flatpak: USB dongle not detected #86

Closed SanderV4n closed 4 years ago

SanderV4n commented 4 years ago

Hi,

I am running OpenCPN from Flatpak on my Fedora 31 machine, plugin version 4.2.6 installed from the plugin manager. When I try to generate a USB key system ID File, I get a error message:

image The dongle is visible via lsusb: Bus 001 Device 002: ID 1547:1000 SG Intec Ltd & Co KG SG-Lock[U2]

In the OpenCPN.log file I see this error: oesenc_pi.cpp:3961 sh: ip: command not found

Anything I can try to get this working?

bdbcat commented 4 years ago

Please check to logfile, looking for something like this:

MESSAGE oesenc_pi.cpp:739 Path to oeserverd is: /home/dsr/.var/app/org.opencpn.OpenCPN/bin/oeserverd
19:59:53.196 MESSAGE oesenc_pi.cpp:3846 IsDongleAvailable()::oeserverd execution results:
19:59:53.196 MESSAGE oesenc_pi.cpp:3849 1
19:59:53.196 MESSAGE oesenc_pi.cpp:742 Dongle detected

From a CLI, try:

/home/{YOUR USER NAME}/.var/app/org.opencpn.OpenCPN/bin/oeserverd -a Dave

SanderV4n commented 4 years ago

Hi Dave!

It doesn't print to much: .var/app/org.opencpn.OpenCPN/bin/oeserverd -a oeserverd Version 1.14

bdbcat commented 4 years ago

That is the correct response.

Did you find the log entries shown above?

SanderV4n commented 4 years ago

Sorry missed that part, found it, not to helpful:

16:39:24.313 MESSAGE pluginmanager.cpp:1094 Checking plugin candidate: /home/sander/.var/app/org.opencpn.OpenCPN/lib/opencpn/liboesenc_pi.so 16:39:24.313 MESSAGE pluginmanager.cpp:2122 PlugInManager: Loading PlugIn: /home/sander/.var/app/org.opencpn.OpenCPN/lib/opencpn/liboesenc_pi.so 16:39:24.319 INFO pluginmanager.cpp:2293 PlugInManager: /home/sander/.var/app/org.opencpn.OpenCPN/lib/opencpn/liboesenc_pi.so 16:39:24.320 MESSAGE oesenc_pi.cpp:739 Path to oeserverd is: /home/sander/.var/app/org.opencpn.OpenCPN/bin/oeserverd 16:39:27.456 MESSAGE oesenc_pi.cpp:3846 IsDongleAvailable()::oeserverd execution results: 16:39:27.456 MESSAGE oesenc_pi.cpp:3849 0 16:39:27.456 MESSAGE oesenc_pi.cpp:744 No Dongle detected 16:39:27.629 MESSAGE oesenc_pi.cpp:955 oesenc_pi: Calculated pix/mm = 3.77754 16:39:27.638 MESSAGE oesenc_pi.cpp:3066 oeSENC_PI: OpenGL-> Minimum cartographic line width: 1.0 16:39:27.687 MESSAGE OCPNPlatform.cpp:1046 Loading catalog for: opencpn-oesenc_pi 16:39:27.710 MESSAGE oesenc_pi.cpp:955 oesenc_pi: Calculated pix/mm = 3.77754 16:39:27.781 MESSAGE OCPNPlatform.cpp:1046 Loading catalog for: opencpn-oesenc_pi

So "No Dongle detected"

bdbcat commented 4 years ago

So, indeed, you dongle is not found. "16:39:27.456 MESSAGE oesenc_pi.cpp:744 No Dongle detected"

Try these cli commands:

/home/{YOUR USER NAME}/.var/app/org.opencpn.OpenCPN/bin/oeserverd -t

/home/{YOUR USER NAME}/.var/app/org.opencpn.OpenCPN/bin/oeserverd -s

These commands will test for the dongle directly.

SanderV4n commented 4 years ago

Humm... I updated to the latest flatpack version, and updated the plug-in to the latest version. Now I am not able to load the plug-in, and files are in the wrong location on disk: .var/app/org.opencpn.OpenCPN/unknown-prefix/bin/oeserverd

.var/app/org.opencpn.OpenCPN/unknown-prefix/bin/oeserverd -t 0

.var/app/org.opencpn.OpenCPN/unknown-prefix/bin/oeserverd -s 0

bdbcat commented 4 years ago

This is WIP. Such is Alpha testing.... Please stand by. Dave

bdbcat commented 4 years ago

Please try: ls -la .var/app/org.opencpn.OpenCPN/unknown-prefix/lib

SanderV4n commented 4 years ago

ls -la .var/app/org.opencpn.OpenCPN/unknown-prefix/lib total 88 drwxr-xr-x. 3 sander sander 4096 Apr 19 17:04 . drwxr-xr-x. 5 sander sander 4096 Apr 19 17:04 .. -rwxr-xr-x. 1 sander sander 37586 Jan 1 1970 libsgllnx64-2.29.02.so -rwxr-xr-x. 1 sander sander 34824 Jan 1 1970 libusb-0.1.so.4 drwxr-xr-x. 2 sander sander 4096 Apr 19 17:04 opencpn

Just noticing, I have no problem with some additional effort to get to a working state ;-)

bdbcat commented 4 years ago

Carstijn... The OpenCPN flatpak build is broken just now. We will need a day to rebuild and re-sync the flatpak repos. Please stand by.

SanderV4n commented 4 years ago

So the flatpak build and plugin seem to be working order again: var/app/org.opencpn.OpenCPN/bin/oeserverd -t 0

.var/app/org.opencpn.OpenCPN/bin/oeserverd -s 0

ls -la .var/app/org.opencpn.OpenCPN/lib/ total 88 drwxr-xr-x. 3 sander sander 4096 Jan 1 1970 . drwxr-xr-x. 9 sander sander 4096 Apr 21 08:34 .. -rwxr-xr-x. 1 sander sander 37586 Jan 1 1970 libsgllnx64-2.29.02.so -rwxr-xr-x. 1 sander sander 34824 Jan 1 1970 libusb-0.1.so.4 drwxr-xr-x. 2 sander sander 4096 Jan 1 1970 opencpn

hreuver0183 commented 4 years ago

The OpenCPN manual was updated today. There is a new version of OpenCPN (still beta), and a step-by-step method to check the USB dongle is (for now) included in the flatpak installation.

Could you try if the SG lock / USB dongle troubleshooting works for you? (Most of it follows the commands mentioned above).

I think for your answer you can skip straight to the part of the 98-sglock.rules. https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:opencpn_user_manual:getting_started:opencpn_installation:flatpak

Feedback will be appreciated.

Since the link does not seem to work: Try adding a file /etc/udev/rules/98-sglock.rules (as root or with sudo): ATTRS{idVendor}=="1547", ATTRS{idProduct}=="1000", MODE="666"

SanderV4n commented 4 years ago

Hi!

The udev rule did the trick.

I guess a "sudo udevadm trigger" should be added to the manual to reload the udev rules.

hreuver0183 commented 4 years ago

Since USB is supposed to be hot-pluggable it is easier to tell people to remove and reinsert the dongle.

Most people who take the hint a command is sufficient don't need the manual to change the permissions in the first place ;-)

But with this I think this issue can be closed.