Giter Site home page Giter Site logo

mo-thunderz / esp32bluetoothapp Goto Github PK

View Code? Open in Web Editor NEW
51.0 4.0 17.0 573 KB

Simple code to communicate with an App on your Android phone (MIT App Inventor) to an ESP32 (Arduino). Works on Android Phones only. Please make sure that your ESP32 has integrated Bluetooth. Device used for coding: ESP32-WROOM-32D. Youtube explanation is available (see below).

License: MIT License

C++ 100.00%
arduino bluetooth esp32 mitappinventor

esp32bluetoothapp's Introduction

Esp32BluetoothApp Part 1

Simple code to communicate with an App on your Android phone (MIT App Inventor) to an ESP32 (Arduino). Works on Android Phones only. Please make sure that your ESP32 has integrated Bluetooth. Device used for coding: ESP32-WROOM-32D. Youtube explanation is available (see below).

For bi-directional communication, please refer to Part 2: https://github.com/mo-thunderz/Esp32BluetoothAppPart2

Installation

  1. Download all files from this repository (Esp32BluetoothApp)
  2. Program ESP32 with the "Esp32BluetoothApp.ino", located in the folders \Arduino\Esp32BluetoothApp
  3. Open the Bluetooth settings of your phone and scan here for devices (while the ESP32 is programmed and has power). You should find a device called "ESP32_Control". Select this device.
  4. navigate to https://appinventor.mit.edu/ and select "create Apps!" on the left top
  5. Select "Projects" on the top and then "import project (.aia) from my computer
  6. From the ESP32BluetoothApp repository, select the file "ESP32BluetoothApp.aia" located in the folder "MIT inventor"
  7. There are two ways to run the app: 7a) Ideal for debugging: on your phone goto your app store and install MIT AI2 Companion. You can then connect your phone to the computer by running this app and on your computer navigating to "Connect" -> AI Companion. This will give you a QR code on your computer screen that you can scan in the MIT AI2 Companion app on your phone. 7b) You can compile the ESP32BluetoothApp and install it on your phone by selecting "Build" -> App (provide QR code for .apk). This will give you a link to install the app on your phone.
  8. Run the app (with 7a or 7b), this will prompt a list of all Bluetooth devices you have configured in your phone: select "ESP32_Control" -> Please make sure you have done step 3 BEFORE running the app.
  9. There are two ways to test if everything works. 9a) you can open a serial monitor in your Arduino IDE and set the baud rate to 19200 9b) you can connect LEDs to pins 26, 27 and 14 (dont forget to put a resistor of ~100 ohms in series per LED)

How to use

https://www.youtube.com/watch?v=aM2ktMKAunw

Updates

  • 29.09.2022 - MIT App inventor updated the BluetoothClient without backward compatibility. As a result, the .aia file gave an error when loaded into MIT app inventor: "A problem occurred while loading this project. No upgrade strategy exists for BluetoothClient from version 6 to 7". I updated to the new BluetoothClient, but then I got the following error "need android.permission.BLUETOOTH_CONNECT permission". It turned out that the code now needs to ask for permission to use Bluetooth. Both problems are now fixed.

Have fun ;-)

mo thunderz

esp32bluetoothapp's People

Contributors

mo-thunderz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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

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.