|
Edited by valspakonto at 2018-11-8 22:18
Hi all.
I'm researching the Orange Pi 3G-IoT for my client's purposes.
I'm wondering what I need to do to make accelerometer work on this board. It has everything we need except accelerometer and this is essential to this project.
The final solution will be deployed on over 30000 places, so price matters, and that's why this particular board is potential candidate, so please don't recommend any other boards if they are 2x more expensive.
So, to the question:
I'm trying to connect ADXL345 accelerometer (but can be any other cheap one, but must be accessible in large quantities),
My orange pi does have the following devices under /sys/bus/i2c/devices:
- 0-007f
- 1-0026
- 1-0040
- 1-0050
- 1-0055
- i2c-0
- i2c-1
Copy code
but does NOT have i2c devices under /dev folder. In fact, it does not have even /dev/i2c folder. I assume this is due to lack of i2c-dev module.
i2cdump tool looks for devices in the /dev/i2c/ folder and this can't work, obviously.
I looked for the scraps of the documentation on the web and found entry telling about compiling the android system and specifically about file "ProjectConfig.mk".
- CUSTOM_KERNEL_ACCELEROMETER = adxl345
Copy code
I've downloaded the whole source from the OrangePi MEGA cloud and found there that flag in ProjectConfig.mk
- CUSTOM_KERNEL_ACCELEROMETER = mir3da #KXTJ2-1009
Copy code And that's right. Android system claims it has the Kionix KXTJ2-1009 accelerometer though on board there are no accelerometers.
In the source I saw there is already some code for ADXL345, but I'm still unsure how to use it.
My questions are:
1. If I change the CUSTOM_KERNEL_ACCELEROMETER to adxl345 and compile android, will it work? And will it automatically make android system seeing the ADXL345 accelerometer as one of the sensors in the SensorManager API?
2. I found on some sites that I need to compile i2c-dev module to the kernel if I want to have devices shown under /dev/i2c/ - is that right? Do I need it if I just change the CUSTOM_KERNEL_ACCELEROMETER?
3. If i2c-dev is necessary, could anyone point me at the right direction how to compile it and add the module to the kernel? I saw source codes somewhere, but I didn't do that yet. I tried i2c-dev precompiled by someone, but it was for lychee build, and obviously, didn't work.
4. Maybe I'm missing something? Maybe I'm completely wrong and need to do something else to make it work?
Thanks in advance
|
|