Accessing Raspberry Pi peripherals
Hello,
I have installed Emteria OS on my raspberry pi 4B. I want to use various sensors like GPS to get the coordinates and display it. GPS sensor works on UART. How should I go about it? My major concern is how do I access and read the UART ports on Emteria android OS.
Thanks
0
Comments
Hi @GeekElectronic
For GPS we've included this driver: https://github.com/emteria/hardware_generic_gps
We also have an older example how to access GPIOs: https://github.com/emteria/samples_apps_Serial
I think these two sources might already help
Thank you so much for sharing the links. I will go through it and let you know if any help is needed.
I am not getting exactly what should be the steps. For the GPS driver it mentions : 'To set serial port, add a property "ro.kernel.android.gps" and set it equal to your GPS device file. ie. ro.kernel.android.gps=ttyO1'
Do I need to do the following changes on Android Studio?
I am new to this development. Can you please elaborate the process or can you share any links to learn this from ground up.
Thank you so much for your help
I have exactly the same question. Have you been able to get a GPS to work?
build.prop on the system seems to have the correct device. If I cat that port, I see the GPS sentences in adb shell. But the correct location is not available to applications.
Also, is there some tutorial on how to edit build.prop in the Emteria OS?
I've spent hours searching the internet and none of the suggested mechanisms for editing build.prop seem to work. I keep getting read-only filesystem, and trying to remount the system as rw simply doesn't work. /system is not a mount, and I've been unable to mount system_ext as rw.
RPi 4B, Emteria Android 14.1
@GeekElectronic As mentioned the driver is already integrated, the properties should also already be set accordingly. The device is ttyACM0
Sorry we don't have any tutorials from ground up. There are plenty of Linux tutorials about this, I suggest to start there as most of this knowledge is transferable to Android.
@dpv probably not possible in user builds. What value are you trying to alter? Is something set incorrectly?
@smieschek thanks for the reply.
The GPS location is not being correctly sent to applications requesting location. I was trying to set the baud rate to 115200 to see if that will help.
When I cat /dev/ttyACM0, I get the correct sentences and location from the GPS device. However, in Android applications, the location is at Google's headquarters in California. So the Emteria driver is not reading the location.
Where exactly is the build.prop file located? I have found several. How can I set the GPS parameters?
@smieschek is there any restriction for using a GPS device in the evaluation versions? I'm running an activated evaluation version of the OS to see if it will meet our needs.
@smieschek I've been unable to get past the GPS issue. I've downgraded the OS to 13.5, but still the GPS location is not available in Android.
Do you have any other suggestions?
FYI, downgrading to 13.5 did fix the "connection refused" VNC issue I've had on 14.1.
I gave up on this. No support from Emteria in this forum, and no solution on that I could find.
I am reading data in our application from the GPS device (/dev/ttyACM0) and parsing the NMEA sentences to get location.
I would be very interested in hearing from ANYONE that got GPS location working in Emteria OS as suggested in the documentation.
@dpv
I'm sorry, as a startup we have limited resources and our support in the forum is on best effort.
It might be that the GPS integration wasn't realized in 13/14. Reading out the /dev/ttyACM0 directly seems to be a good solution for the time being. If you need it in Android to be available for other apps, please reach out to sales@emteria.com for an estimate