4 ms·
Is it feasible to build a modem out of a Raspberry Pi Zero or an Arduino? You'd need to hook the phone line to the GPIO pins, do the ADC and DAC stuff in softwa
by msla 3y ago
Is it feasible to build a modem out of a Raspberry Pi Zero or an Arduino? You'd need to hook the phone line to the GPIO pins, do the ADC and DAC stuff in software, implement the V.22 protocol in software, and also implement the Hayes Smartmodem stuff in software, meaning this is one of the few times a Hacker News reader would have occasion to implement the Hayes Code. Is there any show-stopping problem I'm not seeing? Massive electrical incompatibility?
- foldr 3y agoPhone lines operate at way above 5V, so you'd need some level shifting at least.
- mtve 3y ago9V battery was enough for two modems to communicate back-to-back, without dial tone or ringing signals, just "ATD" command on one and "ATA" on another.
- missjellyfish 3y agoTelephone Line Voltage is anywhere between 48 to 90V DC, depending on where in the world you are and which standards apply.
- BizarroLand 3y agoI've experienced the joy of having live telephone wire in my mouth and receiving a phone call. That was an electrifying experience. I was living in a ramshackle house and I wanted dial up internet so I went to the phone company, paid the deposit, and activated my home phone. Got back home, set up my computer, started looking for the phone line. No phone line. Went to the store, bought the phone jack and some cable, hooked it up to the box outside, fished it through the wall. No wire stripper. Not going to go to the store for a cheap wire stripper when I have teeth. Bit into the wire, stripped the first one. Bit into the wire. Stripped the second one. Third one. Bit into the fourth one and got my world rocked. Duh. Stupid. Phone is live. Hooked everything up, plugged in a phone and it immediately rang. I answered, "Hello?" Some woman: "I've been calling you for hours now! Where is Jake?!" "I don't know a Jake" "Stop lying! I know you know Jake!" "Ma'am, I just turned this phone line on a few hours ago. I don't know Jake. You've got the wrong number" "Oh, well, if you see Jake tell him I'm looking for him." "Will do..." This woman was calling my new number and fried the stupid out of my mouth looking for some guy. Strange coincidences abound.
- mikewarot 3y agoYou need a "hybrid network" to connect to the telephone system. You'll also need a relay to take it off hook, etc. There can also be hundreds of volts on the line at various times, not to mention induced voltages during storms. Once you've handled that, it should be fairly easy to generate the right signals and do handshaking. An RP2040 / raspberry pi pico should be more than adequate.
- rasz 3y ago"break-out board for AMR modem riser" https://osmocom.org/issues/5294 https://osmocom.org/issues/5294 Status changed from Stalled to Resolved % Done changed from 80 to 100 "The break-out board has been verified by tnt at CCC Camp 2023, where he successfully transmitted a Fax (using spandsp) via pulseaudio - alsa - usb-audio - iCE40 FPGA - AMR riser. Closing."
- bluGill 3y agoYou need a bit more hardware (see other posts), but most modems from the late 1990s until laptops stopped coming with a modem worked this way - using the CPU which was probably slower than a pi to do the work. Such models basically never worked in linux (I'm not sure why), they didn't have the best reputation as far as quality but they worked.
- sumtechguy 3y ago> I'm not sure why If I remember correctly as most of them were DSPs and need a driver to load a binary blob to work correctly. All of them had their own spin on the process. Most linux distros did not ship the blobs either. So you would have a bit of fun cracking it out of some random windows EXE just so you could put it somewhere the driver could reach it. It was worth the extra 20-50 bucks it would cost just to not buy one of those things and use it in linnx. Remember this was at a time when a bit of ram (1MB) would cost 100+ dollars. There was a reason they were cheap. They did not have enough hardware to run standalone and relied on the OS to do the loader work.
- _Microft 3y agoThis was called a "softmodem": https://en.wikipedia.org/wiki/Softmodem https://en.wikipedia.org/wiki/Softmodem
- retrac 3y agoYou'll need some analog circuitry. Not much, but phone service has some kinks electrically speaking. A phone on-the-hook appears like an open circuit to direct current. Off-the-hook the circuit is closed, and current starts flowing. (Pulse dialing and "flash" signals open/close the circuit, telegraph style.) And ringing on POTS is done by applying about 20 Hz AC to the line at around 100 volts -- enough to make an electric motor ring a bell, or unpleasantly surprise someone playing with the "low voltage" phone line. So you need to block the AC ringing (and other spikes), block the DC bias voltage (while presenting a phone-like impedance to the line), and then join both the DAC and ADC to the same two-wire line with matched impedance. It could be anywhere from a couple transformers and a few resistors and caps, to a very complicated arrangement with amplifiers, active noise cancelling and gain control circuits, etc. (There used to be dedicated ICs for those things.) POTS, by its analog nature, is extremely flexible in practice. A couple 9V batteries are often enough to make two old phones work as intercoms. But the faster you want to go the more important it will be to match the expectations of a POTS line exactly.
- rasz 3y agoThis will get you started: Tony Fisher wrote V.32 soft modem stack for SGI Indy back in 1996. York University couldnt handle hosting whole 8 megabytes of his stuff https://www.cs.york.ac.uk/news/fisher/home-page https://www.cs.york.ac.uk/news/fisher/home-page but at least they had the decency to upload it to github instead of just deleting https://github.com/university-of-york/cs-www-users-fisher/tree/master/software/modem https://github.com/university-of-york/cs-www-users-fisher/tr... Randy Rossi rewrote this project and got working V.21/23 https://github.com/randyrossi/fisher-modem https://github.com/randyrossi/fisher-modem Fabrice Bellard, because of course he did :), implemented his own version all the way to V.34 with parts of V.90 https://bellard.org/linmodem/ https://bellard.org/linmodem/ Currently actively maintained by Osmocom project https://osmocom.org/projects/linmodem https://osmocom.org/projects/linmodem "In Late 2021 we started a project to support AMR_Modem_Riser cards via a custom break-out board (#5294) and an associated FPGA softcore to interface the AC97 master interface with USB (audio)." V.21 modem implemented in Gnu Radio https://web.archive.org/web/20170627151353/http://aaronscher.com/GNU_Radio_Companion_Collection/Audio_Modem_loop_back_test_FSK.html https://web.archive.org/web/20170627151353/http://aaronscher... amodem - good source of ready made modulation implementations https://github.com/romanz/amodem https://github.com/romanz/amodem minimodem- simple radio link FSK modem https://github.com/kamalmostafa/minimodem https://github.com/kamalmostafa/minimodem audsl - leased line project, not compatible with standard modems https://www.araneus.fi/audsl/ https://www.araneus.fi/audsl/ but might give some ideas.