Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Mario_Q_Intel
Employee
1,592 Views

Simulate Bluetooth Keyboard HID from Intel Edison to PC

Hi all,

I have done A LOT of research but I can't still find a way to do my project. Basically what I want to do is to simulate a Bluetooth keyboard using an Intel Edison so I can use it to write something to my computer as if it was really a keyboard. I am not sure if I just have to create a connection between Edison and my PC and then just do an echo in the Edison terminal, but I think it will be more complex than that. I am not even able to create a connection. When I try to connect using GATT, it says "Error: connect error: Connection refused (111)" and when I try to do it using bluetoothctl I get "Failed to connect: org.bluez.Error.NotAvailable". I also wanted to try btmgmt, but haven't been able to install it. I think there are some dependencies missing.

So I don't want to keep wasting my time. Maybe there's an easier way. The pseudocode i want to implement would be something like:

sleep(5)

while(1){

sendchar("H")

sleep(1)

sendchar("e")

sleep(1)

sendchar("l")

sleep(1)

sendchar("l")

sleep(1)

sendchar("o")

sleep(1)

sendchar(" ")

sleep(1)

}

During the first sleep I will have time to move the cursor to a notepad screen, for example, and then click it. Some seconds later I will see the characters being written periodically just as if someone was typing them directly using the PC keyboard.

Thank you for your help

Tags (1)
0 Kudos
8 Replies
idata
Community Manager
134 Views

Hi Mario,

 

 

We'll be glad to assist you. I believe this hasn't been done before, however, there are some similar threads in the Community that you can use together to get some different results to what you're getting right now. For connecting the Edison to your PC, take a look at this one /thread/104504 https://communities.intel.com/thread/104504.

 

For actual writing from the Edison to the PC, unfortunately, I didn't find anything related to Bluetooth, however, you might want to use some tips from the USB connection, like in this thread: /thread/91328 https://communities.intel.com/thread/91328.

 

 

Regards,

 

-Pablo
Mario_Q_Intel
Employee
134 Views

Hi Pablo,

I will follow your suggestions and post any updates.

Thank you

idata
Community Manager
134 Views

Hi Mario,

 

 

Have you been able to work on this project? Do you have updates on it?

 

 

Regards,

 

-Pablo

 

Mario_Q_Intel
Employee
134 Views

Hello Pablo,

I am trying to do this using Ubilinux. The problem I think is that most information I have found needs an external keyboard connected to the Edison and then the Edison, presenting itself as an HID device, sends the information to the PC. Also I tested the Edison SPP to PC communication you told me about and it worked, but wasn't able to translate that serial data into a keystroke.

I am still trying to figure it out. If you have any information, I would be glad to know it.

Regards

idata
Community Manager
134 Views

Hi Mario,

 

 

I haven't tried that before, so I wouldn't be able to provide an exact answer to your question, however, I would suggest you to check this thread from the Arduino forums, you might get some ideas from there to take your serial data and make it behave like keyboard inputs.

 

http://forum.arduino.cc/index.php?topic=39243.0 http://forum.arduino.cc/index.php?topic=39243.0

 

 

Regards,

 

-Pablo
idata
Community Manager
134 Views

Hi Mario,

 

 

Do you have updates on this case? Were you able to check the Arduino thread that I suggested last time?

 

 

Regards,

 

-Pablo
Mario_Q_Intel
Employee
134 Views

Hello Pablo,

No, I didn't have any time to check it, but I have already, at least partially, solved it. First of all I paired my Edison's bluetooth to my computer's using the link you gave me , with the agent, serial terminal and everything else. Then I downloaded this keyboard wedge http://www.priority1design.com.au/datasnip.html Datasnip keyboard Wedge. Simple Serial port to keyboard redirection program. As the link says, this turns a serial input ascii character into a keystroke. After I began to collect data, my Edison's and computer's bluetooth status changed from "paired" to "connected". I was able to write from my Edison to my computer. Also, something important, even if you can see in the software's COM list up to 30 ports, it only worked for me with ports lower than COM 15.

I know it is not really turning my Edison into an HID keyboard, but it's very similar. The only problem I got was that I am not able yet to emulate special keys like ESC or F something or even backspace even if I write the Linux command as I think it is correctly written.

As I said before, this is practically solved.

Regards

idata
Community Manager
134 Views

Hi Mario,

 

 

Thank you very much for your update. I'm really glad to know you discover that workaround program from the link. I hadn't seen that link information before so it might be helpful for other users. Did you get any strange behavior when using ports from 15 to 30?

 

Regarding the special keys issue, I'm not sure how the programs actually works, but it could be related to the key press not being registered in the ascii list of the software you're using, but this is just a guess.

 

In any case, let me know if you need any more help.

 

 

Regards,

 

-Pablo
Reply