python

sigrok - cross-platform, open-source logic analyzer software with protocol decoder support

sigrok logo

I'm happy to finally announce an open-source (GNU GPL), cross-platform (Linux, Mac OS X, FreeBSD, Windows, ...) logic analyzer software package myself and Bert Vermeulen have been working on for quite a long time now: sigrok (it groks your signals).

History

I originally started working on an open-source logic analyzer software named "flosslogic" in 2010, because I grew tired of almost all devices having a proprietary and Windows-only software, often with limited features, limited input/output file formats, limited usability, limited protocol decoder support, and so on. Thus, the goal was to write a portable, GPL'd, software that can talk to many different logic analyzers via modules/plugins, supports many input/output formats, and many different protocol decoders.

The advantage being, that every time we add a new driver for another logic analyzer it automatically supports all the input/output formats we already have, you can use all the protocol decoders we already wrote, etc. It also works the other way around: If someone writes a new protocol decoder or file format driver, it can automatically be used with any of the supported logic analyzers out of the box.

Turns out Bert Vermeulen had been working on a similar software for a while too (due to exactly the same reasons, crappy Windows software, etc.) so it was only logical that we joined forces and worked on this together. We kept Bert's name for the software package ("sigrok"), set up a SourceForge project, mailing lists, IRC channel, wiki, etc. and started working.

Overview, Features

You can get the lastest sigrok source code from our main git repository:

  $ git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok

