Author Topic: Free DS1052E/DS1102E Software for Linux  (Read 25143 times)

0 Members and 1 Guest are viewing this topic.

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Free DS1052E/DS1102E Software for Linux
« on: May 31, 2015, 10:58:54 pm »
Maybe others too.

Work in progress, so a little rough around the edges at the moment:


https://github.com/wd5gnr/qrigol

From the readme:
Features:
* Uses USB communications with Scope
* Allows keyboard to be unlocked so you can use both the panel and the software
* Allows easy reading of all measurements as well as logging of all measurements
* Control of common scope functions
* Saves waveforms in CSV format
* Integrates with external plot software like gnuplot to qtiplot
* Diagnostic mode to send raw commands to scope

Screenshots:





Feedback welcome. Contributions (in the form of source code to GitHub) even more so ;-)

The funny part is, I just bought a DS1054z which should be in later this week, so I'm not sure why I'm writing this now. But I do intend to keep polishing the rough edges off of it.



« Last Edit: June 05, 2015, 12:55:24 am by wd5gnr »
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #1 on: June 02, 2015, 12:39:25 pm »
Perhaps I should try a Windows port. Is there any interest? I assume VISA provides some usbtmc-like interface.
 

Offline Grapsus

  • Regular Contributor
  • *
  • Posts: 239
  • Country: fr
  • Country: fr
Re: Free DS1052E/DS1102E Software for Linux
« Reply #2 on: June 02, 2015, 03:37:31 pm »
Hi,

Your app looks very nice! I will give it a try. Having the measurements on a PC screen is a killer feature because they occupy a lot of space on the scope LCD.

I'm Linux user so I don't care a lot about a Windows port, but if you're after a larger audience it may be a good idea.
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #3 on: June 02, 2015, 05:07:14 pm »
If you have ideas for features, post them here.

Things I would like to do:

1) Windows port + serial port option to connect
2) Ability to send CSV file to external filter program to decode (for example) RS232, I2C, SPI, etc.  Done
3) Ability to save off waveforms on a schedule and/or on a trigger
4) Ability to save off measurements after a set trigger (e.g., after scope triggers in normal mode or after Vpp>5V)
5) Save off scope configurations and reload

Not sure if I will get to any or all of these, but you never know.
« Last Edit: June 06, 2015, 10:22:54 pm by wd5gnr »
 

Offline BloodyCactus

  • Frequent Contributor
  • **
  • Posts: 477
  • Country: us
  • Country: us
    • Kråketær
Re: Free DS1052E/DS1102E Software for Linux
« Reply #4 on: June 02, 2015, 05:16:18 pm »
very nice :) great to see some more linux software.

I would be curious to see how hard it would be to adapt to DS2k.
-- Aussie living in the USA --
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #5 on: June 02, 2015, 05:20:21 pm »
I think the command set is pretty similar. I may experiment with the DS1104z when mine arrives. Grab QtCreator, build it, and try the DS2K. I would guess some of it will work and if you report what's working/not working I'd try to help.
 

Offline dom0

  • Super Contributor
  • ***
  • Posts: 1398
  • Country: de
  • Country: de
Re: Free DS1052E/DS1102E Software for Linux
« Reply #6 on: June 02, 2015, 05:46:25 pm »
2.) -> sigrok has a ton of decoders. They operate on digital input data, so you'd need to convert the waveform to digital first (schmitt trigger, window centered on waveform average or something like that).

There's also PulseView around.
,
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #7 on: June 02, 2015, 05:49:10 pm »
Yes I had thought about sigrok. It also can read right off the Rigol. In fact, I wrote about it awhile back: http://www.drdobbs.com/embedded-systems/non-pavlovian-triggers/240147899

The way it works now, you might be able to script it to go right to pulseview on a plot.

Here's the file format, so it would take a script to zip it up and treat it as a plot program. http://sigrok.org/wiki/File_format:Sigrok/v2
« Last Edit: June 02, 2015, 08:01:11 pm by wd5gnr »
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #8 on: June 03, 2015, 01:44:11 am »
Ok that got me thinking (always dangerous).

