Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can we compile gpiod package on vscode and upload to lineage android os? #5

Open
celalaslan2001 opened this issue Nov 20, 2021 · 12 comments

Comments

@celalaslan2001
Copy link

celalaslan2001 commented Nov 20, 2021

Hi Hannes Winkler!
I m very new on dart. Can you supply a brief explanation how can we compile and upload to a raspberry pi with lineage android os to use your gpiod package?
any reply at any time would be appreciated.
thanks for take yor time.
celal

@ardera
Copy link
Owner

ardera commented Nov 21, 2021

Hey, sure.

what exactly do you want to run on the Pi? Some flutter app?

If you want to use this package as part of a flutter app, just add it to pubspec.yaml as a dependency. See here. Rest of the procedure (deploying to the device, running, etc) is the same as for every other flutter android app, you can just follow the official docs there.

If you want to run a plain dart application on your pi, you'll have to add flutter_gpiod to your pubspec.yaml too, but I'm not sure how you deploy & run a plain dart application on android. It's probably possible somehow, but I've never attempted that

@celalaslan2001
Copy link
Author

thanks for your clear and patiencefull explanation,
Now i get an error message like
/c:/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_gpiod-0.4.0-nullsafety/lib/src/gpiod.dart:201:42: Error: Method not found: 'DynamicLibrary.dartopen'.
final libc = LibC(ffi.DynamicLibrary.dartopen("libc.so.6"));
There is no libc.so.6 file neither flutter directory nor project directory. Should libc.so.6 file be supplied from gpiod package or android OS?
thank you for your support.
celal

@ardera
Copy link
Owner

ardera commented Dec 10, 2021

can you try depending on this repo directly like this? It has some commits that aren't contained yet in the latest version.

There is no libc.so.6 file neither flutter directory nor project directory. Should libc.so.6 file be supplied from gpiod package or android OS?

It should be supplied by the android OS. It's called "libc.so" on android though, that's why flutter_gpiod couldn't find it. It's fixed in master (but not on pub.dev)

@celalaslan2001
Copy link
Author

Now problem was solved when i add the packages directly to pubspec.yaml like below.
flutter_gpiod:
path: /home/celal/Desktop/flutter_packages-main/packages/flutter_gpiod/

@celalaslan2001
Copy link
Author

Same problem occurs in linux_serial package. Error message like below.
E/flutter ( 4522): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libc.so.6': dlopen failed: library "libc.so.6" not found.
my pubspec.yaml like below.
linux_serial:
git:
url: https://github.com/ardera/flutter_packages.git
ref: main
path: packages/linux_serial/

@ardera
Copy link
Owner

ardera commented Feb 18, 2022

my bad, forgot about this. Yes right now linux_serial is not supported on android, but I can make it work there.

@plabon5150
Copy link

Could not open GPIO chip 0, path = '/dev/gpiochip0' showing on lineage android os

@ardera
Copy link
Owner

ardera commented Dec 5, 2022

@plabon5150 Do you have root permissions?

@plabon5150
Copy link

yes..i double check its have

@plabon5150
Copy link

plabon5150 commented Dec 6, 2022

this is the link where i found one solution.can you please check @ardera

lineage-rpi/android_kernel_brcm_rpi#19 (comment)

@plabon5150
Copy link

@ardera I need your help. can you please help me to resolve this issue?

@ardera
Copy link
Owner

ardera commented Dec 9, 2022

@plabon5150 Can you try this: ardera/flutter_gpiod#9 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants