Giter Club home page Giter Club logo

Comments (12)

hhk7734 avatar hhk7734 commented on September 13, 2024 3

Test environment

  • OS: Linux kernel 5.4, ubuntu 20.04 minimal
  • HW: s905x3 board

Thank you :)
flutter_gpiod works well.

from flutter-pi.

ardera avatar ardera commented on September 13, 2024 2

GPIO (more precisely, libgpiod) support is now integrated into flutter-pi.
The dart interface still needs some work. Once it's done, I'll publish it on pub.dev.

from flutter-pi.

ardera avatar ardera commented on September 13, 2024

Yeah, that's a good idea.

from flutter-pi.

akilinomendez avatar akilinomendez commented on September 13, 2024

Alternatively you can create a backend with flask or django and call with dio in flutter to execute gpio commands using python.

Is tested and working

from flutter-pi.

ardera avatar ardera commented on September 13, 2024

Alternatively you can create a backend with flask or django and call with dio in flutter to execute gpio commands using python.

Is tested and working

That's kinda overkill but yeah, sounds like that should be working.

I found a package that does exactly what you want: https://pub.dev/packages/rpi_gpio

Only works for Raspberry Pi though, while flutter-pi (despite its name) works on much more embedded devices.

EDIT: Seems like it's also not that easy to use, since it requires you to compile a shared library on the Pi.

from flutter-pi.

mortenboye avatar mortenboye commented on September 13, 2024

Here’s another vote for GPIO access (unless dart:ffi gets working soon)

from flutter-pi.

ardera avatar ardera commented on September 13, 2024

Here’s another vote for GPIO access (unless dart:ffi gets working soon)

Yeah actually I started work on GPIO access using dart:ffi and libgpiod a while ago, because it's probably faster than platform channels. Had basic functionality going & was ready to test, then I found out dart:ffi isn't yet supported on ARM hardfp platforms.

from flutter-pi.

mortenboye avatar mortenboye commented on September 13, 2024

Here’s another vote for GPIO access (unless dart:ffi gets working soon)

Yeah actually I started work on GPIO access using dart:ffi and libgpiod a while ago, because it's probably faster than platform channels. Had basic functionality going & was ready to test, then I found out dart:ffi isn't yet supported on ARM hardfp platforms.

So, how did you solve this challenge? Write a flutter plugin for GPIO?

from flutter-pi.

ardera avatar ardera commented on September 13, 2024

So, how did you solve this challenge? Write a flutter plugin for GPIO?

I didn't (yet).

from flutter-pi.

ardera avatar ardera commented on September 13, 2024

Just published it.

from flutter-pi.

mortenboye avatar mortenboye commented on September 13, 2024

dart:ffi seems to be working with hardfp by now, according to dart-lang/sdk@a71d60c

@ardera Any chance you could share your FFI based plugin for reference?

from flutter-pi.

ardera avatar ardera commented on September 13, 2024

dart:ffi seems to be working with hardfp by now, according to dart-lang/sdk@a71d60c

Nice! Keep in mind though that this feature is only available to flutter once the next stable version of the dart SDK (2.8) is released. I'll consider migrating the flutter_gpiod package to dart:ffi once that happens. That would mean a lot of the ugly async stuff, mutexes, etc in flutter_gpiod can go away.

@ardera Any chance you could share your FFI based plugin for reference?

Sure. The code is reaally ugly, very far from finished and doesn't look like the code of the flutter_gpiod package at all, though. I was just kinda experimenting.

flutter_gpiod_ffi.zip

from flutter-pi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.