I haven't pushed it to github yet because I have a few bugs and issues plus clean up. BUT.... I now have an "export to OLS" button. This writes an Open Logic Sniffer file (Java program; Google it). I can read UART data off the scope.

Other analyzers are 1-wire, SPI, I2C, DMX512, Manchester and NRZ line, and a few others that probably don't mean anything with a 2 channel input device ;-)





One more... here's the I2C decoder:





Will get this spruced up and on github. I am having some trouble on the acquisition stopping the scope without messing up the buffer. Best bet for now is to stop the scope yourself and then acquire the data.
« Last Edit: June 03, 2015, 02:29:01 am by wd5gnr »
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #9 on: June 04, 2015, 02:09:49 am »
For those of you keeping score, I just pushed a new version to GitHub.

You can now export to Sigrok .sr files (requires sigrok-cli on your PATH). You can then open files with PulseView. I need to make it allow for analog samples too, I suppose but right now just digital.

I have a lot of clean up to do on the code but it seems to work ok.

Figure below is a Pulseview window with some RS232 traffic captured and decoded as hex and ASCII.


 

Offline codeboy2k

  • Super Contributor
  • ***
  • Posts: 1838
  • Country: ca
  • Country: ca
Re: Free DS1052E/DS1102E Software for Linux
« Reply #10 on: June 04, 2015, 10:34:21 am »
The software looks great,good job!

Here's a suggestion, about your screenshots.  Stop using JPEG for screenshots, it's just no good, because of the compression artefacts. JPEG compression will make lines blurry and text unreadable, until you go to almost 95 quality, and then it makes the image too large, while still showing compression artefacts.  JPEG compression is much better at photos with complex colour information.

Instead, use a PNG compression for screenshots, it will do much better with large areas of the same colour.

 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #11 on: June 04, 2015, 12:23:03 pm »
