123 points · by tambourine_man · 4y ago · 86 comments
This code no longer works on new Pi's (it does a lot of low level very hardware stuff from userspace without a proper kernel driver). The code was written in a 24 hour Hackathon, so is very far from maintainable.
However there are other projects to do the same which do work on new Pi's.
There are ways to do a full software defined radio from a pi by using the I2S hardware, and that can transmit GPS, 433 MHz garage door openers, and various other things.
Obviously whatever you transmit you better be using some filters on the output if you want it to be vaguely legal.
https://github.com/F5OEO/rpitx
And it does work with nearly every RPi.
And unlike only doing FM (97MHz-108MHz), it can emit from an IQ datastream from 10KHz to 1.5GHz.
While it's relatively easy to remove harmonics, it is pretty much impossible to remove the broad comb of spurious signals either side of the carrier.
Which why transmitters are not designed this way in the real world.
If we were talking about AM I would assume you mean the audio signal isn't bandlimited and so high-frequency audio components get upconverted by the carrier frequency, but I don't know what the spectrum of an FM signal looks like. Are we talking about a broad comb that results in an analogous way from sudden changes in the frequency? Do they go away if you vary the frequency of a 50%-duty-cycle square wave smoothly, like maybe with second- or third-order continuity, instead of suddenly?
see https://en.wikipedia.org/wiki/Phase_noise
It's surprisingly difficult to generate a clean carrier which doesn't have a broad band of spectral components, but this is essential for the design of effective Receivers and Transmitters.
These sidebands are generated by noise in the oscillator, spurs caused by mixing products, jitter in the synthesiser, and non-linearities in the modulation process.
The bottom line is to look at the output with a high-quality spectrum analyser and compare the result with the spectral mask which is published by the FCC.
Wait, we can do sine wave up to ~1.5 GHz using the built-in PCM/I2S peripheral?
Because the pi is notionally outputting a square wave, there are plenty of high powered harmonics to use, and from a signal-quality point of view, they are just as good as the fundamental frequency.
Most people view harmonics, spurs and sidebands as unwanted, but with a bit of careful thought they can be controlled to be the exact signal you want...
https://learn.adafruit.com/adafruit-si4713-fm-radio-transmit...
John Park did a short video on it https://www.youtube.com/watch?v=PKP6Z-cEbFQ
You can also buy a fully legal MP3 FM transmitter. https://radiofidelity.com/best-fm-transmitter-for-your-car/
Bitluni made a fun (illegal) AM radio transmitter with an esp32 https://youtu.be/lRXHd3HNzEo
So you can get radio when there is no cell or data service - like when camping or hiking etc.
You set the sound card output at your OS settings and everything it's broadcasted over FM.
I know some of them exist for bluetooth audio, but not for FM.
- a USB sound card with 3.5mm jack, and
- an FM transmitter module (which can usually be powered with 3v-12v, so should be able to work with 5v USB power
(If I wasn't already neck deep in interesting challenges I would consider picking this one up)
It provides a good signal, is easy to adjust, and works well for phone calls (not just music).
Sorry, I don't know. It's in my parents' car, so I won't be able to check until the next time I visit them.
1. The radio will kinda suck. You’re probably not doing it wrong.
2. The sanest way to get pifm to play a stream (say from modipy) is a FIFO. gstreamer will be your friend.
3. Music will sound like garbage without a high and low pass filter.
3.1 Volume becomes an issue, you’ll need to amplify quite a bit to match the volume of real radio stations so your ears don’t get blown out if it flips stations.
4. It’s really low power so really really long wire paid dividends to get whole apartment coverage.
5. Tuning will be really finicky since FM kinda “attaches” to a station and you’ll be competing with basically every frequency already taken by the big towers.
If you want to take the next step I have https://www.adafruit.com/product/1958 and am very happy with it.
1. If you are using a modulated square-wave without a filter, than the harmonics/overtones will be splattering the local spectrum.
2. Tools like KerberosSDR/KrakenSDR make triangulating illegal broadcasts rather trivial.
3. Keep in mind, some places have a $5k fine and 1 year in jail... if you are illegally broadcasting.
It is if you are trying to run from someone who's liable to pluck your address out of a public database (like the one the FCC runs) and come after you, possibly with murderous intent. It is if the government persists in misgendering you because hating you is politically fashionable in some circles. I'm not arguing that it's conceptually difficult, but "That Hobby Where The Government Publishes Your Home Address" might be unpopular for reasons beyond the difficulty of understanding the hobby's conceptual level.
Read about halfway through this book so far, and It argues a fairly good case that Mr. Burns was based on a real person: https://www.amazon.ca/When-McKinsey-Comes-Town-Consulting/dp...
Have a wonderful day, and have faith most are lazier than they are evil =)
But you don't know. If it's radiating a few milliwatts (or even microwatts), that's sufficient signal to be hear across town in a sensitive receiver.
The really sad thing is that the unwanted signals could well be stronger than the unwanted one due to unknown resonances in the antenna wire, etc.
Many years ago the record was "1000 miles per milliwatt" using CW.
The problem is that the unfiltered output of this device contains a wide range of spurs and harmonics which will radiate right across the VHF and UHF bands.
Plus the antenna (a few feet of wire) will have multiple resonances across the same range.
It will radiate hundreds of signals, and the odds of them interfering with a nearby essential service will be very high. And note that the essential service receiver is capable of hearing signals in the micro-watt range and is routinely trying to receive them.
[1] https://www.digikey.com/en/products/detail/seeed-technology-...
[2] https://www.viavisolutions.com/en-us/products/interferencead...
We had in France a similar story where a village was losing 3G/4G connectivity almost every day around 22:00. It seemed that there are interferences with something.
A special car was sent by the national regulation entity, it was trying to triangulate the source.
They found a house where the owner bought a jammer on AliExpress because he wanted his children to sleep and not go on internet. He thought it was only "for the house".
These have a surprisingly long history, e.g.
https://en.wikipedia.org/wiki/Direction_finding#/media/File:...
When the Radio Inspector came to check, he found a rechargeable torch sitting in it's charger bracket, which generated horrendous interference whenever the batteries reached full.
https://www.popularmechanics.com/science/a34229436/old-tv-br...
And there's a twist to this: ADSL data networks attempt to feed broadband signals over unshielded (and poorly balanced) phone lines, which means that they are intolerant of legitimate radio emissions from licensed services nearby.
The ADSL system attempts to compensate for conventional transmissions by dropping out those channels, but any wideband impulse causes the entire system to hang while it unsuccessfully tries to find a clear set of channels. So each pulse locks up the system for a few minutes while it renegotiates.
A variation on this is the ignition on the Postman's motor bike which wipes out all the ADSL in each street that he visits.
The bottom line of course is that ADSL was a horrible hack which attempts (and fails) to bypass the laws of physics.
Tinker away, laws be damned.
When you get to attend court, the judge will award the standard fines (and possible jail time) but also the cost of the time spent by the Radio Inspector in traveling to your town.
Mentioning that even this proof of concept is illegal is useful, as it isn't mentioned in the article. This is so easy to make that practically anyone could do it, which makes this very relevant.