IP Over QR Codes

We’ve seen networks built over some interesting mediums, but QR codes has to be a new one. [Eric Seifert] decided to try to use QR codes to make an IP connection. He used these visual codes to create a bi-directional connection between two camera-equipped computers. He’s a persistent chap, because it works: in one of his videos, he shows an SSH connection between two devices.

He faced a number of challenges on the way. Although there is plenty of code to read QR codes, the data that can be encoded and read from them is limited. There is a binary mode that can be used with QR codes, but it is really inefficient. [Eric] decided to use base32 coding instead, packing the data into each frame as alphanumeric text. Each QR code image that is created and received is numbered, so the system can keep track and request any lost images. He also had some problems with keeping the data consistent between the encoded and decoded versions, so he had to add some packing to the data before it would work.  It uses Python-pytun to create a TUN/TAP device that carries the data.

The speed of the connection is rather slow: in his demo video, the two computers take over a minute to exchange keys for an SSH connection, and [Eric] measured the speed of the connection at about 100 bits per second. But even getting something like this working at all is a significant achievement. He has published his code on GitHub.

We’ve featured the work of [Eric] before: he created a data connection using an iPod FM transmitter.

41 thoughts on “IP Over QR Codes

  1. Totally whack…
    That being said: Have you tried adding printers and cameras to the system, so that it can be even more complicated and overhead-ish? :-)
    This is why I come here…

  2. Perhaps the multicoloured triangular type “barcode” to take advantage of the camera a bit more and squeeze in more data.
    Smart board sends out a packet and updates multiple devices in one hit. Like the infoburst at the end of tv shows. Record at 30fps change image at say 10fps and play back in slow motion.

    1. ^^^ use the three frames to remove errors/blurr.

      Feeling adventurous… Got too.much time in the day…
      Maybe use the Web cam to view the number/scroll/caps lock leds… Send the message three bits at a time via a script… :D

  3. Awesome! Somebody actually did this!

    Quite a while back, I started on something with exactly the same concept. Never published it, but I did end up getting serial-over-QR working and figured I’d use an IP-over-serial system over the top of it.

    Glad to see someone got this absurd concept working!

    1. Cool project I do wish I got a little further when I played around with the same idea. I quickly realized with some test scripts and not without drastic changes to the qr code library it was going to be slow(single thread never got into buffering frames to distribute to more cores). Qr codes are overly complex when a 4bit grey scale bitmap(pgm) and header for calibration and maybe a few bit Reed-Solomon error correction would suffice and opencv or c program to change to image back to pgm and deskew. The libraries I used took to long to decode the qr code even if it was a perfect image and turned off checking for skew.

  4. I wrote a program a while back that would take an input file and output it to qr code, embedding the data in rather smallish qr codes. The idea was you could then print it out, rescan them later and the program would reassemble from the data.

    Never finished the reassembly part but I should… fun little BS project.

    1. although not relavant to “large” files by today’s standards, you could upload an old datacassette or data-vhs to youtube and see if the data is there or if dropped/interoplated frames screws it up, if the data is not re-playable, then take that protocol and slow it the heck down,instant youtube-data protocol without needing to re-code anything.

  5. Looks like there’s plenty of space to increase the frame rate. I wonder what the delay is now? Is he using interpreted PERL or something for it? Maybe command-line called graphics tools to extract the QR and rotate it to the correct angle, etc?

    I bet if he got right down to it, and coded something fast, that got straight to the point and didn’t mess about, he could get it much faster.

    Whatever the point of that would be…

    OK so there’s no point in transmitting data over QR codes over video, and never will be. So I suppose the speed doesn’t matter, but don’t take the speed of this chap’s creation as authoritative, it could probably do a lot faster if you needed it to. Which you never would. So really there’s only so much point in my even speculating, really.

Leave a Reply

Please be kind and respectful to help make the comments section excellent. (Comment Policy)

This site uses Akismet to reduce spam. Learn how your comment data is processed.