Yeah my tool was using PNG and isn't suddenly. I need to go look for why.
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #12 on: June 07, 2015, 12:04:45 am »
I just posted up a 64-bit deb and 64-bit rpm for the binaries to install. Not sure if they are workable or not (I'm not much of a packager) but if you get them to install ok, I'd appreciate hearing about it (at least the first few). If you run into problems, I'd like to hear about that too.

https://github.com/wd5gnr/qrigol/tree/master/packages

If anyone asks for 32-bit packages I'll see what I can do.
 

Offline Bigman

  • Regular Contributor
  • *
  • Posts: 80
Re: Free DS1052E/DS1102E Software for Linux
« Reply #13 on: June 07, 2015, 08:06:24 am »
First comment: GREAT!
I own a Rigol DS1102E and on my PCs I am running Arch-Linux. Downloaded the files from https://github.com/wd5gnr/qrigol, opend it with QtCreator and compiled it succussfully. I used the USB-port at the back of the DS1102E and checked on the Linux-PC the available USBs in the /dev/ folder with "ls -alh | grep usb". Indeed there was now "usbtmc2", hence in wd5gnr, I typed for the device "/dev/usbtmc2". Well, but after pressing "connect" I am getting the message "Can't open device".
Any ideas, where to look for the problem (e.g. do I have to consider some settings at the Rigol)?

Thanks in advance & cheers
 

Offline RoTTe

  • Contributor
  • Posts: 17
Re: Free DS1052E/DS1102E Software for Linux
« Reply #14 on: June 07, 2015, 01:14:41 pm »
Hi there,

Fantastic job man! Thank you.

Sadly I wrote you for bad news. The program crashes all times when I tried to export the waveforms (no plot, csv, neither OLS nor Sigrok). When I clik the export button just BOOM Segmentantion Fault.

I tried the code (qtcreator 3.0.1 and Qt 5.2.1), and the package (worked fine on ubuntu 14.04).

Binary:

Code: [Select]
qrigol # qrigol
QMetaObject::connectSlotsByName: No matching signal for on_uiUpdate()
Segmentation fault (core dumped)

Qtcreator (Debug mode)



Thank you, good work!
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #15 on: June 07, 2015, 01:41:37 pm »
but after pressing "connect" I am getting the message "Can't open device".
Any ideas, where to look for the problem (e.g. do I have to consider some settings at the Rigol)?

My guess is you don't have permissions to use the device. My scope is usbtmc4 (I have a lot of scopes ;-) ). Here's an ls -l of /dev/usbtmc4:

crw-rw-r-- 1 root plugdev 180, 4 Jun  7 08:32 /dev/usbtmc4


Note that root owns it but the group is plugdev and I'm a member of the plugdev group (type groups from a prompt to see).

On Kubuntu and similar this is handled by udev. I have a feeling I have sigrok installed and it sets that up properly, so my bad!

If you can test this, I will add it to the .deb file at least.

As root, make a file in /etc/udev/rules.d   name the file 40-rigol.rules

It contains:


ACTION!="add|change", GOTO="rigol_rules_end"
SUBSYSTEM!="usb|usbmisc|usb_device", GOTO="rigol_rules_end"

 # Rigol DS1000 series
ATTRS{idVendor}=="1ab1", ATTRS{idProduct}=="0588", MODE="664", GROUP="plugdev"

 # Rigol DS2000 series
ATTRS{idVendor}=="1ab1", ATTRS{idProduct}=="04b0", MODE="664", GROUP="plugdev"

 # Rigol DG4000 series
ATTRS{idVendor}=="1ab1", ATTRS{idProduct}=="0641", MODE="664", GROUP="plugdev"

LABEL="rigol_rules_end"



-OR- install sigrok which you want anyway (sudo apt-get install sigrok).

After a restart (or restart udev and replug the scope) I bet it works.

Let me know, please and thanks for the report.
 

Offline RoTTe

  • Contributor
  • Posts: 17
Re: Free DS1052E/DS1102E Software for Linux
« Reply #16 on: June 07, 2015, 01:42:18 pm »
I updated the firmware of the Rigol to something ..... more "update" (2.04 -> 4.01.07) and worked fine.

Thanks!

Edit: I'm running this with root user, the permissions are ok ,D
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #17 on: June 07, 2015, 01:45:00 pm »
I was just about to ask you about that. I had the old firmware too and the return data is different. I _TRIED_ to make the code work either way (since it originally worked with old format only). But I apparently messed something up!

Hmm... I'll look at it, but then I have to find someone with a non-upgraded box to test on ;-)  Of course, my 1054z comes in tomorrow ( :clap:) so maybe I'll be willing to downgrade to test some more.

Sorry about that! I tried to accommodate the old format.
 

Offline Bigman

  • Regular Contributor
  • *
  • Posts: 80
Re: Free DS1052E/DS1102E Software for Linux
« Reply #18 on: June 07, 2015, 02:23:25 pm »
but after pressing "connect" I am getting the message "Can't open device".
Any ideas, where to look for the problem (e.g. do I have to consider some settings at the Rigol)?

My guess is you don't have permissions to use the device. My scope is usbtmc4 (I have a lot of scopes ;-) ). Here's an ls -l of /dev/usbtmc4:

crw-rw-r-- 1 root plugdev 180, 4 Jun  7 08:32 /dev/usbtmc4


Note that root owns it but the group is plugdev and I'm a member of the plugdev group (type groups from a prompt to see).

On Kubuntu and similar this is handled by udev. I have a feeling I have sigrok installed and it sets that up properly, so my bad!

If you can test this, I will add it to the .deb file at least.

As root, make a file in /etc/udev/rules.d   name the file 40-rigol.rules

It contains:
[...]

I will test your recommendation, which I appreciate. Before I do that:
1) I also checked out "ls -l of /dev/usbtmc2" --> crw------- 1 root root 180, 2  7. Jun 15:58 /dev/usbtmc2
(but there was also a message-line: ls: access not possible: couldn't find file or folder. this message was in German language, which is the language of my arch-linux version).

2) "$ groups" --> uucp lock users ... hence, I am not in the group plugdev.
3) "$ cat /etc/groups" --> ... well, I there is no group plugdev at all. And this is the point, which goes beyond my linux skills, but I am wondering if your recommedation to create the file 40-rigol.rules will work, since I can see there a lot of "Group="plugdev".
 

