Elixir+Nerves for controlling your car (Part 1)

iex(1)> Nerves.UART.enumerate()
"/dev/cu.Bluetooth-Incoming-Port" => %{},
"/dev/cu.CHX-DevB" => %{},
"/dev/cu.SLAB_USBtoUART" => %{
manufacturer: "Silicon Labs",
product_id: 60000,
serial_number: "R.Resler IBUS Interface V6b - Serial:20170918000441002322",
vendor_id: 4292
{:ok, _pid} = Nerves.UART.start_link(name: Ibus.Serial)    :ok = Nerves.UART.open(Ibus.Serial, “/dev/cu.SLAB_USBtoUART”, active: true, speed: 9600, parity: :even)
➜  bmw_bot master ✓ iex -S mix
Erlang/OTP 20 [erts-9.3] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:10] [hipe] [kernel-poll:false] [dtrace]
12:07:16.780 [debug] Elixir.Ibus.UART: Start serial port12:07:16.788 [debug] Elixir.Ibus.UART: Open serial connection12:07:16.790 [debug] Elixir.Ibus.UART: Start serial reader12:07:16.790 [debug] Elixir.Ibus.UART: Finish configure12:07:16.790 [debug] Elixir.Ibus.Device.CD: Sending annoounce message
Interactive Elixir (1.6.4) - press Ctrl+C to exit (type h() ENTER for help)
12:08:35.458 [debug] Elixir.Ibus.Device.CD: Handled message 0x68 0x05 0x18 0x38 0x01 0x00 0x4C
iex(1)> Ibus.Device.Tel.send_text("Hello Medium")

Konstantin Zolotarev

Written by

Web Developer. Node.js/Elixir/Golang user.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade