Bluno General Arduino

Bluno Beetle - serial does not work on OSX/Macos Corebluetooth

userHead graham 2019-03-22 23:08:03 5553 Views4 Replies
Edit: changed title from `Updated sketch to bluno beetle, but serial just echo's still`

I've got my software (+ Bluetility to debug) connecting to my Bluno Beetle 1.1 successfully.
I've also uploaded my own sketch which opens Serial, then in loop() writes different strings/values.

But when I read from the BLE service(DFB0) characteristic (DFB1 or DFB2), the only values I get back are the same bytes I write from my software. ie. it's echo'ing, just as the default/simple example does.

My sktech is being uploaded, as I have some debug LED's flashing when it writes things to the serial.
The TX LED also blinks when it writes...
BUT, the data I receive over BLE is just the bytes echo'd.

In fact, I just checked the serial monitor in ArduinoIDE and there's my data...

So how exactly am I supposed to write to the characteristics (or any service, or transmit any data via Bluetooth...) from my sketch?
2019-03-23 21:28:18 Kinda looks like this is a problem with the OSX implementation with CoreBluetooth... The demo app has the same results as my own app, but different to when debugging IOS.

I can read all the other characteristics (firmware versions, vendor etc), but just not DF01 and DF02 (as before, I can read & write one byte, but it's not what I have on my serial)

I've tried pairing with central & peripheral mode, which works, but no good for me (as I need multiple peripherals).
userHeadPic graham
2019-03-23 19:06:50 Aha! I went to try the sample apps in case my implementation was doing something odd...
https://github.com/DFRobot/BlunoTest

On ios, this worked great, and I'm seeing exactly what I wrote to the serial.

Now porting over to OSX as they share bluetooth to see whether the problem lies at my CoreBluetooth implementation, or the bluetooth stack in OSX... fingers crossed it's my code that's wrong...
userHeadPic graham
2019-03-23 02:37:10 I've managed to get into AT mode, so I can see I have firmware 1.97.
It's in peripheral mode, I can turn USB debug on and off, which is all fine, but the data I get over bluetooth is still just an echo of whatever I write TO the bluno.

I feel like the serial output must be going to a different service or something. The DFB1 and 2 data seem to just remember what they last were (maybe written to EEPROM as it's remembered even after a reboot)

I've tried HID mode, and have kinda made a keyboard (although a lot of the time it gets into a state where I can't reupload the sketch)
So it does communicate in SOME way. (This is slightly more controllable, so I may have to go down this direction, I just need to know when a pin is down sent to OSX, with 10 auto-connected blunos)

Maybe time to investigate the firmware to find out exactly what it's doing.
userHeadPic graham
2019-03-22 23:38:31 So, reading this page (which seems to have a bit more in-depth information than I can find from DFRobot - the demo source is great, but doesn't explain any details)
http://www.lucadentella.it/en/2018/01/2 ... no-beetle/

It seems the USB serial is just a mirror/bridge, so seeing MY output in the arduino sieral monitor makes sense.
But the serial monitor doesn't respond to +++ for AT mode.
Should it? It seems like it should. Or can I only access AT commands from a bluetooth serial connection? (maybe my bluno's are not in the right mode...)

I cannot find any documentation on the difference between the characteristics DFB1 and DFB2... Are they distinct in any way?
userHeadPic graham