react-native-serial-port-api
react-native-serial-port-api copied to clipboard
No permission to read or write this serial port even after setting suPath Android.
Getting "No permission to read or write this serial port" Error while trying to read serial port.But After setting the su path, the app does not run at all. It stops on a white screen and "BUNDLE ./index.js" command dosen't move ahead. (/system/xbin/su is my root path)
Code snippet: - SerialPortAPI.setSuPath("/system/xbin/su"); let serialPort = await SerialPortAPI.open("/dev/ttyS1", { baudRate: 9600 }) serialPort.onReceived(buff => { setData(buff.toString('hex').toUpperCase()); }) } catch (error) { console.log(error.message) setData(error.message); }