Electronics design, automation?

26.01.2012 16:03

Recently I had an opportunity to see development labs of a few local hardware shops and chat with people working there. In addition to my recent work at the Jožef Stefan Institute it made me realize that, for someone familiar with development practices in the world of free open source software, the field of professional electronics development is quite lacking in some regards.

Interesting. The software world has long ago established a need for revision control systems, code review tools, bug trackers and release procedures. And rightfully so - as I often rant about here, most software is so complicated today you are basically forced to use of such tools to achieve any kind of collaboration or a usable quality level. While it's true that too often good practices are overlooked in commercial settings and deadlines and marketing given priority, at least most developers will tell you what is the ideal they strive for.

Compared to that it was somewhat striking to hear that manual checking over multiple-sheet schematics for differences is common practice. Or that proper revision control systems aren't required and that keeping multiple folders of versions was all anyone would ever need. Or procedures for making fabrication documents, equivalent to a software release, that take too many minutes of clicking various settings in a graphical interface.

Agreed, most electronics development done in small groups and companies is simple enough to involve only one person. It also involves simpler designs and nowhere near the layers of abstraction present in software. But on the other hand mistakes are much costlier here. If a botched software release these days means uploading a new package or even just updating some scripts on your web server, a broken prototype hardware design sent to manufacture wastes much more tangible resources.

A collection of Eagle dialogs

One thing software developers learn is not to trust themselves. Any repetitive tasks should be scripted and should involve as few and as simple steps as possible. There should always be ways to double check your or your colleague's work. After a long work day I don't trust myself that upon saving a file I only made the changes I wanted and didn't accidentally drag an odd trace out of place while I was experimenting with layout. I don't believe that I won't forget to check that critical check box in the GUI the tenth time I will be exporting Gerber files. And most of all, I will never be sure that when comparing two PDFs centimeter by centimeter and line by line I won't miss a difference.

Not surprisingly, voices to improve this situation are being heard as open hardware philosophy becomes more widespread. Some of the blame here certainly goes to the lack of tools that would allow such processes. It appears that if you want to have them out of the box, you either need to go for some very expensive proprietary software aimed at large teams and huge projects, or funny enough, free software tools like gEDA.

More concretely, CadSoft Eagle, the software most used for small projects and not that uncommon also in the open hardware community because of its low cost, has a distinct lack of such capabilities. Having just finished my first design in it and finding out all of the above, I tried to change a few things for the better.

Demonstration of eaglediff, visual diff for CadSoft Eagle.

Hence, eagle-automation. It's a small collection of Python scripts that currently allow you to do just two things:

  • Make a set of fabrication documents from a single Makefile without clicking on a single dialog (with credits to Andrew and his blog post).
  • Do visual diffs between revisions of schematics and board layouts stored in git, like the one shown above

The installation is as simple as the usual Python setup.py install dance (you need Python Imaging Library) and the git integration uses git-difftool which is present in recent versions of git. For the rest I refer you to the README file. Apart from finicky Eagle scripting it's quite simple actually.

So, most of all, I hope this will make open hardware development easier and more reliable. I will still strive to use open tools like gEDA as much as possible - with which, by the way, I never had much use for visual diffs because of its human readable ASCII file format - but I also understand that a lot of people are stuck and will be stuck for some time behind proprietary tools. But I don't see that as a reason why lessons learned the hard way by the software world should not be reused.

Posted by Tomaž | Categories: Code | Comments »

Meta meta talk

22.01.2012 18:12

I noticed that a lot of talks and presentations I attend, especially in the more academic circles, begin with the speaker showing a slide with the outline of the talk in form of a bulleted list and talks through it, explaining what he will talk about. With short talks this can actually take a significant part of the total time, especially if the speaker returns to that slide after each part, showing how far into the talk he progressed.

What is the point of that, short of giving the audience an opportunity for one last glance of their email client? The purpose of such an overview in printed articles is to give the reader some idea of the contents. This means that you can skip reading it altogether and move to the next article if the table of contents doesn't give you enough confidence that the article will be of use to you. Via page numbering it also allows you to skip directly to the interesting part, should only a part of the document be useful.

None of these uses apply to the spoken word though. You can't fast forward to the interesting bit and if you find that the talk won't be worth your time after the introduction it's usually considered quite rude to walk out at that point. As is browsing the web waiting for the part the interests you.

Some may argue that the table of contents makes the slide stack more readable in stand-alone form. I don't buy that - slides are part of the presentation and I don't think any consideration should be given on how useful they might be without the accompanying speech. It's 2012 after all and making at least an audio recording with cheap equipment shouldn't be science fiction anymore.

Posted by Tomaž | Categories: Ideas | Comments »

Video of my 433 MHz receiver talk

14.01.2012 18:04

Questions and answers at 433 MHz receiver talk, Kiberpipa

Photo by lowk3y

