Error 507 hc 05 bluetooth module continuation

For some reason I was unable to use pull up resistor via arduino so I decided to do it physicaly... thanks for your response. I will share my results when I get home

Hi, I tried it and I must say I am impressed, it works, the thing I am curious about is whether the decisive arduino code change was with variaables: newInput, oldInput and toBeTx, since I believe the motor thing you only modified to be more "more transparent"?

First of all, I'm really glad it works !
No, the difference isn't in the use of variables, nor in the "cleanliness" of the code.
The "big" difference is, as I already said, that the transmission to the app is done only when the input is changed and not every 100 ms. To do this I make a comparison between the current input reading (NewInput) and the old one. Only if they are different the transmisson is done.
Let me ask you the last question (though I have already asked) : do you use a momentary pushbutton or a switch with two stable ON/OFF positions ?
Could you please post the drawing of "truly your" hardware ?
(Ok I agree the questions are two.... :rofl: :rofl: :rofl:)

maybe I expressed myself wrong, by saying "use of those mentioned variables" I thought that using them prevents the overload by sending loads of data in the short period. I use momentary pushbutton. If you are looking for a picture of the project, here it is

Note that the led just acts there as a test, and those 3 resistors there are not used

Dear Bruno,
I believe that the answer to my question is here:
image
you are using a microswitch that is a "momentary pushbutton" (as you said). its status is normally open, this means that it is read by your Arduino always as HIGH.
Only if you you keep it pressed for a time sufficient to be acquired it is read as LOW.

You had 100 ms of delay, plus the transmission to the motor (25ms +25ms), plus the transmission to the Serial Monitor (@9600 = 15 ms), plus the transmission to the BT (@9600 = 3 ms); if in the meanwhile you had left the switch, it was read again as HIGH.

Anyway, form now on you have the road open in front of you !!!
Best wishes.

Many thanks sir, I really appreciate it.
Best regards,
Bruno

1 Like

My pleasure !!! :hugs: :hugs: :hugs:

1 Like

Hi, very rare question i would say, I literally made a new project with different name and with the same code with my desired design preferences and when I tried to run the app it failed at the first step(showing bt devices), why???

Hi, very rare question i would say, I literally made a new project with different name and with the same code with my desired design preferences and when I tried to run the app it failed at the first step(showing bt devices), why???? And also, I noticed that sometimes after I click the switch, state randomly changes from 1 to 0 and vice versa

Your new app does not yet have Bluetooth permissions.

Yeah but it asked for permission after I downloaded it

Stumped here.

Maybe your new device Android Verizon and current AI2 code would help.

It is the same device and the same code I posted above... I really do not understand it

Bluetooth needs at least two permissions

  • Scan
  • Something else I forget at the moment.


It asks for permission to search for the near devices, to connect to them and establihs their approximate position

(Canned Response ABG - Bluetooth non-BLE SCAN Permission Blocks)

The easiest solution, for immediate relief
(from @Barry_Meaker) ...

I had the same issue. The problem is your app does not have permission to see nearby devices. The solution is to give your app permission on your phone (no code changes in your app).

on your phone,

  • goto settings
  • search for your app
  • in App Info for your app select Permissions
  • change Nearby Devices from Not Allowed to Allowed
  • Done

By the way, the very first time you run the app, Android will ask if you want to grant the app this permission. If you say no, or ignore the pop-up, the permission will be set as Denied. Android will not ask again.

A more complex approach, for professional app development:

See Bluetooth liste of devices deosn't work anymore - #7 by Anke
Special note for Xiaomi devices:
I have an error with bluetooth on android 12, Xiaomi Poco X3 NFC - #20 by Patryk_F

Well, bad news is that permission to nearby devices was granted from the very beginning😕

Ask for all necessary permissions correctly

Taifun

Can you elaborate on that?

What about following the link to find the recommended blocks?
Taifun