react-native-serialport
react-native-serialport copied to clipboard
Can not connect to attached device
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!
React Native version: 0.63.3
Arduino Code:
Please help me
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. https://github.com/sessionm21/react-native-serialport/commit/baf59359d73aa2daabf5e6871b103f9d129ad985
You can also install directly from git
npm i git+https://github.com/sessionm21/react-native-serialport.git