tinwhisker / Owon-VDS1022

Run the Owon VDS1022 on OS X (And Linux?)
MIT License
28 stars 3 forks source link

Does this still work for debian? #6

Open adesca1 opened 6 years ago

adesca1 commented 6 years ago

I'm having problems to make it work in debian testing.

It fails with: ch.ntb.usb.USBException : LibusbJava.usb_set_configuration: Could not set config 1: Invalid or incomplete multibyte pr wide character.

nzasch commented 6 years ago

Hi in debian stretch 9.0 with:

libusb-0.1-4:amd64 version 2:0.1.12-30 libusb-java version 0.8+ztex20090101-7 cp /usr/lib/libusbJava.so plugins/ch.ntb.usb_0.5.9/libusbJava.so

giving "java -jar plugins/org.eclipse.equinox.launcher_1.3.0.v20120522-1813.jar" GUI shows up, but says "No available USB found" and console returns the following

as user: ch.ntb.usb.USBException: LibusbJava.usb_set_configuration: could not set config 1: Operation not permitted at com.owon.uppersoft.vds.core.usb.CDevice.claim_interface(CDevice.java:609) at com.owon.uppersoft.vds.core.usb.CDevice.simulateOpen(CDevice.java:868) at com.owon.uppersoft.vds.core.usb.CDevice.simulateOpen(CDevice.java:828) at com.owon.uppersoft.dso.source.usb.USBSourceManager._getUSBSource(USBSourceManager.java:129) at com.owon.uppersoft.vds.source.comm.PortFilterTiny.collectPorts(PortFilterTiny.java:46) at com.owon.uppersoft.dso.source.usb.USBSourceManager.refreshUSBPort(USBSourceManager.java:110) at com.owon.uppersoft.dso.source.comm.detect.USBLoopChecker.checkUSBDevice(USBLoopChecker.java:93) at com.owon.uppersoft.dso.source.comm.USBDaemonHelper.onNotConnecting(USBDaemonHelper.java:31) at com.owon.uppersoft.vds.machine.InfiniteDaemonTiny0.onNotConnecting(InfiniteDaemonTiny0.java:30) at com.owon.uppersoft.dso.source.comm.Flow.run(Flow.java:74) at com.owon.uppersoft.dso.global.ControlAppsTiny$1.run(ControlAppsTiny.java:37)

as root: ch.ntb.usb.USBException: LibusbJava.usb_set_configuration: could not set config 1: Timer expired at com.owon.uppersoft.vds.core.usb.CDevice.claim_interface(CDevice.java:609) at com.owon.uppersoft.vds.core.usb.CDevice.simulateOpen(CDevice.java:868) at com.owon.uppersoft.vds.core.usb.CDevice.simulateOpen(CDevice.java:828) at com.owon.uppersoft.dso.source.usb.USBSourceManager._getUSBSource(USBSourceManager.java:129) at com.owon.uppersoft.vds.source.comm.PortFilterTiny.collectPorts(PortFilterTiny.java:46) at com.owon.uppersoft.dso.source.usb.USBSourceManager.refreshUSBPort(USBSourceManager.java:110) at com.owon.uppersoft.dso.source.comm.detect.USBLoopChecker.checkUSBDevice(USBLoopChecker.java:93) at com.owon.uppersoft.dso.source.comm.USBDaemonHelper.onNotConnecting(USBDaemonHelper.java:31) at com.owon.uppersoft.vds.machine.InfiniteDaemonTiny0.onNotConnecting(InfiniteDaemonTiny0.java:30) at com.owon.uppersoft.dso.source.comm.Flow.run(Flow.java:74) at com.owon.uppersoft.dso.global.ControlAppsTiny$1.run(ControlAppsTiny.java:37)

do you have any clue? thanks for your hack! nzasch

milesfrain commented 5 years ago

I'm seeing the same ch.ntb.usb.USBException: LibusbJava.usb_set_configuration: could not set config 1: Operation not permitted error on Ubuntu 18.04. Couldn't figure out a workaround. I have two libusb versions. Not sure which one Java is picking up.

libusb-0.1-4/bionic,now 2:0.1.12-31 amd64 [installed,automatic]
libusb-1.0-0/bionic,now 2:1.0.21-2 amd64 [installed]
libusb-java/bionic,bionic,now 0.8+ztex20090101-7 all [installed]

