Adapting BLE Arduino App

Ask, and ye shall receive.
p4ng
Posts: 2
Joined: 10:33, 12 Jun 2015

Adapting BLE Arduino App

Postby p4ng » 10:51, 12 Jun 2015

Hello, first of all, I want to congratulate you for the project.

I am trying to modify the Arduino Led on/off BLE example to connect to my BLE device and send commands to it.
I was be able to connect to my device by changing the name in the file index.html in the app.connect function.

Now I want to send command to my BLE device.

From what I see from the code, the function app.ledon and app.ledoff send a byte, respectively 1 and 0.

I tried to do so, but what I see from my BLE device is a spurious byte sent (probably a 0) when connecting to the device while none byte is sent when pressing the buttons led on or led off.

Anyone can help me?

ardiri
Posts: 58
Joined: 16:13, 28 May 2014

Re: Adapting BLE Arduino App

Postby ardiri » 23:03, 08 Jul 2015

are you sure you are using the right UUIDs?

what about the console log - what do you see within the evothings workbench? you may be receiving errors and that would definitely mean no data gets sent over to the device once it is connected. you can see the console log under the tools option in the workbench.
// Aaron
Chief Technology Officer
Evothings AB http://www.evothings.com/

p4ng
Posts: 2
Joined: 10:33, 12 Jun 2015

Re: Adapting BLE Arduino App

Postby p4ng » 10:52, 13 Jul 2015

Hi ardiri, thanks for the answer. One problem was that I was not using the right UUIDs. I noticed this problem by myself and now I am able to send the commands to my BLE device.

Unfortunately the spurious byte sent (specifically 2) at the time of the connection to the BLE device still remains.

Here is the Evothings Console log:

LOG: found device: xxx
LOG: connected!
LOG: setNotification


When I send a command to my BLE device, the Console Log reports:
LOG: writeCharacteristic success

and this is actually received by my devce.

At the moment I fixed this problem (spurious by sent on connection) by rejecting the byte 2 on my BLE device.
If you could help telling my how to remove this spurious byte, my project will be more clean.
Thanks for your help.


Return to “Questions and answers”

Who is online

Users browsing this forum: Google [Bot] and 17 guests