Giter Site home page Giter Site logo

spoutnik97 / react-native-arduino-ble-example Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 32.0 289 KB

An example of communication between a BLE module connected to an Arduino and a React Native application

JavaScript 18.85% TypeScript 35.06% C++ 10.44% C 7.48% Starlark 1.40% Java 14.52% Objective-C 10.27% Ruby 1.98%

react-native-arduino-ble-example's People

Contributors

spoutnik97 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

Watchers

 avatar  avatar  avatar

react-native-arduino-ble-example's Issues

Permission to access location on Android n/a

tried to run this example on Pixel 3A Android phone, kept getting permission denied errors, found articles about adding a PermissionsAndroid function to request permission for coarse location, which prompted for the permission, but when allowed i received the access granted log, but the scan still reported denied ble permission

I'm a complete newbie with React-native, so might be entirely doing something wrong.

code as follows:

    ```
    const requestBlePermission = async () => {
      try {
        const granted = await PermissionsAndroid.request(
          PermissionsAndroid.PERMISSIONS.ACCESS_COARSE_LOCATION,
          {
            title: "Bluetooth location position",
            message:
              "Grant access to coarse location for ble",
            buttonNeutral: "Ask Me Later",
            buttonNegative: "Cancel",
            buttonPositive: "OK"
          }
        );
        if (granted === PermissionsAndroid.RESULTS.GRANTED) {
          console.log("access granted");
        } else {
          console.log("access denied");
        }
      } catch (err) {
        console.warn(err);
      }
    };
    ```

Then in the ListHeaderComponent i have a button with the following:

    ```
    <View style={styles.sectionContainer}>
            <Text>Try permissions</Text>
            <Button title="request permissions" onPress={requestBlePermission} />
    </View>
    ```

PROBLEM TO CONNECT TO A BLE DEVICE

Im having a problem to connect this app to a ble device. They dont receive the data from device and have some bugs to show the characteristic of the device.

Code not running

Code builds for me but then refuses to render anything. Do you have any advice on what to do for the following error message
debug
?

Writing Back to BLE module is failing

hey @Spoutnik97 ,

this is how characteristic is setup in arduino for writing purpose

ble.println(F("AT+GATTADDCHAR=UUID=0x2A19,PROPERTIES=0x08,MIN_LEN=1,DESCRIPTION=Elevation,VALUE=0"));

when writing from mobile app to BLE module, i get following error

[BleError: Characteristic 00002a19-0000-1000-8000-00805f9b34fb write failed for device 62AB8388-FBA9-52AE-ECDE-53149D5147E0 and service 0000160f-0000-1000-8000-00805f9b34fb]

Graphing data from gps sensor with Arduino with react-native React-native-ble-plx

hi.

I made a connection to the arduino nano 33 ble sense card using this example. There is a gps sensor connected to the development board and it can send some parameters to the phone right now. But I want to parse the data and show it on the screen in graphic form. how can I do that? I looked through the library files and the code. data is using separate service and characteristic uuid.

Possible Unhandled Promise Rejection (id:0): ERROR

Hello there. I tried the sample code in my own application and the connection was made. I can receive data from my Arduino, but after a while it disconnects by itself and I encounter error codes due to disconnection.image
What is the reason for it shutting down on its own?

image

image

At the same time, when I press the (disconnect) button and want to return, the system throws me back, but when I want to connect again, I encounter an error.

image

Thank you.

Schema Diagrams

@Spoutnik97 Great article. I got same hardware as you described in article. I am getting this error from hardware side "Couldn't find Bluefruit, make sure it's in CoMmanD mode & check wiring?" do you mind sharing detail schema diagrams ? i think i might not have correct wiring between bluetooth module and UNO R3 ?

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.