Connect to bluetooth PC

That's good to know but it isn't informative from the perspective of an App. Indeed, we really need the App to make the connection, not have a connection (pairing) between devices first.

That is what the App wants to do, but usually there is a microcontroller receiving the data, driven by a Script (program) that uses the data. You can't just send a stream of data to a device without having something there to receive that data. In the case of a keyboard, it's data goes to a monitor. Perhaps you can have your stream go to a file, if Windows Bluetooth can do that. Normally though, it would be received by a program that needs the data.

A few years ago I made a code to connect App Inventor with Windows-7 using classic Bluetooth (dongle), I used AutoIt and VisualBasic 2010.

  • With AutoIt:

https://groups.google.com/g/mitappinventortest/c/VwgEZu5jH-E/m/Mdo2LMAxBQAJ

  • With Visual Basic:

https://groups.google.com/g/mitappinventortest/c/KkZbrPI7kb4/m/fTFQkAAaAQAJ

With Windows 10 and BLE I have not tried it.

Edited:
Martyn Currey shows code to connect Visual Basic with Arduino.
http://www.martyncurrey.com/arduino-and-visual-basic-part-1-receiving-data-from-the-arduino/#more-1700

1 Like

Hi Juan. With the demise of Visual Basic, there is Pure Basic. It's procedural, very comprehensive and independent of .Net. Has built-in Serial functions too.

1 Like

It seems interesting, but €79 (although there is a free demo).

€79 is a life time membership though and there are significant updates every year. Everything costs more in the current World :frowning_face:

Hello,
thank you for all your answers.
I think I can do something with all your advice.....
But for now I need to understand why my bluetooth connection is not working.....

Firstly:

Secondly, the structure of the App code. I can define a structure that should be able to make the connection for you.

ChrisWard,
when you say 'we really need the App to make the connection, not have a connection (pairing) between devices first.' I don't understand.... I have to do the 'pairing' between laptop and phone through les MIT App ? I'm right ?
Because up to now I do this pairing through the bluetooth app of the phone/laptop, and after I use my MIT App for the connection...
Thanks

We want the App to be in the equation so the pairing and connection to the PC from the Phone is performed by the App. The List of Available Devices is a list of paired devices.

Attached is butchered from my standard 'BT Basic Send Project Template' that many people have used as a basis for their Classic Bluetooth 'data send to a microcontroller'.

You can test to see if the Bluetooth connection works. You cannot actually successfully send data, unless there is a program on the PC waiting to receive the data (via a Serial Port).

BT_App_To_PC.aia (8.8 KB)

thanks.
I try

  1. Appairing Laptop and Phone through the ''normal'' way ->ok
  2. I use your app 'BT App to pc and I have:

I try too

  1. remove bluetooth apparing phone/laptop
    2)launch tour app
  2. my lalptop dosen't appear on the list when I click on 'SELECT PC TO CONNECT'

...this is running the App as an APK?

no through AI Companion
I try with APK

:cry::cry::cry::cry:the same with APK but error 507

Ok, can you try the attached BLE Project?

BLE_BASIC_SEND_TEXT.aia (192.4 KB)

That is subtly different - the PC BT has been found and paired, but the App cannot connect to it. Perhaps the issue is which port should be used and how to tell the App which port. Also, there isn't a program waiting for the data via Bluetooth?

@Juan_Antonio - any ideas? See BT_App_To_PC.aia (8.8 KB)

I have to leave my desk soon Manu - post your BLE result here.

@Manu_B

  • Do you have the bluetooth of the laptop paired with the bluetooth of your Xiaomi phone?

  • Can you get the Mac from the BT laptop with the following app and connect?

p9_Bluetooth_test1.aia (2.1 KB)