B4A+Arduino+Bluetooh connection problem

paolofi

Member
Licensed User
Longtime User
I'm trying to connect my Arduino board to an Android Tablet application trough Bluetooh.
I'm new in B4A and Bluetooh protocol too so I apologize in advance if my questions appears banal.
I started from a working Arduino Bluetooh project used in the past.
Arduino use an USB additional board and a Bluetooh dogle, I have already succesfully connected and monitored a WII Wiimote so I'm sure that
the hardware and software base from the Arduino side will work fine.
From the B4A side I loaded the SerialExample source without modify it.
After paired my Arduino with tablet I launched the SerialExample program in B4A, the program recognize the Arduino board and ask me to connect the MAC address, after this operation the connection begins and from Arduino monitor I can view the right Android MAC and his name, after this protocol exchange the application on the tablet stops with the message:java.io.IOException:Service discovery failed, pratically the Sub Serial1_Connected returns false.
After a while Arduino procedure stops for timeout.

What's the "Service" that the program expect?
How can I start the connection and leave the tablet awaiting for signals from the bluetooh channel (Arduino)?
Do you have any sample developed about this area?

I hope I was clear.

Regards

Paolo
 
Last edited:

paolofi

Member
Licensed User
Longtime User
Replacing
B4X:
   Serial1.Connect(PairedDevices.Get(l.Get(res)))
with
B4X:
   Serial1.Connect3(PairedDevices.Get(l.Get(res)),1)

the program ask the code, logging and start to receive IO port data!

Next step is how to resolve the Arduino crash when flushing channel.

Many thanks!

Paolo

This error means that no service with the default UUID was found:
The default UUID is: 00001101-0000-1000-8000-00805F9B34FB

You can set a different UUID with Connect2. You can also try Connect3 with different port values.
 
Upvote 0
Top