I would like to get help since I am trying not to connect my created app to a bluetooth hc-05 module and when I try to connect it it gives me error 507, I have already tried connecting it in another way, checking its connections and so on but I still can't get it, I need help for this purpose.
Hello Andres
Ensure that Bluetooth is switched on, on both devices. What is the HC-05 attached to? An Arduino? Possible faults are:
- Incorrect wiring connections
- Bluetooth not enabled correctly in your microprocessor script/sketch
- HC-05 module or the microprocessor board has physical damage such as a hairline fracture that the human eye cannot see without the aid of a magnifying glass.
- The microprocessor board does not have sufficient power.
- Environment - either device too close to metal object(s)
(Canned Reply: ABG- Export & Upload .aia)
Export your .aia file and upload it here.
.
I understand, however, I carried out a test using an app other than app inventor and it turned out that it connected correctly to the module, which is why I assume that it is in correct connections both at the connection level and at the internal functioning level.
Dear @andres_felipe_cifuen,
in your app you need to add a clock in order to receive data from the HC05 (supposing it's connected to an Arduino, as @ChrisWard has already said). The clock shall be fast enough to catch all data sent by your hardware: to this purpose I've set the clock period to 10 milliseconds. Don't be scared if it seems too fast, if nothing has arrived, the clock servicing routine exits immediately.
Probably your red circled clock was intended to do so ? Anyway in your .aia the receiving blocks were "alone" without any connection to it.
Please also consider that the sending from Arduino shall be made (as @ABG says in his answer) by using SerialToBT.print(); instructions but ended with a SerialToBT.println();
The println() closes the transmission with a \n character (linefeed, decimal 10 or hexadecimal 0x0A) which is captured by the "-1" in the following block:
And in the BT client settings remember to put:
For a deeper explanation, please read what @ABG has already posted: everything will be more clear after having had a look to it.
Moreover, depending on the Android level (most probably if > 10), you shall allow the BT AND geolocalization on your device to make it capable to work with BT.
Best wishes.
PS As a general hint, before making your app complex, with graphs or whatever, please be sure that the BT Tx/Rx are working fine: just show in a label everything arrives from your hardware. Check if it is exactly what you expect, then, once done with that, you can enrich your app. One step at a time..
Good advice from Ugo that everyone should heed!
KISS - Keep It Simple Stupid
...KISS...
(I remember when I was young....)
I see no benefit from including a Serial component in a pure BlueTooth app.
The Serial component is for directly wired connections through the USB port, right?
You don't have that, right?
Very good question !!!
I already checked and eliminated the serial component, however, I am a little new to using this and I don't know what else I should change to solve the error presented. As an additional point, I already checked and indeed the rex and tx connections are working correctly. Sorry for the inconvenience.
Upload your corrected Project aia and the sketch .ino
You left off the .ino
Also, you fixed nothing.
You specified a list as the number of bytes to receive.
Your Clock Timer is empty.
I leave this for some one who speaks a language you can understand and listen to.
Ok, I understand, however, I once again present my most sincere excuses because it is my first time using this interface. If you could specify more in the section or what to modify, I would be more grateful. sorry for the inconvenience
So where's the sketch?
Dear @andres_felipe_cifuen,
the second .aia you've posted is exatly the same as the first one: you haven't considered my suggestions (the clock, the message terminator, the permissions, etc). What @Abg is asking for is the .ino file (i.e. the Arduino sketch).
To try to split in two parts the problem, please verify at first if your hardware section is really working fine by using a ready made app like SerialBluetoothTerminal (free on Google Playstore). By using that app you can see if Arduino is sending out and receiving correctly the data.
Another option is to have a look on two web sites where you can find a huge amount of examples: KIO4.com (by @Juan_Antonio) and professorcad.co.uk (by @ChrisWard). There you can find a lot of complete pair (AI2 app + Arduino code) of working examples.