This is a thread to gather some information about the efforts of using elixir in combination with cars or vehicular systems in general.
I’m really interested in this area and would love to use elixir and its eco system (e.g. Raspberry PI running nerves).
So far I’ve found the following:
Libraries:
NgCAN (a simple elixir library to read from and write to a CAN bus. since it uses socketCAN, it only runs on Linux.)
There must be something, as IIRC QuickCheck was used in the automotive industry for testing some systems. But I cannot tell anything more.
About NgCAN, it seems that with OTP 23+ (or 24+) you do not need C code, as you can use socket module instead (it allows any protocol ID, and these can be found via socket:supports/{0,2}).
Hey @fklement, did you make progress here? I’m converting a Ford Transit into a vanlife/tinyhome and am building a Nerves/Phoenix dashboard for management of lighting, heating, etc. I have an OBDLink MX+ bluetooth OBD-II reader and am attempting to query vehicle data. Did you find more prior art or develop a solution yourself?
Hi @skyler first of all sorry for the late reply.
No, I would have loved to. But I decided not to use nerves for my project.
Regarding reading CAN data, I have started to develop a small library to facilitate the candump tool for Linux. The library is called cannes (GitHub - fklement/cannes: A library for CAN written in Elixir) and is in a very early stage. But I plan to develop it further after I finish my master thesis next month.
(@pay64k This might be interesting for you to look into as well. Maybe we could work together to develop a unified CAN library for elixir. )
Thanks also to @pay64k for pointing out your project. I will definitely have a look at it.
Definitely, it would be nice to be able to use CAN library for projects that includes reading data form car’s ECU. My project uses ELM327, which has some hiccups from time to time - I don’t know wether it’s caused by poor quality of my adapter or by the fact that it’s not fast enough (or maybe it’s the ECU). Problems appear when, for example I try to read a lot of data in short intervals (like 250 ms). I believe that eliminating ELM and talking directly over CAN would be faster.
On the other hand, getting ELM is way cheaper then a specialised CAN module/connector for RPi for example. But hey, I’d definitely like a smoother data refresh on my dashboard