flutter_packages icon indicating copy to clipboard operation
flutter_packages copied to clipboard

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

Open celalaslan2001 opened this issue 3 years ago • 12 comments

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

celalaslan2001 avatar Nov 20 '21 23:11 celalaslan2001

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

ardera avatar Nov 21 '21 12:11 ardera

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

celalaslan2001 avatar Dec 10 '21 09:12 celalaslan2001

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)

ardera avatar Dec 10 '21 13:12 ardera

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 avatar Dec 15 '21 11:12 celalaslan2001

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/

celalaslan2001 avatar Dec 15 '21 12:12 celalaslan2001

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

ardera avatar Feb 18 '22 07:02 ardera

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

plabon5150 avatar Dec 05 '22 11:12 plabon5150

@plabon5150 Do you have root permissions?

ardera avatar Dec 05 '22 13:12 ardera

yes..i double check its have

plabon5150 avatar Dec 06 '22 01:12 plabon5150

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 avatar Dec 06 '22 08:12 plabon5150

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

plabon5150 avatar Dec 08 '22 03:12 plabon5150

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

ardera avatar Dec 09 '22 21:12 ardera