Giter Site home page Giter Site logo

alvarowolfx / ble-rgb-light-flutter Goto Github PK

View Code? Open in Web Editor NEW
20.0 4.0 4.0 71 KB

Control a RGB Led Light over Bluetooth LE using a Flutter app

Home Page: https://twitter.com/alvaroviebrantz/status/1249181634815016961?s=21

Shell 0.82% C 43.21% C++ 0.41% CMake 0.77% Kotlin 1.46% Ruby 12.01% Swift 1.41% Objective-C 0.13% Dart 39.77%
iot flutter bluetooth ble internet-of-things app

ble-rgb-light-flutter's Introduction

BLE RGB Light and Flutter

End goal of this project is to control an RGB LED Light over BLE using a Flutter App.

This is a Work in Progress.

Technologies used here

  • Firmware is Based on Zephyr RTOS
    • Developed using PlatformIO with Zephyr support
  • Flutter
  • NRF52840 Dongle
    • More details
    • An ESP32 version will be pushed later. It's going to be easier, but I wanted to learn to work with a newer board/environment.

The board will present an Nordic UART Service over BLE, that is basically an serial communication over BLE. The board is going to accept the command in json format and reply back the state in json format.

Spec for commands:

{
  color : "FFFFFF"
}

Spec for state:

{
  color : "FFFFFF",
  r : 255,
  g : 255,
  b : 255
}

Required Materials

  • Only the NRF52840 Dongle
    • The board already have a built-in RGB LED

Installing the firmware

  • Need nrfutil installed - Instructions
  • Open the firmware folder on PlatformIO and run the Build command.
    • After the build command, the hex file will be generated and it's required for the next step.
  • Put the board into bootloader mode (Press the reset button and the board will start to blink red slowly).
  • Find your board serial port.
    • Run ls /dev/tty.*. Mine for example was /dev/tty.usbmodemF4DF6C998E5A1
  • Run the flash.sh script with your port as a parameteer, that basically uses nrfutil to pack and write the firmware.
./flash.sh /dev/tty.usbmodemF4DF6C998E5A1

Flutter App

App code is on the ble_rgb_lamp folder. The code right is super ugly and hacky, I'll separate it in more files to make it more understandable.

References

ble-rgb-light-flutter's People

Contributors

alvarowolfx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ble-rgb-light-flutter's Issues

How can i change led colors ?

I am using SP107E music led controller. Connecting via bluetooth but i cant send any data to device. I just want to change led colors. How can i do that ? If you give me any idea i will be grateful.

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.