Raspberry Pi/Linux Client?


#1

My Raspberry Pi is up all the time, unlike my MacBook. Is there any chance of a Linux client, so I can hook TT up to my Raspberry Pi?

I’m thinking more an approach for the hobbyist, it wouldn’t need a GUI, just a daemon and a config.json to specify the button calls, for example. No need for any integrations to be built in, just make all calls scripts and let us take care of the rest!

Is something like this possible at all?


#2

Agree, Pi or ESP32. Both have BT built in now. I’ve dabbled with BT for Turntouch on both. Really just looking for others who are willing to write code with me.


#3

I’ve never coded for the Bluetooth stack before, are you using Python? Would be fun to try and get something minimal set up, i.e. that can connect and respond to button presses.


#4

Yeah, python. Agree on the minimal setup. I’ll share a stub/repo here in a little bit.


#5

Sweet, make sure to make use of the API documentation.


#6

Here’s the start of a repo:

Communicate here or in issues/PRs, whatever you prefer. There’s a scanner under util/ and monitor.py is the start on dispatching from the turntouch.


#7

There, monitor.py is at the Characteristic level. Next is to write to it and then wait for notifications.


#8

+1 for Pi support


#9

Nice start! I’ll help out with testing it on ArchLinux ARM myself.

I’ve got 3 TurnTouch myself (thanks for offering the complete set Samuel!) so I’ll also help out with ensuring the code handles more than one remote at the time.

Now I just need to go dig my Raspberry Pi out of the closet…


#10

I’ve got a Pi Zero W arriving today, so I should be able to put in some
time over the weekend!


#11

Any thoughts on using software that connects using gattool, which seems intended for connecting to BLE devices?

Examples: https://github.com/peplin/pygatt & https://github.com/getsenic/gatt-python


#12

I’ve got a simple gatt-based script working: It connects and responds to button presses, but I haven’t done anything with it yet:


#13

OK, I did the thing properly. It should be easy enough to configure, and I’ve provided instructions. At the moment, it’ll simply run any bash command as specified in the config.yml file, but if you want to run code in python directly it shouldn’t be hard to modify the client to do that.


#14

Thanks Fredley! I certainly like your attempt more than mine. I’ll start working with it soon.


#15

I’ve spent some more time on this today. It now supports:

  • Hue
  • Nest
  • Low battery alerts
  • Custom controllers!

I’ve written some documentation on the readme to get set up, and to write your own controllers. It would be great for someone else to have a go and give some feedback on the process!

@samuelclay Thanks for providing the developer page with the Bluetooth codes, that’s made this whole thing so much easier! Is there any chance the project could be listed on the page?


#16

Rather than implementing hue, nest, etc. you might think about writing a plug-in for home-assistant as it has a gigantic ecosystem and is python. I’d totally use it.


#17

like the controllers idea. I’m going to add a controller that I want soon.


#18

you should write it, njr!


#19

Yeah, I wish I had time - enough open source projects that are
desperately seeking attention as it is!


#20

@njr I didn’t know about this, it looks fantastic!

I’ll definitely look into doing this, with the modular controllers setup it should just be a question of writing the controller for it!