Hi, Unfortunately, I have had bad experiences to connect my Raspberry Pi 4 to Bluetooth or USB, and I don’t know why even Nerves
framework is handy and seems a good framework that has no lib can be easy configured.
I do not want to be rude and on the contrary I am very interested and also grateful, and I hoped I could even have a good understanding developing and help this team, I feared this answer :(. I’m wondering why there is so poor commitment for Bluetooth
in open-source.
Problem
I want to create a software to connect OBD cable that gets my car data from ECU. So I have two options to connect to the car, first Bluetooth and second USB, But Bluetooth is more important for me.
Step one
At first, I found this post that suggested to use Harald library. I have read its documents and install in my Raspberry, but when I connect to my device and test its document codes, I have this error.
iex(1)> {:ok, pid} = Harald.start_link(id: :bt, adapter: Harald.Transport.UART)
{:ok, #PID<0.1223.0>}
** (EXIT from #PID<0.1220.0>) shell process exited with reason: an exception was raised:
** (UndefinedFunctionError) function Harald.Transport.UART.setup/1 is undefined (module Harald.Transport.UART is not available)
Harald.Transport.UART.setup([transport_pid: #PID<0.1223.0>])
(harald 0.3.0) lib/harald/hci/transport.ex:51: Harald.HCI.Transport.handle_continue/2
(stdlib 3.17) gen_server.erl:695: :gen_server.try_dispatch/4
(stdlib 3.17) gen_server.erl:437: :gen_server.loop/7
(stdlib 3.17) proc_lib.erl:226: :proc_lib.init_p_do_apply/3
I couldn’t find anything in its documents, if there is an extra library that I am force to install or not.
Step two
When I have completely disappointment, then I have tested blue_heron library which has no documents, and they just have put a sample code for Raspberry Pi 0 and I have tried to use even this lib said it is not compatible for the 4 version.
This plugin has 2 subprojects which should be installed like URT
and I think USB
, but these libs
especially URT has conflict with main lib.
Last chance
Finally, I think I should use the C
programming language libraries with the help of Nifs
and create a wrapper. But I have no experience on C
, and I do not know what libraries exist in there.
IF you have any suggestion, please help me to solve this problem.
Thank you