Posts: 13
Threads: 1
Likes Received: 0 in 0 posts
Likes Given: 7
Joined: Oct 2018
10-22-2018, 04:47 AM
(This post was last modified: 10-22-2018, 04:47 AM by vivekb.)
Hi Lobo
Thank you so much for the libraries. I tried using it for gpio and it works great. However, while trying to use it for serial communication, I am facing some issues.
While doing a serialOpen(), I always get '-1' as the return value, irrespective of which file I pass - /dev/ttys0, /dev/ttys1, /dev/ttyAMA0, etc.
But when I open a terminal and use this command:
echo -ne '\033[2J' > /dev/ttyS1
The data is transmitted over serial port on pins 8 and 10 with a baud rate of 9600. Is there something that has to be done and I am not doing it? Please let me know. Thanks in advance
•
Posts: 220
Threads: 4
Likes Received: 25 in 23 posts
Likes Given: 3
Joined: Sep 2017
Hi viveKB,
I tried now to integrate the serial part into an app and it works so far. I think you missed to chmod the serial port:
Code:
chmod 666 /dev/ttyS1
If you need this at start, I see the only working solution so far to extract the boot.img and to modify the ueventd.rk30board.rc. Please see my thread libGPS
https://tinkerboarding.co.uk/forum/thread-671.html for details.
The following 1 user Likes lobo's post:1 user Likes lobo's post
• vivekb
Posts: 4
Threads: 0
Likes Received: 0 in 0 posts
Likes Given: 1
Joined: Jan 2019
01-03-2019, 10:54 AM
(This post was last modified: 01-03-2019, 01:19 PM by knobtviker. Edited 1 time in total.)
Hi,
I may be new here but I come from slow world of RPi and Android Things.
I'll get to the point straight away.
I followed all instructions to the letter about compiling and deploying these shared libraries.
I included them into my Android app and as far as I can see, wpi_android is loaded by the system.
However, when i invoke any method or function, my app just ends up in an endless loop.
This might seem a bit vague, but have you got any clues or have you encountered this before?
How can I check if /dev/mem can be accessed?
I see no /dev/gpiomem present on filesystem but I am using 7.1.2 kernel which should have that implemented by default since April 2018.
Any help would be greatly appriciated, thanks!
EDIT:
I stand corrected, with a few corrections, your work actually does work. My addition of I2C is failing for some reason.
•
Posts: 220
Threads: 4
Likes Received: 25 in 23 posts
Likes Given: 3
Joined: Sep 2017
Ok, I was just looking into this. Maybe you need to chmod 666 the i2c device, if not you probably need su in your app.
Posts: 4
Threads: 0
Likes Received: 0 in 0 posts
Likes Given: 1
Joined: Jan 2019
01-04-2019, 07:37 AM
(This post was last modified: 01-04-2019, 07:38 AM by knobtviker. Edited 1 time in total.)
I think you should continue looking into I2C support. I'm sort of stuck at code level now, providing all WiringPi I2C functions through JNI.
Regarding su, I cross compiled i2c-tools for Android and i2cdetect works without root.
Code:
rk3288:/ # i2cdetect -y 1
0 1 2 3 4 5 6 7 8 9 a b c d e f
00: -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- 13 -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- 39 -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
50: 50 -- -- -- -- -- -- 57 -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- --
70: -- -- -- -- -- -- 76 77
It is correct data on bus 1, although I have no idea why 0x68 is reserved. That was my DS3231 RTC.
•
Posts: 4
Threads: 0
Likes Received: 0 in 0 posts
Likes Given: 1
Joined: Jan 2019
(01-03-2019, 05:30 PM)lobo Wrote: Ok, I was just looking into this. Maybe you need to chmod 666 the i2c device, if not you probably need su in your app.
You were right, it seems. After I chmod 666 /dev/i2c-1 app doesn't crash and I can read out a test value of a chip and verify it actually works.
How can I make this permission change permanent and persistent after reboot?
•
Posts: 220
Threads: 4
Likes Received: 25 in 23 posts
Likes Given: 3
Joined: Sep 2017
You can look here into my post:
https://tinkerboarding.co.uk/forum/threa...ml#pid2585
Note that the SuperUser alternative is no option on Android Nougat, as no one since now was able to install it as on Marshmallow. To root the Android Nougat, the only working solution so far I know is:
https://tinkerboarding.co.uk/forum/thread-2026.html . So it seems that you need to go the way to modify and flash the boot.img. If you consider to install Magisk, you can can take a look at the module 'Init.d Enabler'.
•
Posts: 985
Threads: 22
Likes Received: 68 in 60 posts
Likes Given: 12
Joined: Jul 2018
(01-04-2019, 09:00 AM)knobtviker Wrote: How can I make this permission change permanent and persistent after reboot?
Writing an
udev rule
Light blue words might be a link. Have you try to click on them?
•
Posts: 220
Threads: 4
Likes Received: 25 in 23 posts
Likes Given: 3
Joined: Sep 2017
I have updated the repository, because old version don't work with Android 7.1.2.
https://github.com/joerg65/wiringTinker_Android
•
Posts: 1
Threads: 0
Likes Received: 0 in 0 posts
Likes Given: 0
Joined: Jan 2019
Good News! Thanks
I have to use gbwhatsapp for android
here and I think this is the best app because this app features so nice and I prefer to use this app.
•