PicoScope run under LINUX?

Post your Linux discussions here
tfielden
Newbie
Posts: 0
Joined: Tue Dec 15, 2009 4:16 am

Re: PicoScope run under LINUX?

Post by tfielden »

Just got my new PicoScope 2203 and have downloaded the linux driver software and followed all the instructions. There wasn't a single list, but scattered instructions so I thought it would be helpful to list them here. Unfortunately the device fails to connect so I need some troubleshooting help.

Here's the list of things that need to happen to get the PicoScope driver to run under linux (Ubuntu 9.10),

Linux Drivers:
To install the RPM,
%> sudo apt-get install alien
%> sudo alien -k .RPM
%> sudo dpkg -i .deb

.rules and .conf (from libps2000-2.0.7.7-1.i386/)
%> sudo cp 95-pico.rules /etc/udev/rules.d/
%> sudo cp PicoScope.conf /etc/ld.so.conf.d/
%> sudo ldconfig

Users and Groups
%> sudo addgroup pico
%> sudo usermod -a -G pico tomf

One more preparation...
%> gcc -lps2000 PS2000con.c -oPS2000con

:::Plug in PicoScope and then...:::
%> usbtest
%> ./PS2000con

The usbtest runs just fine, but PS2000con fails with the ps2000_open_unit() function returning 0 as the handle to the device.

Are there any troubleshooting tools or hints? There's no source code, I understand, but then there appears to be no hope either.


Thanks,

Tom Fielden

wayoda
Active User
Active User
Posts: 11
Joined: Fri Aug 01, 2008 9:49 am
Location: Wuppertal/Germany

Re: PicoScope run under LINUX?

Post by wayoda »

Hi,
I have a PicpoScope2104 running on KUbuntu 9.10 so it should be possible for you too.

I sugggest you first check wether your system recognizes your device.

Open a console-window and plug you scope in. The look at the output of the 'dmesg'-command. The very last lines should look similar to these here (which is from my 2104)

Code: Select all

usb 1-6: new high speed USB device using ehci_hcd and address 11
usb 1-6: configuration #1 chosen from 1 choice
I installed the drivers with Alien just like you did. But then I copied the library files

Code: Select all

libps2000.so.2.0.7                       
libps2000.so.2                           
libps2000.la                             
libps2000.so       
directly into /usr/lib and ran 'sudo ldconfig' to update the system.

Since I'm the only user on my machine I also skipped the group permission settings in the udev.rules.
I simply grant the right to use the scope to everyone. Here is my udev-rules.file in /etc/udev/rules.d/picotech.rules

Code: Select all

BUS=="usb", ATTRS{idVendor}=="0ce9",ATTRS{idProduct}=="1007", MODE="666"
It is a bit different from the rules-file in the driver package:

You would have to set the ATTRS{idProduct}=="????" argument to the productID of your PS2203.
When you know to which USB-port your device was connected you can view it with

Code: Select all

less /sys/bus/usb/devices/1-6/idProduct
You just have to find out the port to which the scope is connected. Compare the output of 'ls -all /sys/bus/usb/devices' before and after plugging the scope in. The new file that is created will be the link to your scope.

I set the MODE argument so that every user can use the device.

Running 'usbtest' prints this:

Code: Select all

./pico/downloads/libps2000-2.0.7.7-1.i386/usbtest

****************************************************************************
*                  Pico Technology Linux USB Diagnostics                   *
****************************************************************************

This script looks for Pico USB devices connected to your computer
and checks whether you are able to access them. If your user account
does not have permission to access the devices, the script will try
to suggest how to correct this for your particular Linux installation.

Press enter to continue...

Getting user and group information...
 - You are running this script as wayoda.
 - You are in the following groups:
     wayoda dialout users admin

Please connect your Pico USB device and press enter to continue...

Pico USB device found: /dev/bus/usb/001/010

 - It belongs to root (which is not you) who has permissions rw-
 - The members of group root (which you are not in) have permissions rw-
 - Everyone else (this is you) has permissions rw-
 - You can write to this device and so will be able to use it.

   Pico USB device not found. Please try again
Do you get similar results (as a non-root user) in these steps?

Eberhard

