smtabatabaie
Posts: 2
Joined: Mon Mar 20, 2017 5:38 pm

Getting Raspberry pi events from android/iOS app

Mon Mar 20, 2017 6:03 pm

Hi guys, my first post here. I just got started with Raspberry pi and I wanted to make a program on my Raspberry which gets input from an app on my Android/iOS device over bluetooth. I wanted to first check if something like this is possible and second if you have any clues on how to do something like this.
Thanks

IanS
Posts: 153
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Getting Raspberry pi events from android/iOS app

Tue Mar 21, 2017 3:24 pm

This is possible, but if you are not already an experience app developer on Android or iOS, then developing the phone side of this has a serious initial learning curve.
You may find it easier, at least to start, to have the RPi running a light-weight web-server and to communicate through the phone browser with that instead. Obviously this is better for some control styles than others. e.g. real-time control of a RPi robot would be tricky, but 'slow' commands such as for home automation would be fine.
If the device side just needs to issue commands without the need for screen-based feedback then how about using a bluetooth device such as a game-controller or keyboard instead? Then you only need to worry about the RPi side development.

smtabatabaie
Posts: 2
Joined: Mon Mar 20, 2017 5:38 pm

Re: Getting Raspberry pi events from android/iOS app

Tue Mar 21, 2017 4:12 pm

IanS wrote:This is possible, but if you are not already an experience app developer on Android or iOS, then developing the phone side of this has a serious initial learning curve.
You may find it easier, at least to start, to have the RPi running a light-weight web-server and to communicate through the phone browser with that instead. Obviously this is better for some control styles than others. e.g. real-time control of a RPi robot would be tricky, but 'slow' commands such as for home automation would be fine.
If the device side just needs to issue commands without the need for screen-based feedback then how about using a bluetooth device such as a game-controller or keyboard instead? Then you only need to worry about the RPi side development.
Thanks very much , I have experience in both Android and iOS development (more on android) , All I want for start is to have a click on my android/iOS and a python script in my RPi and to be able to print something on raspberry pi via clicking the button on my android app via bluetooth. I'll appreciate if you know and guide me somewhere to start.
Thanks

IanS
Posts: 153
Joined: Wed Jun 20, 2012 2:51 pm
Location: Southampton, England

Re: Getting Raspberry pi events from android/iOS app

Wed Mar 22, 2017 12:02 pm

If you are confident on the phone side then I will assume that you can learn the RPi side, given a few pointers to get you going in the right direction. PyBluez is one of the main Bluetooth libraries for Python, but I have no doubt many others are available.
https://github.com/karulis/pybluez has the library and some examples of different ways of communicating with devices. Some may be better than others, depending on what you want to achieve.

User avatar
Douglas6
Posts: 4089
Joined: Sat Mar 16, 2013 5:34 am
Location: Chicago, IL

Re: Getting Raspberry pi events from android/iOS app

Wed Mar 22, 2017 2:34 pm

One way is to establish a serial communication connection between the phone and Pi. Then use serial programming on each end to communicate. To enable a Bluetooth serial comm port on the Pi, see this post: viewtopic.php?p=947185#p947185

ElEscalador
Posts: 557
Joined: Tue Dec 15, 2015 4:55 pm
Location: Detroit, MI USA

Re: Getting Raspberry pi events from android/iOS app

Wed Mar 22, 2017 3:18 pm

I really like an AP called hotbutton. You can use it to execute a script or other executable...basically an app of buttons that run a command line command.
A few of my projects below.

https://www.youtube.com/playlist?list=PLdlhFMXxFUNlMpeqHipdSIO20pb4piHfj

prasanthvanamlo
Posts: 1
Joined: Tue Oct 10, 2017 10:54 pm

Re: Getting Raspberry pi events from android/iOS app

Tue Oct 10, 2017 11:00 pm

Yes you can trigger events via android/ios app but that requires some serious skills. Because you just got started with Raspberry PI it will be quite easy for you to run light weight web server and communicating with the mobile browser. You may also try to establish a serial connection between your device and Raspberry and use it for end-to-end communication.

davidpaul1458
Posts: 1
Joined: Mon Nov 06, 2017 12:01 pm

Re: Getting Raspberry pi events from android/iOS app

Mon Nov 06, 2017 12:06 pm

A correct answer to this question depends largely on what parts of the Raspberry Pi you want to control. Can you update with details? If you're bent on using an Android application as your controller then at the very least you'll need to learn Java and get a basic understanding of the Android SDK to get started on your Native Android Application.
http://www.forios10.com/

Return to “Networking and servers”

Who is online

Users browsing this forum: No registered users and 9 guests