Edit: There's some good activity on this thread regarding getting the VDS1022 working on Linux. https://www.eevblog.com/forum/testgear/owon-vds1022i-quick-teardown-(versus-the-hantek-6022be)/250/ Adding Sigrok compatibility seems like the most ideal long-term solution. There's an initial effort for that here: https://github.com/noopwafel/libsigrok/commits/master

greyspammer-tir commented 5 years ago

After a loooooooong odyssey where one issue lead to the next and the next, I finally got to the point where the software starts and seems to find the scope. But when you try to connect to it, the device gets ejected from my testing VM and the console prints a long exception. The key part being:

ch.ntb.usb.USBException: LibusbJava.usb_bulk_read: error submitting URB: No such device
    at com.owon.uppersoft.vds.core.usb.CDevice.readBulk(CDevice.java:376)

Which, as far as I was able to determine, is something that would have to be fixed in the source code for the program. Which we don't have.

In case someone wants to replicate my steps, here's what I did (with no guarantee that this list is accurate, there was so much stuff I kind of lost track at some point):

If anyone knows how to resolve that latest problem (error submitting URB: No such device), please let me know. I couldn't find anything that didn't involve changing the source.

tinwhisker commented 5 years ago

Thanks @greyspammer-tir

I haven't touched this for so long, but I will update the docs and possibly try to script it up too. Also, because I predominantly use Win/OS X, I don't get enough motivation to persevere! (I also think my Linux install is knackered, so that's not helping!)

The 'source' is fairly easy to derive, but I'll have to hunt for my base as I did a ton of clean-up. Naturally I can't release it here - I don't want Owon to get upset!

@milesfrain

I'm really looking forward to the patch @noopwafel is working on. Thanks for the tip!

milesfrain commented 5 years ago

Found a fix to the ch.ntb.usb.USBException: LibusbJava.usb_set_configuration: could not set config 1: Operation not permitted error. This can be resolved by creating the appropriate udev rules entry. The 10-owon file name is arbitrary, but there are some recommendations of the priority number to use.

sudo vi /etc/udev/rules.d/10-owon.rules

Then add.

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="5345", ATTRS{idProduct}=="1234", MODE="660", GROUP="plugdev"

The product and vendor IDs can be found with lsusb for the Owon PDS6062T Oscilloscope. You can double-check if you're in the plugdev group by running groups $USER and seeing if plugdev is listed. Then reload rules.

sudo udevadm control --reload-rules; and udevadm trigger

Then unplug/replug the device.

Now the error is:

ch.ntb.usb.USBException: LibusbJava.usb_set_configuration: could not set config 1: Protocol error

I'm not sure what to make of this new Protocol error. I have the sources decompiled with intellij and can step through the debugger, but I can't edit the .class files directly to try out some troubleshooting strategies. I also tried using jd-gui to extract all the .jar archives to .class files, but there are some some extra steps to get the project building again from the .class files that I still need to figure out. I don't think I'll be getting to that again any time soon, but could help get anyone else caught up to speed if they want to continue the debugging effort.

There's also the option to work on sigrok integration, which should be the ultimate goal. It just seems that that will be easiest if starting from a working Linux build with debugger support in order to figure out the communication protocol. It's also possible to determine the communication protocol with a combination of Wireshark and inspecting the decompiled source.

florentbr commented 5 years ago

I managed to get it working on Linux 64bits. I added the required libraries for libusb and I wrote a script to set the required privileges to access the USB device.

I also had to fix some issues in the Java source code:

For those interested, I made a light portable version without the JRE working on Windows and Linux:

greyspammer-tir commented 5 years ago

@florentbr: Thank you! I can confirm that this works on both my main machine and my laptop (each running Xubuntu 18.04).

reddn commented 5 years ago

Geez, I knew there was someone smart enough to make this cluster f of a program to work on linux.

adriancaretti commented 5 years ago

@florentbr Thanks, it working perfectly in Archlinux.

florentbr commented 5 years ago

I released a new version with a few fixes and improvements:

Owon_VDS_Portable_1.0.30_c2.zip Based on version 1.0.30 SHA1: b54da06e2cdcd2a0923ba7726bbc12a3e45ceff4

clanzotti commented 5 years ago

Hi,

thank you for the effort to make it working under Linux.

EDIT: I solved by uninstalling openJDK and installing standard Oracle JRE.


I'm having problem running it on xubuntu 64 bit (latest). See the picture below and the log after it:

Istantanea_2019-04-16_21-53-59

Log:

Check USB permissions ... Check Java Runtime ... Launch OWON application ... java.lang.reflect.InvocationTargetException at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1367) at java.desktop/java.awt.EventQueue.invokeAndWait(EventQueue.java:1342) at java.desktop/javax.swing.SwingUtilities.invokeAndWait(SwingUtilities.java:1480) at com.owon.uppersoft.dso.global.WorkBenchTiny.(WorkBenchTiny.java:124) at com.owon.vds.tiny.Main$1.createWorkBench(Main.java:14) at com.owon.uppersoft.dso.global.Platform.launch(Platform.java:22) at com.owon.vds.tiny.Main.main(Main.java:10) Caused by: java.lang.NoClassDefFoundError: com/sun/java/swing/plaf/nimbus/NimbusLookAndFeel at com.owon.uppersoft.vds.util.ui.UIUtil.modifylaf(UIUtil.java:29) at com.owon.uppersoft.vds.util.ui.UIUtil.modifyui(UIUtil.java:43) at com.owon.uppersoft.dso.global.WorkBenchTiny.showMainFrm(WorkBenchTiny.java:147) at com.owon.uppersoft.dso.global.WorkBenchTiny.access$000(WorkBenchTiny.java:30) at com.owon.uppersoft.dso.global.WorkBenchTiny$2.run(WorkBenchTiny.java:128) at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:303) at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:770) at java.desktop/java.awt.EventQueue.access$600(EventQueue.java:97) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:721) at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:715) at java.base/java.security.AccessController.doPrivileged(Native Method) at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:87) at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:740) at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203) at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124) at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109) at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101) at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90) Caused by: java.lang.ClassNotFoundException: com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:583) at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:190) at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:499) ... 19 more java.lang.NullPointerException at com.owon.uppersoft.dso.source.comm.InfiniteDaemon.(InfiniteDaemon.java:92) at com.owon.uppersoft.vds.machine.InfiniteDaemonTiny0.(InfiniteDaemonTiny0.java:16) at com.owon.uppersoft.dso.global.ControlAppsTiny$1.(ControlAppsTiny.java:30) at com.owon.uppersoft.dso.global.ControlAppsTiny.createInfiniteDaemon(ControlAppsTiny.java:30) at com.owon.uppersoft.dso.global.ControlApps.(ControlApps.java:30) at com.owon.uppersoft.dso.global.ControlAppsTiny.(ControlAppsTiny.java:21) at com.owon.uppersoft.dso.global.WorkBenchTiny.(WorkBenchTiny.java:141) at com.owon.vds.tiny.Main$1.createWorkBench(Main.java:14) at com.owon.uppersoft.dso.global.Platform.launch(Platform.java:22) at com.owon.vds.tiny.Main.main(Main.java:10)

