Controlling LED's from my phone via BluetoothLE

Some progress. The interesting bit: Connected: Can Write: false

However, we need to ensure it's not a false negative (a 'red herring'), so can you change the initialization of the variable from 'false' to 'true' and test again?

Snap1

The Status is telling us that the App values are sent correctly. The Serial Monitor is telling us the values are not received in any shape or form. It seems like there is something very simple missing.......I assume your phone has location switched on?

ref: https://docs.arduino.cc/tutorials/nano-33-ble-sense/cheat-sheet

@ewpatton can you shine a light on what we have missed out? Not sure about the BLE Can Write Block.

@gerriko_io
@uskiara
@Juan_Antonio

I think one of these Arduino-Bluetooth experts will be able to identify what is wrong, if anyone can spare the time to take a look?

Hello @ChrisWard and all, (@Juan_Antonio, @Gerriko_io )
sure I'll give it a look, but not today because my friend with his Lancia Fulvia (year 1967) will run the Montecarlo Rally in a few hours and I've prepared for him the "race software" with AI2 interfaced to Hall sensors on wheels (+Arduino Nano+ESP32 + Bluetooth :slight_smile: )to compute the speed, and at the same time interfacing the GPS to keep the road.
IMG-20230121-WA0002

So we are (very :grimacing:) busy 'till his departure (approx h 21.00 tonite).

Honestly I've already had a look at this probem, but I don't have a NANO33 BLE. I've just some ESP32 capable of BLE (and an HC08 + UNO in the case). So even if I will be able to make it working, will it be worth for @Muhammad_Zulkifli ? The BLE libraries for NANO33 and ESP32 are hardly different each other.

@Muhammad_Zulkifli in the case, have you the chance to revert your projet on a ESP32 ?

Anyway, sure, tomorrow (Italian time) morning, I'll give it a try.
Ciao ciao.
:crossed_fingers:

2 Likes

Regarding the issue of the CanWrite variable being set to false, there are two different types of writes in the BLE spec. CanWriteCharacteristic block corresponds to writes without checking for a confirmation and determines whether you can use the Write family of blocks. Separately, there is the method CanWriteCharacteristicWithResponse that corresponds to whether you can use the Write*WithResponse blocks. By specifying BLEWrite for the characteristic you need to use the latter set of blocks. You can probably also add BLEWriteWithoutResponse flag on the Arduino side to get the intended behavior without having to swap out all of the blocks.

1 Like

I searched for BLEWriteWithoutResponse - I think you have nailed it (fingers crossed)

Hi Muhammad

Re Evan Patton's post, try this Sketch (with App Project LED_Control_6.aia):
LED_COBAK6a.ino (7.5 KB)

Very very worth or me sir

I've never done that, sir.

It works sir! ok, now I can proceed to be able to move the linear actuator for my prosthetic hand. And to drive the linear actuator, can we use a list index like the LED we discussed?

And I can teach my friends in college to make projects such as turning on LEDs or driving motors or something else

1 Like

And thanks to all of you who have helped me.
@Anke
@ewpatton
@ChrisWard
@uskiara

2 Likes

Well, I don't know the specification of the hand - only one actuator? That would not need a list in theory, but if you mean the movement is controlled in fixed increments then yes, a list would work for that.

Dear @Muhammad_Zulkifli,
I'm really happy of that. Sorry not having had the time to help you before, but you've seen that @ChrisWard and @ewpatton have had the magic wand :grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes: :grinning_face_with_smiling_eyes: to solve your problem.
Best wishes for your project.
Kind regards, Ugo.

Okey I will try it for moving five fingers with five actuators

Thank you sir, wish all the best for you

1 Like

Hi Muhammad

If you find that you need help, open a new Topic.

Dear @Muhammad_Zulkifli,
as promised (though a bit too late) please find annexed a chunk of code working with the ESP32 (as I told I haven't a NANO33).
The .aia is the same as that of @ChrisWard.
Of course the .ino is intended for an ESP32.
Honestly I've got help from the web. In particular from this link:

Please be aware that in case you will use, maybe for future projects, an ESP32, you must have
the CORE 2.0.0, and the libraries from:
"https://arduino.esp8266.com/stable/package_esp8266com_index.json,https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json"
The above link (without quotes) shall be put in the Arduino Settings as depicted here below:

This is what you can see on the Serial Monitor when the .ino runs and you hit the buttons on the app:
image

I've tried to make it as simple as possible, though I'm not an expert on BLE ( :roll_eyes:), but the annexed version works fine on my ESP32 and a Lenovo tab M8 on which the app made by Chris runs.

BLE_uart.ino (3.5 KB)

The following are the ESP32 board characteristics of mine.

At the end, I hope that this will not cause you any doubts. Just continue with the version that is working with your hardware. Put this version in a drawer, and the next time that you might use an ESP32, you can retrieve it :slight_smile:

Again best wishes with your "hand" !!!
:wave: :wave: :wave:
Ciao, Ugo.

1 Like

..... what will the actuators be? Stepper motors? It's a challenge because you have three joints for each finger (two for the thumb) including the knuckles. Lots of research required first.

Anyway, good luck with the Project, sounds exciting!

No sir, my actuators will be linear

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.