tfielden
Newbie
Posts: 0
Joined: Tue Dec 15, 2009 4:16 am

Re: PicoScope run under LINUX?

Post by tfielden »

Thanks for the suggestions, but no change. I get,

./usbtest:
Pico USB device found: /dev/bus/usb/001/005

- It belongs to root (which is not you) who has permissions rw-
- The members of group root (which you are not in) have permissions rw-
- Everyone else (this is you) has permissions rw-
- You can write to this device and so will be able to use it.

-and-

./PS2000con:
Opening the device...
Handle: 0
Unable to open device
Unit Not Opened
Error Code: 3


as before.

%> dmesg
...
[34130.752022] usb 1-8: new high speed USB device using ehci_hcd and address 6
[34130.884522] usb 1-8: configuration #1 chosen from 1 choice

%> less /sys/bus/usb/devices/1-8/idProduct
1007
%> cat /etc/udev/rules.d/95-pico.rules
...
BUS=="usb",ATTRS{idVendor}=="0ce9",ATTRS{idProduct}=="1007", MODE="666"

Any other hints?

-- Tom

wayoda
Active User
Active User
Posts: 11
Joined: Fri Aug 01, 2008 9:49 am
Location: Wuppertal/Germany

Re: PicoScope run under LINUX?

Post by wayoda »

Any other hints?
-- Tom
Sorry, No
I'm running the 32bit version of Ubuntu , if you are running 64bit ...

You could dive into some low-level usb debugging using the kernels 'usbmon' feature, but it won't help you activating the scope since the problem obviously is somewhere in the closed source driver-code.

The only thing I would try is to replace the
ps2000_open_unit() call in the example to a routine that uses the ps2000_open_unit_async()/ps2000_open_unit_progress() calls instead.
But to be honest, I don't think it will make any difference.

Eberhard (who hates closed source drivers!).

tfielden
Newbie
Posts: 0
Joined: Tue Dec 15, 2009 4:16 am

Re: PicoScope run under LINUX?

Post by tfielden »

Thanks for the help on this. I'm running 32bit Kubuntu 9.10

I tried your suggestion. No luck as expected, but information.

Code: Select all

int main (void)
{
  unitOpened.handle = ps2000_open_unit_async();
  short pct = 0;
  while(pct < 100) {
    short ret = ps2000_open_unit_progress(& unitOpened.handle, & pct);
    printf("pct = %d, handle=%d, return %d\n", pct, unitOpened.handle, ret);
  }
...
}
output:
...
pct = 11, handle=0, return 0
pct = 11, handle=0, return 0
pct = 100, handle=0, return 0


So, I get to 11% connected, then it gives up. For someone with access to the driver source this value may be meaningful. Perhaps there's a version of or switch on the driver that allows for verbose output to give a hint as to where this failure is occurring. Just a thought.

Just for the record, I tested my PicoScope 2203 under Windoze and it works, but the goal is Linux.

-- Tom

wayoda
Active User
Active User
Posts: 11
Joined: Fri Aug 01, 2008 9:49 am
Location: Wuppertal/Germany

Re: PicoScope run under LINUX?

Post by wayoda »

Here is the same problem (2203 on Linux) and possible solution (link to a revised driver by PeterF)
http://www.picotech.com/support/topic4999.html
Eberhard

Arkanum
Newbie
Posts: 0
Joined: Sat Nov 06, 2010 3:06 am

Re: PicoScope run under LINUX?

Post by Arkanum »

You should develop a Netbeans or Eclipse platform based IDE...
It would be great. Seriously, I can change on software, computers and that stuff, but always hardware like Oscilloscopes and other tool remains.

robin48gx
Newbie
Posts: 0
Joined: Tue May 29, 2012 7:57 am

Re: PicoScope run under LINUX?

Post by robin48gx »

Bought a PicoScope 2105,
got the drivers running and the little console program.

Where is the GUI ?
I can't find it on the picoscope web site.

Martyn
Site Admin
Site Admin
Posts: 4491
Joined: Fri Jun 10, 2011 8:15 am
Location: St. Neots

Re: PicoScope run under LINUX?

Post by Martyn »

Martyn
Technical Support Manager

Post Reply