[HN Gopher] Show HN: I made a tool to communicate data using the...
       ___________________________________________________________________
        
       Show HN: I made a tool to communicate data using the PC speaker
        
       Author : ggerganov
       Score  : 92 points
       Date   : 2021-04-21 17:41 UTC (5 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | jamesdwilson wrote:
       | why does it require sudo?
        
         | wizzwizz4 wrote:
         | Same reason you need `sudo` to change screen brightness with
         | the /dev/ files; unless you have special group permissions set
         | up, normal users can't directly access hardware devices. It's a
         | Linux convention.
        
           | d110af5ccf wrote:
           | > It's a Linux convention.
           | 
           | It's just basic security. Direct access (ie no trusted
           | intermediate software layer) to physical hardware is a
           | minefield.
        
       | helsinkiandrew wrote:
       | This took me back to loading programs from cassette tape in the
       | eighties.
       | 
       | What bit rate do you get? In those days about 1300 a second was
       | possible (on a good cassette with Dolby)
       | 
       | https://www.youtube.com/watch?v=faEYry_MyZM
        
         | pan69 wrote:
         | I used to record programs of radio for my C64. We had a radio
         | station that had a computer show and would broadcast software.
         | :)
         | 
         | Edit: The software that was broadcasted was usually made by
         | listeners or shareware. I.e. it was not illegal software.
        
           | JohnJamesRambo wrote:
           | That is so awesome.
        
         | p1mrx wrote:
         | I wonder what data rate is actually possible on a cassette
         | tape, using modern modulation and error correction techniques?
         | A blog commenter claimed to get 13.8 kbps per channel using
         | Digital Radio Mondiale with OFDM+QAM, but I didn't see an
         | obvious way to reproduce this:
         | 
         | http://www.windytan.com/2012/08/vintage-bits-on-cassettes.ht...
         | 
         | There are various data modes for ham radio (e.g. JT65), but
         | tapes are better in some ways (bandwidth) and worse in others
         | (wow and flutter), so those codecs seem ill-suited.
        
           | jrockway wrote:
           | I am not sure of the magnitude of wow and flutter on tapes,
           | but the amateur modes definitely account for some frequency
           | shift -- for HF, the ionosphere can shift the frequency
           | randomly (I kind of thought I was making this up, but found
           | some papers on it: https://agupubs.onlinelibrary.wiley.com/do
           | i/full/10.1029/200...), and radio local oscillators are not
           | perfect (usually temperature dependent).
           | 
           | (For other modes like airplane scatter, meteor scatter, EME,
           | satellite, etc. there is even more doppler shift.)
        
       | dariusj18 wrote:
       | Is this a full circle reimplementation of old telephone modems?
        
         | ggerganov wrote:
         | The data-over-sound library that I implemented (ggwave) and use
         | in this example implements a modified DTMF protocol. Instead of
         | only 2 tones, I use variable number of tones (usually 6) +
         | error correction.
         | 
         | In r2t2, I use a single-tone encoding, since the buzzer can
         | emit just a single frequency.
        
           | gugagore wrote:
           | > In r2t2, I use a single-tone encoding, since the buzzer can
           | emit just a single frequency.
           | 
           | That's not wrong, but also not the whole truth.
           | 
           | https://en.m.wikipedia.org/wiki/PC_speaker#Pulse-
           | width_modul...
        
             | deathanatos wrote:
             | From the Wikipedia article's citations:
             | http://www.oldskool.org/sound/pc/#digitized
             | 
             | I lived through the PC speaker, and never heard anything
             | like this ever emitted from one. It's crazy how _good_
             | those waveforms sound, if they 're representative of the
             | hardware...
             | 
             | I remember how amazing it was when we got our first
             | soundcard installed and working, too. Games were much more
             | interesting with real sound-effects.
        
       | sys_64738 wrote:
       | cat /path/to/file >/dev/audio ?
        
         | generalizations wrote:
         | I think the hard part is: cat /dev/audio > /path/to/file. :)
        
       | sroussey wrote:
       | Next, one for using light via the screen. More ways to connect
       | out from air-gapped computers!
        
         | accrual wrote:
         | Maybe one could perform accesses on mechanical hard drives in
         | such a way you could encode a signal with it. Maybe reading a
         | couple bytes from the inner tracks of the disk for "0" and
         | outer tracks for "1", assuming they produce different but
         | consistent access sounds.
         | 
         | Reading certain areas of a floppy disk would probably be even
         | louder and more consistent.
         | 
         | There could be a "setup program" that listens to the computers
         | microphone and performs various accesses, choosing two that
         | meet the criteria for being distinguishable enough for another
         | system to tell apart. Lower frequencies for 0, higher for 1.
        
           | crtasm wrote:
           | Here's that being done and also with fan noise:
           | https://www.securityweek.com/hard-drive-noise-allows-data-
           | th...
        
       | ggerganov wrote:
       | Hi HN,
       | 
       | r2t2 is a command-line tool for transmitting data through sound
       | using the PC speaker on the motherboard. The name of the tool is
       | a reference to the R2-D2 robot from Star Wars :)
       | 
       | In short, you type some message and it gets FSK modulated and
       | transmitted via sound through the PC speaker. Note that this is
       | the speaker/buzzer that you connect to the motherboard and not
       | the regular speakers that you connect to the sound card.
       | 
       | I also made a simple web page that listens to the sound emitted
       | by r2t2 and decodes the received messages. The page can be used
       | by simply opening it on your phone and placing the phone near a
       | computer/device that emits data with r2t2.
       | 
       | I made this tool mostly for fun, but I think it might have some
       | useful applications too. The advantage of this type of
       | communication is that the hardware is very cheap (~$1/speaker),
       | does not require a sound card and the software is very simple and
       | does not use any 3rd-party audio libraries.
        
         | jhgb wrote:
         | Receive Resources Through Tones?
        
         | nicbou wrote:
         | It's an interesting project. I couldn't think of a use case for
         | it but the one in a readme was a good example.
        
         | bityard wrote:
         | My google-fu is failing me because all I'm getting is blogspam,
         | but I could have swore that some higher-end washing machines
         | had a feature where when they broke down, they would emit some
         | kind of diagnostic noise. Not just the standard series of
         | beeps, but complex digital data. When you called in for
         | warranty support or repair, they would guide you though pushing
         | some buttons on the machine, the machine makes the noise, it
         | goes through the phone, and the call center person on the other
         | end could decode it. Or a repair tech on-prem could presumably
         | decode it with an app on their phone.
         | 
         | Also, ham radio operators are doing some amazing things with
         | audio-encoded data. You can send a message halfway around the
         | world with just a few watts and a person with a computer on the
         | other end can received and decode it, even if the signal itself
         | is _below the noise floor_. Of course, the tradeoff is time: it
         | takes a few minutes to transmit the small amount of data
         | required to make a contact.
        
           | Madrigal wrote:
           | You're probably thinking of LG Smart Diagnosis
           | https://www.lg.com/us/support/help-library/smart-
           | diagnosis-f...
           | 
           | Video on how it looks like https://youtu.be/Q_fTfGJFK2A?t=68
        
             | tdeck wrote:
             | Wow it sounds like RTTY (radioteletype):
             | 
             | https://m.youtube.com/watch?v=wzkAeopX7P0
             | 
             | I suppose there are only so many ways to modulate a data
             | signal.
        
         | SwiftyBug wrote:
         | Very cool! What are some of the useful applications you thought
         | for this concept?
        
           | jonah-archive wrote:
           | at one point the iPod bootloader was extracted by playing it
           | aloud: http://www.ipodlinux.org/stories/piezo/
        
           | ggerganov wrote:
           | I imagine a use case where you have headless devices
           | (servers, raspberry pis, etc.) that are not connected to the
           | internet. These devices can be measuring something through a
           | sensor and periodically reporting the measured value using
           | sound through the speaker. When you go near the device of
           | interest, you take your phone and "listen" to the emitted
           | value to see what was the last measurement.
           | 
           | The advantage of this is that it is a very cheap way of
           | adding such communication channel to your device.
        
         | TedDoesntTalk wrote:
         | Amazing work!
        
         | fpopa wrote:
         | Well done, great demo!
        
       | BaconJuice wrote:
       | This is so cool! and I love the name! Thank you for sharing.
        
       | exabrial wrote:
       | I'm probably showing my age:
       | https://en.wikipedia.org/wiki/Acoustic_coupler
        
         | fuball63 wrote:
         | I also thought of this, but from the movie "WarGames".
        
       | tyingq wrote:
       | I haven't tried it, but DOSBox emulates the piezo speaker and can
       | record to a .WAV file, you toggle it on/off with <ctrl><f6>.
       | 
       | So, perhaps a way to try this without finding an old pc.
        
       | heywire wrote:
       | Reminds me of some of the ham radio digital modes. Here's a fun
       | link of examples:
       | 
       | https://www.sigidwiki.com/wiki/Category:Amateur_Radio
        
       | valbaca wrote:
       | Neat project! thanks for sharing
       | 
       | An example of when sonic communication is useful is to bootstrap
       | other communication.
       | 
       | During setup, Amazon Dash buttons would listen for data sent over
       | ultrasonic to get network information.
       | 
       | https://www.cnet.com/home/smart-home/appliance-science-how-t...
       | 
       | I think that's just super cool.
       | 
       | (Disclaimer: I work at A->n but not on this in particular, I have
       | only public, consumer knowledge about how this works)
        
         | ggerganov wrote:
         | Haha, I wasn't aware of Amazon's Dash buttons!
         | 
         | The funny part is I already did a similar application using
         | ggwave and talking buttons. I mean, it does not order stuff,
         | but you can easily create a button that triggers any kind of
         | action via audio:
         | 
         | https://github.com/ggerganov/ggwave/discussions/27
        
       | dvt wrote:
       | This is very cool! I briefly browsed the code, and didn't seem to
       | see any error correction. Do you find that ambient noise might
       | "garble" the data?
        
         | ggerganov wrote:
         | I use Reed-Solomon error correction:
         | 
         | https://github.com/ggerganov/ggwave/tree/master/examples/r2t...
         | 
         | The communication should be robust towards noise, but I still
         | haven't investigated thoroughly how noise affects the
         | performance.
        
       | Spooky23 wrote:
       | Reminds me of slow scan tv from the HAM radio days! Cool project.
        
       | [deleted]
        
       | cyberge99 wrote:
       | What is the transfer rate?
        
         | ggerganov wrote:
         | You can add a command-line argument to change the Tx protocol
         | between 3 types as explained in the README. Here are the
         | transfer rates for the 3 protocols:
         | 
         | - [R2T2] Normal : 16 bytes/8.5 sec
         | 
         | - [R2T2] Fast : 16 bytes/5.7 sec
         | 
         | - [R2T2] Fastest : 16 bytes/2.9 sec
         | 
         | The faster the communication - the less reliable it is.
         | Currently, data is transferred in 16-byte batches.
        
       | mdorazio wrote:
       | I remember years ago reading about this being a black hat method
       | for exfiltrating data from computers not connected to a network.
       | Load the "data to sound" program from an infected USB drive onto
       | the target, then use a separate device to collect the audio
       | without ever having to touch the network directly. There was even
       | a theory about using laser-based acoustic sensing to pull the
       | audio from any window in the room so you wouldn't even have to be
       | in the physically in the building. Interesting stuff.
        
         | sigg3 wrote:
         | TEMPEST has many iterations.
         | 
         | Wiki: https://en.m.wikipedia.org/wiki/Tempest_(codename)
        
       | donclark wrote:
       | Have you ever heard of LISNR?
       | 
       | https://www.youtube.com/watch?v=gvtrnpydHlU
        
         | ggerganov wrote:
         | I've seen the project, but I was disappointed to not be able to
         | find any way to try it out easily.
        
       | randomsearch wrote:
       | As part of my undergraduate course we had to build an embedded
       | system that did this, at a high baud rate, with a transmitter and
       | receiver. It was the most ridiculously difficult project I have
       | ever undertaken. Finished the transmitter but there was something
       | wrong with part of our analogue circuit and it gave the signal an
       | artefact. I wrote the assembly in a day (oh yeah we used
       | assembler and burned an EPROM I think) but the hardware
       | assignment was Walt Disney level fantasy.
       | 
       | I believe zero people on the course got it fully working.
       | 
       | I spent almost every spare hour I had in that lab for ten weeks.
       | And despite it being insanely difficult, I learnt something that
       | semester. I learnt that I would never, ever, work in hardware.
        
         | osrec wrote:
         | Lol, I had a similar experience as a teenager, however it only
         | increased my desire to work in hardware!
        
       | nikisweeting wrote:
       | There was a whole wave of interest in this space in 2014. I
       | believe @kategeek did the first easy-to-use library with Quietnet
       | ;) https://github.com/Katee/quietnet
       | 
       | Some other material on the subject:
       | 
       | - http://www.whence.com/minimodem/
       | 
       | - https://quiet.github.io/quiet-js/
       | 
       | - https://courses.csail.mit.edu/6.857/2014/files/05-li-lynch-z...
       | 
       | - https://www.ghacks.net/2014/01/09/ultrasonic-communication-c...
       | 
       | - https://smus.com/ultrasonic-networking/
       | 
       | - https://arstechnica.com/tech-policy/2015/11/beware-of-ads-th...
        
       ___________________________________________________________________
       (page generated 2021-04-21 23:00 UTC)