Here's a short overview of sigrok and its features as of today. The software consists of the following components:

  • libsigrok, a shared library written in C, which contains the general infrastructure for handling logic analyzer data in a streaming fashion.
    sigrok logic analyzer collection 2011
    It also contains the individual hardware drivers which add support for various logic analyzers. Currently supported hardware includes: Saleae Logic, CWAV USBee SX, Openbench Logic Sniffer (OLS), ZEROPLUS Logic Cube LAP-C, ASIX Sigma/Sigma2, ChronoVu LA8, and others. Many more devices are on our TODO list (and we already own them), it's just a matter of time to reverse engineer the USB protocols and implement a driver for them.

    Thanks ASIX for being open and helping with the ASIX Sigma driver, and many thanks to ChronoVu for being open as well and providing information about the ChronoVu LA8 protocol! Thanks to Håvard Espeland, Martin Stensgård, and Carl Henrik Lunde (who contributed the ASIX Sigma driver), Sven Peter and "Haxx Enterprises"/bushing (for contributing the ZEROPLUS Logic Cube LAP-C driver, ported from their zerominus tool). Also, thanks to Daniel Ribeiro and Renato Caldas who worked on the Link Instruments MSO-19 driver (still work in progress).

    Finally, libsigrok also contains the individual input/output file format drivers. Currently supported are: sigrok session (the default format, which contains all metadata), bits, hex, ASCII, binary, gnuplot, the OpenBench Logic Sniffer format, the ChronoVu LA8 format, Value Change Dump (VCD) viewable in gtkwave, and Comma-separated values (CSV).
    sigrok VCD file in gtkwave

  • libsigrokdecode, a shared library written in C, which contains the protocol decoder infrastructure and the protocol decoders themselves, which are written in Python (>= 3.0).

    The list of currently supported protocol decoders includes:

      dcf77                DCF77 time protocol
      lpc                  Low-Pin-Count
      mx25lxx05d           Macronix MX25Lxx05D
      jtag_stm32           Joint Test Action Group / ST STM32
      i2s                  Integrated Interchip Sound
      spi                  Serial Peripheral Interface
      edid                 Extended display identification data
      pan1321              Panasonic PAN1321
      mlx90614             Melexis MLX90614
      jtag                 Joint Test Action Group
      rtc8564              Epson RTC-8564 JE/NB
      transitioncounter    Pin transition counter
      usb                  Universal Serial Bus
      i2cdemux             I2C demultiplexer
      i2c                  Inter-Integrated Circuit
      i2cfilter            I2C filter
      mxc6225xu            MEMSIC MXC6225XU
      uart                 Universal Asynchronous Receiver/Transmitter
    

    Many more decoders are on our TODO list, and we especially welcome contributed protocol decoders, of course! We intentionally chose Python as implementation language for the decoders, to make them as easy to write (and understand) as possible, even if that means that performance suffers a bit. Have a look at the SPI decoder for example, to get a feeling for the implementation.

    Protocol decoders can be stacked on top of each other, e.g. you can run the i2c decoder and pipe its output into the rtc8564 (Epson RTC-8564 JE/NB) decoder for further processing of the RTC-specific, higher-level protocol. We also plan to support more complex stacking and combining of decoders in various ways in the nearer future.

  • sigrok-cli, is a command-line frontend, which uses both libsigrok and libsigrokdecode. It can acquire samples from logic analyzers and output them in various formats into files or to stdout, and/or run protocol decoders on the aquired data.

    Example: Data acquisition with 1MHz samplerate into a file.

     $ sigrok-cli -d chronovu-la8:samplerate=1mhz --time 1ms -o test.sr
    

    Example: Protocol decoding (JTAG).

     $ sigrok-cli -i test.sr -a jtag:tdi=5:tms=2:tck=3:tdo=7
     [...]
     jtag: "New state: EXIT1-IR"
     jtag: "IR TDI: 11111110, 8 bits"
     jtag: "IR TDO: 11110001, 8 bits"
     jtag: "New state: UPDATE-IR"
     jtag: "New state: RUN-TEST/IDLE"
     [...]
    

  • sigrok-qt, a Qt-based GUI for sigrok, using both libsigrok and libsigrokdecode.

    This is intended to be a cross-platform GUI (runs fine and looks "native" on Linux, Windows, Mac OS X) supporting data acquisition and protocol decoding.

    NOTE: The Qt GUI is not yet usable! We're working on getting it out of alpha-stage for the next release.

  • sigrok-gtk, a GTK+-based GUI for sigrok, using both libsigrok and libsigrokdecode (soon).
    sigrok-gtk
    This is a cross-platform GUI contributed by Gareth McMullin (thanks!), supporting data aqcuisition (and soon protocol decoding).

    NOTE: The GTK+ GUI is not yet fully usable (but it's more usable than sigrok-qt)! Consider it alpha-stage software for now.

We're happy to hear about other (maybe special-purpose) frontends you may want to write using libsigrok/libsigrokdecode as helper libs!

Firmware

Saleae Logic

Some logic analyzer devices require firmware to be uploaded before they can be used. As always, firmware is a bit of a pain, but here's what we currently do: For non-free firmware we provide instructions how to extract it from the vendor software or from USB dumps, if possible. For distributable firmware we have a git repo where you can get it (thanks ASIX for allowing us to distribute the ASIX Sigma/Sigma2 firmware files!).

  $ git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok-firmwares

Finally, for all Cypress FX2 based logic analyzers we have an open-source (GNU GPL) firmware named fx2lafw, started by myself, but most work (and finishing the firmware) was then done by Joel Holdsworth, thanks! The support list includes Saleae Logic, CWAV USBee SX, CWAV USBee AX, Robomotic Minilogic/BugLogic3, Braintechnology USB-LPS, and many others. Get the code from the fw2lafw git repository:

  $ git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/fx2lafw

Example dumps

We collect various captured logic analyzer signals / protocol dumps in the sigrok-dumps git repository:

  $ git clone git://sigrok.git.sourceforge.net/gitroot/sigrok/sigrok-dumps

They can be useful for testing the sigrok command-line application, the sigrok GUIs, or the protocol decoders.

We're happy to include further contributed example data in our repository, please send us .sr files of any interesting data/protocol you may come across (even if sigrok doesn't yet have a protocol decoder for that protocol). See the Example dumps wiki page for details.

Packages, distros, installers

sigrok Windows installer

I'm currently working on updated Debian packages for sigrok (will be apt-get install sigrok to get everything), and we're happy about further packaging efforts for other distros. We have preliminary Windows installer files (using NSIS), but the Windows code needs some more fixes and portability improvements before it's really usable. On Mac OS X you can use fink/Macports to install as usual, fancier .app installer files are being worked on.

Future

Apart from support for more logic analyzers, input/output formats, and protocol decoders, we have a number of other plans for the next few releases. This includes support for analog data, i.e. support for (USB) oscilloscopes, multimeters, spectrum analyzers, and such stuff. This will also require additional GUI support (which could take a while). Also, we want to improve/fix the Windows support, and test/port sigrok to other architectures we come across. Performance improvements for the protocol decoding as well as more features there are also planned.

Contact

Feel free to contact us on the sigrok-devel mailing list, or in the IRC channel #sigrok on Freenode. There's also an identi.ca group for sigrok. We're always happy about feedback, bug reports, suggestions for improving sigrok, and patches of course!

Democracy Player 0.9.0 - one step closer to world do... a very cool Internet video/podcast application

Democracy Player 0.9 screenshot

Democracy Player 0.9.0 has been released yesterday, which has been announced in quite a number of places already, e.g. Boing Boing.

It's available for Mac, Windows, and Linux; if you're on Debian unstable the installation is as simple as apt-get install democracyplayer (I uploaded the new packages yesterday, they should have reached all mirrors by now).

If you want to know what this is all about, but you're reluctant to install yet another program, check out this screencast (MOV, 37MB) which shows the basic functionality and user interface and discusses some of the new features... I think you'll like it.

You can use it for all kinds of video blogs and podcasts, it'll download and play almost anything with an RSS feed.

Trac - web-based project management with wiki + bug-tracker + svn code browser

Trac screenshot

I've started looking at Trac recently, a nice web-based project management tool written in Python.

It integrates with existing Subversion repositories; for example, you can browse the code in your repositories with Trac (it'll be displayed syntax-highlighted), view diffs between revisions etc. etc. Additionally, you get a wiki (e.g. for project documentation), as well as a built-in bug-tracker a la Bugzilla, all integrated nicely into a single piece of software...

It's Free Software, of course (the license changed from GPL to revised BSD somewhat recently)...

A few words on the installation:

  • First, install Trac, e.g. via apt-get install trac.
  • Then create a so-called Trac environment with trac-admin /path/to/environment/myproject initenv. You'll be asked where your svn repository resides, what's the name of the project etc.
  • You can then edit /path/to/environment/myproject/conf/trac.ini, and change the header logo/URL, the default component/priority/issue-owner and more.
  • For more administration, I recommend using the interactive Trac shell via trac-admin /path/to/environment/myproject. Type "help" for um... help.
  • Read the docs for how to setup the web server in order to run Trac (you can use CGI, FastCGI, or mod_python).

So far I've set up ca. 7-8 Trac instances for various projects and I'm quite happy with it. While I was at it, I also created a tiny Trac article in the German Wikipedia.

You can get tons of useful plugins and macros over at trac-hacks.org for additional functionality, e.g. DoxygenPlugin, GanttPlugin, DebianBtsMacro, and many more.

M4 Message Breaking Project - Using distributed computing to break encrypted Enigma messages from 1942

Enigma

This is pretty interesting stuff: the M4 Message Breaking Project tries to break Enigma M4 messages intercepted in the North Atlantic during World War II.

From the project website:

The M4 Project is an effort to break 3 original Enigma messages with the help of distributed computing. The signals were intercepted in the North Atlantic in 1942 and are believed to be unbroken. Ralph Erskine has presented the intercepts in a letter to the journal Cryptologia. The signals were presumably enciphered with the four rotor Enigma M4 - hence the name of the project.

They provide Free Software clients (GPL'd, written in Python and C) for Unix-like operating systems and various Windows variants. Project updates are available from the project blog.

The first message has already been successfully broken. The plain-text reads:

1930 Funkspruch 1851/19/252:
" F T 1132/19 Inhalt:
Bei Angriff unter Wasser gedrückt.
Wabos. Letzter Gegnerstand 0830 Uhr
AJ 9863, 220 Grad, 8 sm. Stosse nach.
14 mb. fällt, NNO 4, Sicht 10.
Looks "

Translation:

1930 Radio signal 1851/19/252:
" F T 1132/19 contents:
Forced to submerge during attack.
Depth charges. Last enemy position 0830h
AJ 9863, [course] 220 degrees, [speed] 8 knots. [I am] following [the enemy].
[barometer] falls 14 mb, [wind] nor-nor-east, [force] 4, visibility 10 [nautical miles].
Looks "

Hm, digging in the past with modern technology...

(via Network Security Blog)

Command-line OpenGL rendering using PyOpenGL and/or OpenGLContext

I noticed that there have been quite a few Python related posts on Planet Debian lately. Here's mine.

I'm having a really hard time trying to find a good solution for rendering an OpenGL scene (e.g. from a VRML file) using PyOpenGL and/or OpenGLContext in the command line. All solutions I tried so far pop up an X11-window, which is not what I'm looking for. Instead I want to render the scene and dump it to PNG/JPG without requiring an X11 server.

Can this be done with PyOpenGL/OpenGLContext? I could probably try to use xvfb, but that's really an ugly hack. Besides the images I get using xvfb are somewhat broken, not sure why (does xvfb support OpenGL?).

Any hints are appreciated.

Syndicate content