ardera / flutter_packages

My collected packages for pub.dev
MIT License
28 stars 7 forks source link

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

Open celalaslan2001 opened 2 years ago

celalaslan2001 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

plabon5150 commented 1 year ago

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

ardera commented 1 year ago

@plabon5150 Do you have root permissions?

plabon5150 commented 1 year ago

yes..i double check its have

plabon5150 commented 1 year ago

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

https://github.com/lineage-rpi/android_kernel_brcm_rpi/issues/19#issuecomment-944869396

plabon5150 commented 1 year ago

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

ardera commented 1 year ago

@plabon5150 Can you try this: https://github.com/ardera/flutter_gpiod/issues/9#issuecomment-689112840