Last Tuesday I gave a talk about my 433 MHz receiver project at Kiberpipa's Open Sessions. I presented what I learned about the radio communication between cheap, simple everyday devices, described the receiver hardware and software and did a live demo.

I think the talk was well received and although I didn't go much into the security consequences of some of my finds the Q & A session that followed made it clear that it wasn't really necessary.

A few minutes ago I also uploaded the version of the software that I was using during the demo. Compared to the 0.0.1 version which I put on-line during the 28C3 it contains some minor fixes for the software demodulator and a bootstrap script that (hopefully) compiles everything in one step.

If you missed the talk, the video recording of it is already on-line thanks to the efforts of the Viidea team. You can either download it or watch it in the web browser synced to high-res slides at Kiberpipa's shiny new video archive.

Update: in the talk I mentioned that the CM108 audio chip doesn't allow for longer than 24 hours of continuous recording and blamed either a bug in the chip or ALSA drivers. It turns out this was a bug in my own code (which is now fixed in the git repository). I guess I should count the bits in my own variables before speculating on the counter size of others.

Posted by Tomaž | Categories: Life | Comments »

28C3 Rückblick, part 2

05.01.2012 11:35

28th Chaos Communication Congress is much more than just the things that are neatly listed on the Fahrplan. If the safety personnel would allow it, the halls and walkways would be filled to the top with all sorts of more-or-less identifiable hardware, interspersed with empty bottles of a certain caffeinated drink. Some of it was there just for display or for sale in kit form, some was being actively developed or disassembled and some was a target for scheduled and ad-hoc workshops. Sharing ideas by participating in this chaos is a big part of the congress.

Hacked Brother KH930 knitting machine

Hacked Brother KH930 knitting machine by Fabienne

This year I had the feeling that there were many more low-level hardware projects going on than last year. As with previous events there was a large hardware hacking area in the basement, but portable oscilloscopes, multimeters and soldering irons were a common sight also in the hackcenter and the hallways. Arduino workshops were absolutely packed and I escaped from the room each time they started to run away from the crowd. The well-known Linux distributions and other free software groups occupying their usual places at the Berliner Congress Center almost felt pushed aside.

The r0ket badge, introduced at the CCC camp, was back. The version 2.0 with some minor improvements was available half-assembled at the info desk for 30 € and was sold-out in minutes. There was also a new official firmware image available with which you could play Tetris on a big green LED display at the hackcenter and control a few other things around the congress. In combination with the tiny joystick that practically guaranteed a sore thumb for everyone.

Speaking of sore body parts, a special kind of attraction was the PainStation, an exhibit from the Computerspiele Museum. It's a Pong clone where missed balls result in pain being inflicted on your hand through heat, electric shocks and a mechanical whip. Since you had to sign a disclaimer to play with it I guess it wasn't very forgiving. I didn't give it a try under the excuse that I'm already being shocked frequently enough in my profession. Considering that in the end one third of medical emergencies at the congress had a connection to this machine maybe that wasn't such a bad idea after all.

Disassembled TP-Link TL-WR703N

Jure and I spent some time trying to find a problem that this little device would solve. It's a TP-Link TL-WR703N, a tiny portable wireless router that is capable of running OpenWRT. For around $20 you get a MIPS system with 4 MB of flash and 32 MB of RAM storage, 802.11 radio, wired Ethernet, USB, serial and at least one GPIO port. Certainly something worth considering when the next idea comes around that needs Internet connectivity in a small package.

MC HCK, the small and cheap micro controller board

Next on the list of tiny things is the MC HCK, a very basic open hardware ARM Cortex M0 board that is little more than a microcontroller on a PCB that fits into the USB socket. I thought it's hard to get more basic than an Arduino, but this certainly proved me wrong. Simon (who also let us borrow the TP-Link board above) is trying to get it down to $5 per board.

I should also mention, that I had a nice chat with a developer from the Sigrok project. They are developing a portable logic analyzer software that works with a wide range of different hardware devices. I've been missing a good logic analyzer and I got some good advice on which hardware capture device works best with Sigrok.

Congratulations go to the Network and Phone Operation Centers. Wi-Fi was working surprisingly well this year and I mostly didn't have problems keeping a link up for IRC chat or an occasional website load. It was slow but stable except in Saal 1 when it filled up. Eventphone GSM network also worked the few times I attempted to use it. Only an occasionally a General error popped up on my N900. The only complaint would go to this year's Wiki, which had a somewhat unusable theme and was down a lot.

By the way, I learned that stability of the 802.11 link in this environment depends largely on what drivers you use. On my aging Eee 901 with the Atheros chip for instance, the ath5k driver that comes with recent kernels can barely keep the link up for a few seconds before dropping it and forgetting all the iwconfig settings. On the other hand the old madwifi worked almost perfectly.

Money is obsolete poster and blinkenlights at 28C3

All summed up, this was one of the best congresses I've attended. There was always something to do and it never happened, as it did occasionally at the previous events, that there wasn't an interesting talk on the schedule or interesting people to talk with. Unfortunately I didn't manage to prepare a lightning talk about my 433 MHz receiver project before the trip to Berlin and once I was there everything went by so fast I didn't even manage to finish my slides.

Again, thank you CCC and all of the Angel volunteers for the wonderful event and see you next year!

Posted by Tomaž | Categories: Life | Comments »

28C3 Rückblick, part 1

02.01.2012 10:52

It's been two days since I returned from the 28th Chaos Communication Congress in Berlin. Enough I guess to recover my sleep cycle and detox from Club Mate and other caffeinated drinks. Those were also the primary reasons why I didn't feel capable of writing a coherent blog post about the happenings inside the Berliner Congress Center during the congress. However, I do have a ton of notes and I'll try to share my thoughts on the congress in a few retrospective posts.

28C3 keynote address by Evgeny Morozov

The best way to start would probably be at the talks. Two of those have circled the web and I can't add anything that hasn't already been said about them: How governments have tried to block Tor by Tor project developers Jacob Appelbaum and Roger Dingledine rightfully received a standing ovation while Cory Doctorow's The coming war on general computation had a fan-made transcript within hours. Both are well worth a look, including the Q & A sessions that followed.

Cory Doctorow at 28C3

GSM and mobile phones remain in the focus of security researches and reverse engineers. Karsten Nohl released a set of tools for assessing the security of calls made through your local mobile operator and an IMSI catcher detector. Both require only an OsmocomBB-compatible phone and I would love to see how Slovenian operators score on the former. There was also a very interesting talk by Guillaume Delugré on Reverse-engineering a Qualcomm baseband. In a flawless demonstration he showed how he managed to inject a GNU debugger compatible interface into a proprietary real-time OS running on the baseband processor inside a USB 3G dongle. We might soon see a OsmocomBB equivalent for UMTS based on this hardware.

Part Time Scientists present a new rover at 28C3

Outside of the limelight there was the usual spectrum of talks on all sorts of topics. Continuing the CCC camp's hackers in space theme there was the unveiling of the new lunar rover by the Part Time Scientists team. The work they are doing on their hardware is impressive to say the least, however the presentation they gave was somewhat poorly prepared. Inviting questions from the audience with cheap give-aways might work on disinterested college undergraduates, but it just looked silly with this crowd.

Anyone dealing with wireless networks will probably be interested in Packets in packets talk about how the noisy nature of a radio link can be exploited to attack security of low level code even if the attacker only has access to protocols further up the OSI stack. And talking about security, Peter Eckersley of Electronic Frontier Foundation presented their Sovereign Keys proposal for fixing the current, broken situation regarding SSL certificate authorities.

Old home computers are still a popular topic, as proved by the Atari 2600 and the Commodore 64 demo talks. So is Bitcoin, although I haven't heard anything about this electronic currency I haven't seen before.

Leaving computers aside for a moment, there was also an interesting talk about Eating in the Anthropocene, which had a refreshingly rational approach to the topic of genetically modified organisms. These are usually automatically considered evil, even in the population frequenting this kind of events.

On a similar note, I should also mention something that happened on the final track of lightning talks. One of the speakers ringed all the bells of a new-age pseudo-scientific nonsense. While the IRC channel immediately exploded with skeptical remarks, the real-life audience actually patiently waited for the end of the four minute slot. A few people then gave a courtesy applause and the rest of us expressed our disagreement. Nick Farr, moderator for the session and otherwise a very respected member of the congress organization team, scolded us for not respecting the speaker's effort and gave the speaker an extra minute that was otherwise reserved for well-received talks. I think speaker was shown enough courtesy by giving him an equal opportunity to make a convincing case for his negative-ions-atmosphere-fertilization thing. Giving him extra time in my opinion showed lack of respect for all of the other speakers before him that presented more sensible topics.

Finally I should also mention there was an unscheduled panel on depression, motivated by the recent suicide of Diaspora developer Ilya Zhitomirskiy. It focused mostly on personal stories, but the IRC discussion it triggered raised some questions I would very much like to see discussed more in-depth, like how much is depression correlated with the hacker culture and motivations behind it.

Heart of gold in front of BCC

This more or less covers the talks I attended and found worth sharing. Of course, you can find the whole list of talks, plus official video and audio recordings, on the Congress Wiki.

This year quite a few of the more security-oriented technical talks moved to a smaller, parallel event called BerlinSides at the other end of the city. I would certainly attend a few of the talks scheduled there and some actually choose to hop between the two events. However in hindsight, I didn't miss them at 28C3. The better selection of talks meant less of the bad feeling that I'm missing interesting presentations in the upper floors and more time socializing and doing other awesome things in the hackcenter. But more about that in the next part. Stay tuned.

Posted by Tomaž | Categories: Life | Comments »