I can not read the value that comes from the Arduino to Cordova

0

Good morning,

I have an application in Cordova. I want to connect it to arduino via bluetooth. I can not receive the value that comes from the Arduino

var macAddress = "00:06:66:4D:00:00";

var app = {
    initialize: function () {
        this.bindEvents();
    },
    bindEvents: function () {
        document.addEventListener('deviceready', this.onDeviceReady, false);
    },
    onDeviceReady: function () {
        bluetoothSerial.connect(macAddress, app.onConnect, app.onDisconnect);
    },
    onConnect: function () {
        statusDiv.innerHTML = "Connected to " + macAddress + ".";
        bluetoothSerial.subscribe("\n", app.onMessage, app.subscribeFailed);
        bluetoothSerial.read(function (data) { console.log(data, 'read'); }, app.subscribeFailed);
    },
    onDisconnect: function () {
        alert("Disconnected");
        statusDiv.innerHTML = "Disconnected.";
    },
    onMessage: function (data) {
        console.log(data, 'onMessage');
        counter.innerHTML = data;
    },
    subscribeFailed: function () {
        alert("subscribe failed");
    }
};

The console gives me this:

 The key "target-densitydpi" is not supported. (index):65 
 adding proxy for Battery (index):65 
 adding proxy for Camera (index):65 
 adding proxy for File (index):65 
 adding proxy for Capture (index):65 
 adding proxy for Device (index):65 
 adding proxy for Accelerometer (index):65 
 adding proxy for Compass (index):65 
 adding proxy for Globalization (index):65
 adding proxy for InAppBrowser (index):65 
 adding proxy for NetworkStatus (index):65 
 adding proxy for SplashScreen (index):65
 Persistent fs quota granted (index):65 
 Error: exec proxy not found for :: StatusBar :: _ready (index):65 
 bluetoothSerial.connect: 00:06:66:4D:00:00 (index):65 
 bluetoothSerial.subscribe ' ' (index):65
 bluetoothSerial.read:  (index):65  read

I think I'm connected to bluetooth but I can not get the data coming from the arduino. On the console I noticed this line:

Error: exec proxy not found for :: StatusBar :: _ready (index):65

Could this be the problem? If so, how can I resolve it? (I'm working on windows 10);

Thank you.

    
asked by anonymous 25.04.2017 / 13:31

1 answer

0

Try running the following command:

cordova plugin add https://github.com/apache/cordova-plugin-statusbar.git
    
25.04.2017 / 15:53