Offline RoTTe

  • Contributor
  • Posts: 17
Re: Free DS1052E/DS1102E Software for Linux
« Reply #19 on: June 07, 2015, 02:25:00 pm »
I was just about to ask you about that. I had the old firmware too and the return data is different. I _TRIED_ to make the code work either way (since it originally worked with old format only). But I apparently messed something up!

Hmm... I'll look at it, but then I have to find someone with a non-upgraded box to test on ;-)  Of course, my 1054z comes in tomorrow ( :clap:) so maybe I'll be willing to downgrade to test some more.

Sorry about that! I tried to accommodate the old format.

I've got one 1054z too -but this puppy works fine-. With the update works like a charm. Maybe some dialog to warn the user about its "old"-version ?

 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #20 on: June 07, 2015, 02:28:33 pm »

I will test your recommendation, which I appreciate. Before I do that:
1) I also checked out "ls -l of /dev/usbtmc2" --> crw------- 1 root root 180, 2  7. Jun 15:58 /dev/usbtmc2
(but there was also a message-line: ls: access not possible: couldn't find file or folder. this message was in German language, which is the language of my arch-linux version).

2) "$ groups" --> uucp lock users ... hence, I am not in the group plugdev.
3) "$ cat /etc/groups" --> ... well, I there is no group plugdev at all. And this is the point, which goes beyond my linux skills, but I am wondering if your recommedation to create the file 40-rigol.rules will work, since I can see there a lot of "Group="plugdev".

Well one easy thing to try would be to issue the following command:

sudo chmod 666 /dev/usbtmc2

Now it SHOULD work until the next reboot. If that's true, you could just add that to some autostart location (e.g., rc.local without the sudo). But that will at least prove/disprove that it is worth doing the effort to fix udev or if we need to figure something else out.

The other thing is that installing sigrok ought to install an appropriate udev rule so you could use your package manager to do that and I bet that would work too.
 

Offline Bigman

  • Regular Contributor
  • *
  • Posts: 80
Re: Free DS1052E/DS1102E Software for Linux
« Reply #21 on: June 07, 2015, 02:32:36 pm »

Well one easy thing to try would be to issue the following command:

sudo chmod 666 /dev/usbtmc2

Now it SHOULD work until the next reboot. If that's true, you could just add that to some autostart location (e.g., rc.local without the sudo). But that will at least prove/disprove that it is worth doing the effort to fix udev or if we need to figure something else out.

The other thing is that installing sigrok ought to install an appropriate udev rule so you could use your package manager to do that and I bet that would work too.

Great. It works! Thanks for that!!!
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #22 on: June 07, 2015, 02:34:37 pm »
I added notes to the README based on both discussions this morning. Really great to have more eyes and boxes testing ;-)

If you report other issues or feature requests, I'd be glad to hear them.
 

Offline Bigman

  • Regular Contributor
  • *
  • Posts: 80
Re: Free DS1052E/DS1102E Software for Linux
« Reply #23 on: June 07, 2015, 02:51:19 pm »
Quick info/remark/hint:
On the Rigol DS110E, the probe's attenuation is set to x10.
When I do "Read Scope" on the tap "Vertical" the attenuation is set to x1. I manually correct this to x10, but after clicking on "update" in the measurement tap, the attenuation in QRigal switchs back to x1 (but x10 is still the setting on the Rigol).

My Rigol's software is 00.03.01
Model: 1102E
 

Offline wd5gnr

  • Regular Contributor
  • *
  • Posts: 179
Re: Free DS1052E/DS1102E Software for Linux
« Reply #24 on: June 07, 2015, 02:52:00 pm »
I'll look at it. Is it both channels or just one?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf