Omid1989
Omid1989

Reputation: 429

Communication between android phone and Raspberry Pi over WiFi without external modem/router?

I want to control Raspberry Pi 3 with an android application via WiFi, without external modem/router/...

This application needs to do the followings:

So far, I have setup RPi as a wireless access point, and I'm able to find RPi in my android phone via WiFi and connect to it.

But the question is how can I communicate with it after being connected !?

Firstly, I thought using SSH. I tried some ready apps like JuiceSSH. And it was successful. I was able to SSH into RPi and execute commands.

But then I thought maybe there's no need to SSH. Because the RPi itself is a wireless access point, and my android phone is connected to it.

Now here is my question:

Are there any methods (other than SSH) to send commands to RPi or send/receive files to/from RPi after connecting to it !? If so, how can I implement it?

Any sample codes or examples are really appreciated. Thanks.

Upvotes: 0

Views: 6824

Answers (1)

Nowa Concordia
Nowa Concordia

Reputation: 739

I don't see a point of not using SSH merely because RPI act as as Wireless access point. Anyways if it's a basic Shell access you need to the RPI from the phone, SSH or Telnet can be easy to setup.

If you are in capacity to implement your own server inside the RPI by code and do something inside the code, gRPC can come handy, given it's available in many languages.

Ex: gRPC server in the RPI, gRPC client in the android app. Basically gives simple client-server system.

There are many other ways to achieve the same thing, depending on your exact requirements and constraints.

Or you can simply start a webserver inside the RPI and use the browser in the phone to access it. This seems more simple and robust.

http://www.instructables.com/id/Python-Web-Server-for-your-Raspberry-Pi/ http://www.instructables.com/id/Raspberry-Pi-Android-App-communication/

Upvotes: 2

Related Questions