-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Connecting on ESP32 #5
Comments
here's the esp32 code running on the device. |
Was hoping it might be an SSL issue... but just set up Ngrok and hit it via https and no luck seeing the service with that approach either. |
I do see it using the device using the code here: |
Ok, figured it out. Seems like you want to filter by name instead - and pass that in as a param as well. like:
|
oh, interestingly, now that i've connected successfully, i can also connect successfully from your example at https://itpnyu.github.io/p5ble-website/docs/connect-disconnect (i used your same UUID). I wonder if this is why you may not have noticed that it wasn't working??... maybe it gets cached in some way... and then bypasses the filters? |
Nope, scratch that - it only shows up on https://itpnyu.github.io/p5ble-website/docs/connect-disconnect if I'm currently paired with it using my modified connect script. If I disconnect there, it doesn't work again on your example site. |
On further experimentation, the UUID still needs to be in the options as so:
|
Hi @bigrig2212, thank you for reporting the issue! I'd love to make it working with ESP32. I think passing navigator.bluetooth.requestDevice({filters: [{services: [serviceUuid]}]}) If on your phone in the BLE Scanner app, you can see and connect to your service, then p5 sketch should be able to find your device. When you are running the p5 sketch, you just need to change the serviceUuid here. What is your service uuid? Does it have same format like: const serviceUuid = "e1132322-a39d-45be-8db0-16983b2a4fe3";
const serviceUuid = "19b10010-e8f2-537e-4f6c-d104768a1214"; |
Not sure if it applies or not, but one thing I had to do was add this to the ESP32 example: |
I've successfully been able to get p5.ble to read a characteristic using an ESP32. Here's the Arduino code:
However, I cannot get p5.ble to successfully write to the same characteristic. The ESP32 triggers the callback but the value is empty (?). The serial monitor writes:
I can connect to the ESP32 with an app like nRF Connect on my Android phone and successfully write a text string to the characteristic. Any ideas welcome. |
Hey, |
@FilippoCinotti , @mjvo the incoming information will be interpreted as ASCII. Try sending a number 65 and you should see a letter 'A'. |
FWIW, I was only to successfully write bytes from p5.ble to an Adafruit Bluefruit LE SPI Friend. In order to write strings, I modified lines 104-106 of p5.ble.js (in the write function) as follows:
to
Great lib! |
The strange thing is it works on Android. It runs perfectly. |
I have same issue. The p5.ble.js cannot find my ESP32 BLE device but other mobile apps like Bluefruit BLE Connect can find and connect without any issue. |
Hi there. Love this library!!
Just trying to get it to work with ESP32. No luck connecting to advertised service UUID.
On my phone using the BLE Scanner app, I can see and connect to my service. But don't see the service listed from browser using myBLE.connect(serviceUuid, gotCharacteristics). Just hangs and says "no compatible devices found."
The code for ESP32 is quite different from your sample code for Arduino, but at the end of the day, it advertises a serviceUUID and that's confirmed working... so don't think there's too much to go wrong.
Bug? Or am I doing something wrong? Does it need something else in that ArduinoBLE.h library? (I'm not using that library). I'm using:
#include <BLEDevice.h>
#include <BLEUtils.h>
#include <BLEServer.h>
The text was updated successfully, but these errors were encountered: