I'm new to ESP2866 and Android development. I have set my ESP8266 at static IP address which connects with a Wi-Fi router. I want to access my ESP8266 module from different Wi-Fi through my android app.This app is connected to firebase. Is it possible to access ESP2866 from any Wi-Fi connection through android app?. If so, please let me know how?
P.S. I want Wifi module to communicate through different wifi connection.
Thankyou for help
Regards,
This can be achieved by "port forwarding method" please follow the steps as suggested by #rasi Link
Related
I have a Web API Project hosted on my local system (Windows 7) on IIS7.
I am trying to access that Web API or for that matter another website hosted on the same IIS via my android mobile phone and My Mobile phone is connected to local wifi. But this IIS computer is connected to same network via wired LAN. Though I can access my router that is hosted on "xxx.xxx.1.1" IP Address from that computer as well as mobile phone but i am unable to access the IIS website from my mobile phone.
I tried turning off my windows firewall on the IIS computer where this website is running, but this didn't help as well. Although i can access this IIS website via another computer on the same LAN.
I think the issue is related to LAN or wifi but it should not be as the network and router for LAN and wifi are the same.
Need immediate help and how can i solve this.
Thanks
Can you ping your phone from your computer? Or vice-versa?
Access your router configuration and check for any access control setting that might be separating WiFi from LAN.
OK. When it was extremely urgent today, i found the answer myself. It was D link Router problem and here is the solution. Hope this helps others.
Check option Clients isolation in Wireless -> Basic.
If it turned ON - clients from LAN wil not access Wi-Fi clients and vice versa.
I am doing an android project. I am using wifi direct to establish communication between two modules. My doubt is that while using the wifi direct to connect to another device a dialog prompts whether to connect to that device. I want to avoid that prompt, It should be connected as it identifies a wifi module. that is by my understanding it should work as a background service. I am a beginner in android programming please help me out in solving this.
Thank You
Midhun
I want communication between two Android phones, both the phones are connected to the same Wi-Fi network. Knowing the IP address I can directly use sockets to communicate with both the devices, but my question is, is it possible to get the IP address at the run time? Or is there some other way in which I can do this?
You can use jmDNS to achieve this. It's a really helpful library and once you detect the all devices connected to the same wifi you can get their ip and port so you can establish a connection. You can learn more about how to use it here.
Or you can use Android Wi-Fi Direct API which works only for API Level 14+. Here is more information about the API : Wifi-Direct.
Hope it is what you are looking for! : )
You can use Google Android NSD service.
Check out http://developer.android.com/training/connect-devices-wirelessly/nsd.html
Assuming that both devices are in the same local network you could use/write kind of ip scanner (Check every single ip adress whether is alive and if it is try to connect).
I have two buttons in my app one will be on for local wifi(specially for "ati"), other will be on for if connection is specific server is available like www.google.com
Please help that how can detect the app is connected to local wifi and also how can detect that connection is available to specific server , same behavior as of Reachability in IOS programming
You can use the WifiManager class to get the state of Wi-Fi. I think only way to check whether connection to specific server is available to actually connect.
I want to start a local network connection using the built-in Wi-Fi hotspot on Android devices.
Is there a way to accomplish it?
And how to communicate between two devices?
EDIT:
I want to do it programmatically. Then I can transfer my own data between devices.
I haven't done this before, so my answer is all theoretical.
I think what you need to do is declare one device the server and start its hotspot manually with a known name.
Start / stop built-in Wi-Fi / USB tethering from code? (According to this question, you can't start hotspot programatically).
Once you have the hotspot set up, you start up the server app and wait for incoming connections. The server app can show you the ip address or hostname.
On the clients, you can do a simple check and see if the hotspot name is around and automatically connect to it if you find it. See this link for connecting to a network:
Using WifiManager to connect to a network
As for your second question, how to communicate - you need to establish a connection between the devices. For this, you need the ip address of the server. The simplest thing to do would be to show the ip address on the server UI and then manually enter it on the clients and press connect. It would then establish a connection to the server on a known port and you can send messages between client and server.
For reference, I found NanoHttpd, which is a webserver for Android. It uses ServerSocket to listen for incoming connections.
Possible answers:
Before ICS and non rooted devices
There is no way you can connect to a device over wifi. There is no API to do. Bluetooth is your best option or user interaction.
Before ICS and rooted devices
I am not sure if someone hacked the code, but when I tried to do an automatic connection to a wifi spot I noticed:
The api is hidden inside the SDK.
The method that does the connection checks the thread who ask for it. If it's not the os thread, it throws an exception.
Using ICS
With ICS there is a new way to connect devices through wifi called Wi-Fi Direct.
Here is a link with some demos.
If you are going to develop your own application for each and every individual terminals(devices) then i think for you socket programming will do the trick .
Yes , android supports socket programming in the same was as java socket programming .
1st google java socket programming tutorials and then you can using the same knowledge in android .
Also do remember to include the uses internet permission in the manifest , actually thats something which ate my brains for a long time :)
You mean communication between wifi enabled devices without any server like p2p? if so its wifi direct which is supported in ICS check this out http://developer.android.com/reference/android/net/wifi/p2p/package-summary.html
Before ICS there is no standard android API for wifi direct, though Galaxy S2 has wifi direct it uses proprietary API's which 3rd party devs can't use.
i dont know programmically create wify LAN,but you can create wify LAN manually,then you can do java tcp/udp program as said by brianestey
"As for your second question, how to communicate - you need to establish a connection between the devices. For this, you need the ip address of the server. The simplest thing to do would be to show the ip address on the server UI and then manually enter it on the clients and press connect. It would then establish a connection to the server on a known port and you can send messages between client and server."
for manual connection follow the steps
take settings/wireless&networks/portable wi-fi hotspot settings from any one of the phone
create new hotspot and turn on wi-fi portable hotspot from there
connect all other device to that hotspot including your pc
you will get ip of each device programmically (includig pc,but i dont know)