dazilli
Posts: 6
Joined: Mon Dec 29, 2014 5:18 am

How to remotely control devices connected to my raspberry pi

Sun Jan 18, 2015 4:39 pm

Hi Friends,
I am building a home automation project. I have the hardware components working using python and nodejs. The remaining part is to control these components remotely from my android using an android application that I want to develop. But the thing is that I don't know how to start. I have done some research on this and seen people do it, but they did not describe how they got it working. Now my question is: Do I have to install any thing in my raspberry pi for it to recognize my android application's commands?

Please I will really appreciate any help from someone. Thanks.
Last edited by dazilli on Sun Jan 18, 2015 7:10 pm, edited 2 times in total.

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

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 5:32 pm

TCP sockets are a common way to communicate between devices on a network. Google 'socket programming' for both android and your language of choice on the Pi. Or look into higher level protocols like HTTP, or higher-yet frameworks like MTQQ.

User avatar
DougieLawson
Posts: 39789
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 5:36 pm

Douglas6 wrote:TCP sockets are a common way to communicate between devices on a network. Google 'socket programming' for both android and your language of choice on the Pi. Or look into higher level protocols like HTTP, or higher-yet frameworks like MTQQ MQTT.
FTFY, you're welcome.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

User avatar
DougieLawson
Posts: 39789
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 5:38 pm

dazilli wrote: I am building a home automation project for my Final Masters project.
If I were your professor and due to award your master's degree at some time in the near future, then I'd hate to think you'd cheated by posting my questions on an internet forum and inviting lots of folks to do your work for you. It's lazy and it doesn't deserve any reward.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

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

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 5:53 pm

DougieLawson wrote:
Douglas6 wrote:frameworks like MTQQ MQTT.
FTFY, you're welcome.
I'm a card-holding member of D.A.M. (Mothers Against Dyslexia)

dazilli
Posts: 6
Joined: Mon Dec 29, 2014 5:18 am

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 6:52 pm

DougieLawson wrote:
dazilli wrote: I am building a home automation project for my Final Masters project.
If I were your professor and due to award your master's degree at some time in the near future, then I'd hate to think you'd cheated by posting my questions on an internet forum and inviting lots of folks to do your work for you. It's lazy and it doesn't deserve any reward.

Nobody knows it all. I am only asking for a hint from someone that has the experience. Please if you have any idea, please help me.

dazilli
Posts: 6
Joined: Mon Dec 29, 2014 5:18 am

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 7:00 pm

Douglas6 wrote:TCP sockets are a common way to communicate between devices on a network. Google 'socket programming' for both android and your language of choice on the Pi. Or look into higher level protocols like HTTP, or higher-yet frameworks like MTQQ.
Thanks for replying, I will give it a try.

User avatar
DougieLawson
Posts: 39789
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 7:03 pm

dazilli wrote:
DougieLawson wrote:
dazilli wrote: I am building a home automation project for my Final Masters project.
If I were your professor and due to award your master's degree at some time in the near future, then I'd hate to think you'd cheated by posting my questions on an internet forum and inviting lots of folks to do your work for you. It's lazy and it doesn't deserve any reward.

Nobody knows it all. I am only asking for a hint from someone that has the experience. Please if you have any idea, please help me.
Sorry, I thought the idea of a Master's or Doctorate was that you learned to do your own research. So my advice is learn to do your own research or ask your Professor for some hints as to why you're failing to do that and how you could do it better.

Part and parcel of the whole Raspberry Pi project is to stop feeding things to consumers ready built on a plate, but to encourage folk to learn for themselves, to stop working to a script, to experiment with things they've never tried, to research things, to break things (and understand why they're broken and how to avoid that in future), to create new things by encouraging innovation.

Posting a set of three questions on a forum and asking for the boilerplate answers (that your Professor will have seen a hundred times before) does not fit that in any form at all.

I will give you one hint, forget Android, you can have a raw Java JVM running on a Raspberry Pi, but there's nothing from Android on it. With some clever programming you can have an Android client application that activates a server process that runs on a Raspberry Pi. That server process could be written in Java.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All fake doctors are on my foes list.

User avatar
r3d4
Posts: 983
Joined: Sat Jul 30, 2011 8:21 am
Location: ./

Re: How to remotely control devices connected to my raspberr

Sun Jan 18, 2015 7:37 pm

Douglas6 wrote:
DougieLawson wrote:
Douglas6 wrote:frameworks like MTQQ MQTT.
FTFY, you're welcome.
I'm a card-holding member of D.A.M. (Mothers Against Dyslexia)
:lol:
Real life is, to most, a long second-best, a perpetual compromise between the ideal and the possible.
-
Meanwhile, the sysadmin who accidentally nuked the data reckons "its best not run anything more with sudo today"
-
what about spike milligan?

dazilli
Posts: 6
Joined: Mon Dec 29, 2014 5:18 am

Re: How to remotely control devices connected to my raspberr

Sat Feb 07, 2015 8:18 pm

Douglas6 wrote:TCP sockets are a common way to communicate between devices on a network. Google 'socket programming' for both android and your language of choice on the Pi. Or look into higher level protocols like HTTP, or higher-yet frameworks like MTQQ.

Thanks a lot Douglas6 for your hint. I followed your hint and wrote my program and my android app communicates and responds to my raspberry pi correctly.

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

Re: How to remotely control devices connected to my raspberr

Sat Feb 07, 2015 8:32 pm

Great! Glad it worked out.

Tarcas
Posts: 741
Joined: Thu Jan 09, 2014 5:38 am
Location: USA

Re: How to remotely control devices connected to my raspberr

Sun Feb 08, 2015 2:56 am

I've been using this to control my home automation controller through Google Chat from my phone. It would (probably) be child's play to create an app to send a chat message to the house's account with the given command. I intend to do just that in the future, but I haven't yet.
Anyway, here's the Pi's chat bot:
http://mitchtech.net/raspberry-pi-google-talk-robot/

Return to “Automation, sensing and robotics”