Elixir Wizards is an interview-format podcast, focused on engineers who use the Elixir programming language. Initially launched in early 2019, each season focuses on a specific topic or topics, with each interview focusing on the guest's experience and opinions on the topic. Elixir Wizards is hosted by Eric Oestrich and Sundi Myint of SmartLogic, a dev shop that’s been building custom software since 2005 and running Elixir applications in production since 2015. Learn more about how SmartLogic uses Phoenix and Elixir. (https://smartlogic.io/phoenix-and-elixir?utm_source=podcast)

Creating VintageCell: Nerves, PCBs, and GenStateMachine with Bryan Green

October 24, 2024 28:58 42.84 MB Downloads: 0

Today on Elixir Wizards, Bryan Green shares how he transformed a vintage 1930s rotary phone into a fully functional cell phone using Elixir, Nerves, and a mix of hardware components.

Bryan shares the highs and lows of his project, from decoding rotary dial clicks to troubleshooting hardware issues with LED outputs. He explains why Nerves was the perfect fit for this project, offering SSH access, over-the-air updates, and remote debugging. You’ll also hear how Elixir’s concurrency model helped him manage hardware inputs and outputs efficiently using GenStateMachine and Genservers.

Elixir and Nerves really shine when modeling real-world systems. Bryan dives into how he used a finite state machine to track the phone’s states and handled inputs from the rotary dial and hook switch via GPIO.

For hardware enthusiasts, Bryan’s advice is to embrace this “golden age” of DIY electronics. Whether you're experienced with embedded systems or just curious on where to start, Bryan's VintageCell can inspire you to tinker with a hardware engineering project.

Key topics discussed in this episode:

  • Advantages of functional programming and immutability in Elixir
  • Building hardware projects using Adafruit components
  • Why Nerves was the best choice for the VintageCell project
  • Interpreting rotary dial clicks using GPIO and circuits.gpio
  • Troubleshooting hardware issues with LED diagnostics
  • Challenges in optimizing wiring and PCB design
  • Benefits of Nerves: SSH access, OTA updates, and remote debugging
  • Modeling real-world systems with Elixir and Nerves
  • Implementing a finite state machine with GenStateMachine
  • Managing input with Genservers for rotary dial and hook switch
  • Leveraging community resources like Discord, Elixir Slack, and forums
  • Practical advice for keeping hardware projects on track
  • Potential applications from SMS servers to home automation

Links mentioned:

Vintage Cellphone: Bridging the Past and Future with Elixir
Seven Languages in Seven Weeks https://pragprog.com/titles/btlang/seven-languages-in-seven-weeks/
Seven More Languages https://pragprog.com/titles/7lang/seven-more-languages-in-seven-weeks/
Node.js https://github.com/nodejs
https://nerves-project.org/
https://www.arduino.cc/
Adafruit Circuit Playground https://www.adafruit.com/category/965
Adafruit 3D Printed Star Trek Communicator https://learn.adafruit.com/3d-printed-star-trek-communicator
Adafruit FONA 3G Cellular + GPS Breakout https://learn.adafruit.com/adafruit-fona-3g-cellular-gps-breakout/overview
https://github.com/elixir-circuits/circuits_gpio
Nerves SSH https://hex.pm/packages/nerves_ssh
OTA (over-the-air) Updates with NervesHub https://www.nerves-hub.org/
https://github.com/kicad
Waveshare 4G Hat for Raspberry Pi https://www.waveshare.com/sim7600e-h-4g-hat.htm
https://hexdocs.pm/gen_state_machine/GenStateMachine.html
https://hexdocs.pm/elixir/GenServer.html
https://www.sparkfun.com/
https://www.digikey.com/
USB-C Gadget Mode with Nerves https://github.com/nerves-project/nerves_system_rpi4/issues/18
https://livebook.dev/
https://codestorm.me/
https://github.com/codestorm1/vintage_cell/

Special Guest: Bryan Green.