Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can not connect to attached device #32

Open
sharqawiDev opened this issue Nov 17, 2020 · 1 comment
Open

Can not connect to attached device #32

sharqawiDev opened this issue Nov 17, 2020 · 1 comment

Comments

@sharqawiDev
Copy link

I'm using the manual connection example, and I've Arduino Uno attached to my mobile (Galaxy S8+), but I can not connect to the attached device!

photo_2020-11-18_01-46-48

React Native version: 0.63.3

Arduino Code:

image

Please help me

@sessions-matthew
Copy link

I had make some modifications to get the library to work in my project, I only need to connect to the first device that is already connected so I use my fork and I hard-code the connection like so:

fillDeviceList() {
  RNSerialport.getDeviceList().then((response => {
    if (response[0].status) {
      this.setState({ deviceList: response, selectedDevice: response[0]}, ()=>{
        this.connectDevice().then(()=>{console.log("CONNECTED");});
      });
    }
  }));
}

See this commit for the modification that I make to the library, I only had to change one line within the library itself.
sessions-matthew@baf5935

You can also install directly from git

npm i git+https://github.com/sessionm21/react-native-serialport.git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants