问题描述:

I would like to get an advice about CAN bus communication with Android tablet. I am working in electrical vehicle project with colleague. We have CAN bus communication between BMS, inverter, control logics. And i need to get data like speed to the cluster. The cluster will be Android tablet. I have Arduino shield for CAN and bluetooth adapter to send data to tablet. I am fairly new to Android.

  • What should i start lookng for?
  • Would these OBD II codes work, because i need to send data too.

Edit

  • In your opinion, should i decode in arduino or pass CAN data to android and deal with it there? The data is COB ID/No. of bytes/ DATA. (601/ 8/ 22 98 60 00 22 00 00 00) And i am wondering were to deal with it. If for example first 2 bytes are lights, second are speed and so on. Or should i just split them by delimiter ' ' and the byte to int?
  • I am able to send data to CAN bus from android. I have CAN analyzer and the controller accepts it.

网友答案:

Based on your inputs. You will need to use your arduino to connect your android device to you vehicle. The arduino code will translate data from CAN to bluetooth and the other way around. Indeed your android device can't communicate directly to your CAN bus.

Then you will have to create your android application to send/receive data from the arduino. To do so take a look at the android bluetooth guide (it could also be possible to do the same with a wifi shield or an ethernet shield or over usb(mutch more difficult)).

For OBD II codes it depends on your vehicle if those are implemented on itself.

For data decoding:

  • Decode data on the android device. This way if you change your brige (here the arduino) your application still works.
  • Decode data on the arduino and this way your android application use high level commands but it will be strongly linked to your bridge implementation.
  • Decode with the language you are the most ease with.
网友答案:

Here is a simple solution here in an android-can bus adapter that allows an Android device to connect to a CAN bus.

相关阅读:
Top