Any hint about it? It works without problems on MacOS.

Thanks.

tinwhisker commented 5 years ago

Nice one guys!

Clanzotti - what version of openJDK? NimbusLookAndFeel should be in the JDK, but perhaps it's playing foul?

Note to self: Test patching out Nimbus - UIManager.setLookAndFeel(UIManager.getSystemLookAndFeelClassName())

clanzotti commented 5 years ago

Hi tinwhisker,

openJDK 8.

Also, I just want to let you note that the Owon_VDS_Portable_1.0.30_c2 does not work even with the Oracle Java. In practice I can get it running but the scope signal is totally messed up and no measure can be made. I had to switch to the previous release that works ok.

I'll post a screenshot later today.

Thanks for your effort.

tinwhisker commented 5 years ago

I have not tried Florentbr's builds. Have you tried his prior release?

clanzotti commented 5 years ago

Hi TinWhisker,

yes, his prior version does work, is the new one that does not.

Il 23/04/2019 15:01, TinWhisker (Daniel) ha scritto:

I have not tried Florentbr's builds. Have you tried his prior release?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tinwhisker/Owon-VDS1022/issues/6#issuecomment-485792647, or mute the thread https://github.com/notifications/unsubscribe-auth/AE4KIKS4M722A3LYPXUAE4TPR4CBPANCNFSM4E6AXAKA.

iker190 commented 5 years ago

Owon_VDS_Portable_1.0.30_c3 and java-8-openjdk is working for me on manjaro. It didn't work on java-11-openjdk, though. Thank you for your work Florentbr!

blazini36 commented 4 years ago

I previously had the portable version working with Mint18. I just built a new PC and running Mint19.1 can't get it going. With openJDK-8 or Oracle JDK-8 I can get the program so start and initialize the scope but I get nothing from either channel of the scope.

florentbr commented 4 years ago

The application works with Java 8 only. I released a new customized version with installers and with a few improvements:

OWON-VDS1022-1.0.30-cf4.zip Based on version 1.0.30 SHA1: ebe9d21542cfdd7460d9f1fff5e2f872f4322662

Changes: Added some scripts to install the app on Linux/Windows/Mac Added shortcuts: single trigger, voltage offset, trigger level, coupling, inversion, reset ... Fixed a few issues preventing the app from launching on some Linux disto.

blazini36 commented 4 years ago

@ florentbr, Seems to be working well again, thanks. Is you're version posted anywhere else? I would think there are plenty of people that would probably like to get ahold of it but I've only ever seen it here, luckily I happened across it.

X3msnake commented 4 years ago

@florentbr You should add these files to a release in your fork of this project

bleprotocols commented 4 years ago

I'm having problems on gentoo ( x86_64 ) - it's not detecting the device in the application but I keep getting a "machineCode: 2" line in the console log. If it matters, I'm using this device: http://www.owon.com.hk/products_owon_pen-type_pc_oscilloscope

Any help would be appreciated :)

florentbr commented 4 years ago

@bleprotocols, the software for the Pen-Type device is different from the one for the VDS1022 device. To make it work you'll have to modify the release specific to your device.

bleprotocols commented 4 years ago

@florentbr Suspected as much :) looks like it has mostly the same issues though - will try patching it in the same way you outlined and see how it goes.

bleprotocols commented 4 years ago

@florentbr so far with some patching I got it to start and recognize the scope, but then the UI hangs..

bleprotocols commented 4 years ago

@florentbr https://github.com/bleprotocols/owon_rds1021_linux/ Got the pen type scope working under linux. Thank you to everyone here for helping me find the way :+1:

florentbr commented 4 years ago

As suggested, I moved the release to a fork:
https://github.com/florentbr/Owon-VDS1022

X3msnake commented 4 years ago

@florentbr Greetings Master

Tried using the install on Puppy Linux, but it has it's own package manager. Could you provide a manual how to.

Went as far as to install JRE1.8.0.05, this being a JAVA program i'm guessing it is a matter of issueing a command like Java -jar someprogram.jre

Tried running all from inside jar folder and most say there is no manifest.

ch.ntb.usb-0.5.9.jar opens up a JAVA USB View window jxl-2.6.6.jar rolls a list of commands like: Demo [-unicode] [-csv] [-hide] excelfile

florentbr commented 4 years ago

@X3msnake, the Java command is:

/usr/lib/jvm/java-8-*/jre/bin/java \
  -Djava.library.path='lib' \
  -Duser.dir="$HOME/.owon-vds-tiny" \
  -cp 'jar/*' \
  'com.owon.vds.tiny.Main'

I tried to launch it on Puppy, but some dialogs crash when the app sets them to transparent. I'll fix it in the next release with an installer for Puppy. Please consider moving this issue to the fork.

X3msnake commented 4 years ago

you need to enable issues on the fork

No dia sexta-feira, 11 de outubro de 2019, Florent notifications@github.com escreveu:

@X3msnake https://github.com/X3msnake, the Java command is:

/usr/lib/jvm/java-8-/jre/bin/java \ -Djava.library.path='lib' \ -Duser.dir="$HOME/.owon-vds-tiny" \ -cp 'jar/' \ 'com.owon.vds.tiny.Main'

I tried to launch it on Puppy, but some dialogs crash when the app sets them to transparent. I'll fix it in the next release with an installer for Puppy. Please consider moving this issue to the fork.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/tinwhisker/Owon-VDS1022/issues/6?email_source=notifications&email_token=ACUR56RSRMWOYBK2GELE7CLQOCQIHA5CNFSM4E6AXAKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEBAO5CY#issuecomment-541126283, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACUR56QNIMN5TZJ4NMD4GKDQOCQIHANCNFSM4E6AXAKA .

-- Com os melhores cumprimentos, Vinicius Silva

tinwhisker commented 4 years ago

@florentbr - as the Aussie's would say: "A Beauty".

Used the latest (cf6) release on Ubuntu 19.04 - pretty much works OOTB!*

I have udev rules already from prior tinkering, so maybe unfair advantage? Also, no shortcut, so need to call 'owon-vds-tiny' from terminal - but its sudo-less, which is nice.