2

I'm trying to setup my RPi Zero W as a Terrarium Controller and I want to be able to create an Android app to control the settings and and such over Bluetooth. I've found tons of tutorials on setting up the RPi as a Bluetooth server, but none of them quite fit what I'm trying to do and I'm not sure how to adapt them to work as intended. I do want it to be secure, by either a single-paired device or requiring a code input or something to that nature. What would be the simplest solution to this? Thanks for your time.

1 Answer 1

1

Simplest way to do this would be setting up a Bluetooth socket server in Python, adding a simple communication over it - then adding some security algorithm, such as basic password check or even data (or text, if you wish to make it command-oriented) encryption of traffic - Python is simple and quick way to perform these tasks with little to no difficulty. Note that Python is language that only server has to work with - Android app does not need it to connect and communicate.

3
  • I like the idea. Could you perhaps elaborate, and maybe even link a tutorial on doing this? Thanks.
    – Timberwolf
    Commented Jul 12, 2019 at 0:27
  • 1
    @Timberwolf I didn't do it myself yet, but it was added as a feature of Python 3.3. programcreek.com/python/example/14725/bluetooth.BluetoothSocket <- here are some code parts of how it should look like, but it's very similar to regular socket server which is very friendly explained here: realpython.com/python-sockets. Try to make regular one first, then move onto Bluetooth version with Python client to finally look for creation of proper Android client. Remember - Python is one of many ways to do this, if it won't work for you think of other languages.
    – hypixus
    Commented Jul 12, 2019 at 0:42
  • OK, I'll look into that. If I can make it work, I'll mark your answer as the accepted answer.
    – Timberwolf
    Commented Jul 12, 2019 at 4:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.