nkaminski / csrmesh

Reverse engineered bridge implementation of the CSRMesh BTLE protocol
GNU Lesser General Public License v3.0
70 stars 20 forks source link

Device or resource busy (16) #20

Closed ryanpamplin closed 6 years ago

ryanpamplin commented 7 years ago

Hello! I'm super grateful for your amazing work! I was planning to try to do this myself until I came across your work. You saved me so much time!

I have 18 Move units and really want to get them working with the RB PI 3 I bought for this project. It's running the latest Raspbian with all of the required libs.

I've scanned for the CSRMESH using "sudo hcitool lescan" and found my MAC is the same as yours and everyone else's: "LE Scan ... 43:C5:5B:04:00:06 CSRmesh"

I reset my Move units and set the pin to 8888, because I used a 5 digit before. I powered off all but 1 unit for testing and to get this working. It's working in the app, and I shut off the app before trying the following...

When I run "./csrmesh-cli move --dest 43:C5:5B:04:00:06 --pin 8888 --position 0" from pi@raspberrypi:~/Desktop/csrmesh/bin, I get this output:

"Running: gatttool -b 43:C5:5B:04:00:06 --char-write-req -a 0x0021 -n 44a78b0080a06dba678d37d188b5d988f832ff connect: Device or resource busy (16)

After 100s of tries it said it wrote to the Move successfully once, but it didn't react physically.

Your help would be greatly, greatly appreciated! Happy to donate to you or a cause of your choice to show you some appreciate beyond my gratitude for your project! Thank you again!

nkaminski commented 7 years ago

99% of the time this is a blueZ related issue. Try connecting to the devices manually using gatttool in interactive mode. If you are not successful, the issue is related to bluez and we can debug that farther if needed.

Nash Kaminski

On June 17, 2017 2:04:03 PM CDT, ryanpamplin notifications@github.com wrote:

Hello! I'm super grateful for your amazing work! I was planning to try to do this myself until I came across your work. You saved me so much time!

I have 18 Move units and really want to get them working with the RB PI 3 I bought for this project. It's running the latest Raspbian with all of the required libs.

I've scanned for the CSRMESH using "sudo hcitool lescan" and found my MAC is the same as yours and everyone else's: "LE Scan ... 43:C5:5B:04:00:06 CSRmesh"

I reset my Move units and set the pin to 8888, because I used a 5 digit before. I powered off all but 1 unit for testing and to get this working. It's working in the app, and I shut off the app before trying the following...

When I run "./csrmesh-cli move --dest 43:C5:5B:04:00:06 --pin 8888 --position 0" from pi@raspberrypi:~/Desktop/csrmesh/bin, I get this output:

"Running: gatttool -b 43:C5:5B:04:00:06 --char-write-req -a 0x0021 -n 44a78b0080a06dba678d37d188b5d988f832ff connect: Device or resource busy (16)

After 100s of tries it said it wrote to the Move successfully once, but it didn't react physically.

Your help would be greatly, greatly appreciated! Happy to donate to you or a cause of your choice to show you some appreciate beyond my gratitude for your project! Thank you again!

-- You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub: https://github.com/nkaminski/csrmesh/issues/20

-- Sent from my Android device with K-9 Mail.

ryanpamplin commented 7 years ago

Thanks Nash!

When I run "gatttool -I" then "connect 43:C5:5B:04:00:06", I get...

"Attempting to connect to 43:C5:5B:04:00:06 Error: connect: Device or resource busy (16)".

I found this... https://stackoverflow.com/questions/22213793/bluetooth-le-on-raspbian. Maybe it'll help?

What do you recommend I try next?

nkaminski commented 7 years ago

Are you running the latest version of Raspbian Jessie? Also, are you using the Pi 3 internal bluetooth adapter? Finally, are you also using the serial port available via the GPIO header for anything?

Nash Kaminski

On June 17, 2017 4:22:08 PM CDT, ryanpamplin notifications@github.com wrote:

Thanks Nash!

When I run "gatttool -I" then "connect 43:C5:5B:04:00:06", I get...

"Attempting to connect to 43:C5:5B:04:00:06 Error: connect: Device or resource busy (16)".

I found this... https://stackoverflow.com/questions/22213793/bluetooth-le-on-raspbian. Maybe it'll help?

What do you recommend I try next?

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/nkaminski/csrmesh/issues/20#issuecomment-309240959

-- Sent from my Android device with K-9 Mail.

nkaminski commented 7 years ago

If none of the following apply to you, try with the '-t random' option on the gatttool command line.

Nash Kaminski

On June 17, 2017 4:22:08 PM CDT, ryanpamplin notifications@github.com wrote:

Thanks Nash!

When I run "gatttool -I" then "connect 43:C5:5B:04:00:06", I get...

"Attempting to connect to 43:C5:5B:04:00:06 Error: connect: Device or resource busy (16)".

I found this... https://stackoverflow.com/questions/22213793/bluetooth-le-on-raspbian. Maybe it'll help?

What do you recommend I try next?

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/nkaminski/csrmesh/issues/20#issuecomment-309240959

-- Sent from my Android device with K-9 Mail.

ryanpamplin commented 7 years ago

I'm running the latest RASPBIAN JESSIE WITH PIXEL based on Debian Jessie from April 2017 w/ kernel version 4.4.

I am using the Pi 3 internal bluetooth adapter.

No other software or hardware is running outside of the default OS setup. This is a dedicated Pi for this purpose.

I've tried the command with '-t random', "gatttool -b 43:C5:5B:04:00:06 --char-write-req -a 0x0021 -n 8c79830080b9d1e81ef2072349994638b8ccff -t random", I get: "connect error: Connection refused (111)"

Without the -t random I get: "connect: Device or resource busy (16)"

nkaminski commented 7 years ago

I don't have any Teptron move units, but I will try to reproduce this with a fully updated Pi3 of my own and a Feit homebrite CSRmesh enabled light bulb.

Nash Kaminski

On June 18, 2017 11:12:11 AM CDT, ryanpamplin notifications@github.com wrote:

I'm running the latest RASPBIAN JESSIE WITH PIXEL based on Debian Jessie from April 2017 w/ kernel version 4.4.

I am using the Pi 3 internal bluetooth adapter.

No other software or hardware is running outside of the default OS setup. This is a dedicated Pi for this purpose.

I've tried the command with '-t random', "gatttool -b 43:C5:5B:04:00:06 --char-write-req -a 0x0021 -n 8c79830080b9d1e81ef2072349994638b8ccff -t random", I get: "connect error: Connection refused (111)"

Without the -t random I get: "connect: Device or resource busy (16)"

-- You are receiving this because you commented. Reply to this email directly or view it on GitHub: https://github.com/nkaminski/csrmesh/issues/20#issuecomment-309286920

-- Sent from my Android device with K-9 Mail.

nkaminski commented 6 years ago

Do you still see this issue with the most recent Raspbian release?

nkaminski commented 6 years ago

Closing since there has not been any response for a few months. Feel free to reopen if this issue is still unsolved.