Connect ios devices to local server via wifi - ios

I have a localhost server on my laptop. Can I connect ios device to this localhost server through wifi?
What settings I must set up on wifi connection?

By localhost server , i assume you are talking about a HTTP server .
If you know the port on which the server is listening to , note it down.
If you dont , generally web servers are attached to port 80.
If both laptop and ios device is connected to the same network.
Then first note down the IPAddress of you laptop.
In windows you can do so by typing : ipconfig in the command prompt
In Unix or Linux based systems : type ifconfig in the terminal.
Lets assume you found out that your ipaddress is 192.168.1.2
Note down this IP Address of your wifi adapter.
Now , just type in IPAddress:Port in the web browser of your ios device to access the server.
eg: Type in 192.168.1.2:80 on the url bar of ios device.

Related

How to connect to localhost on a real device in react native on iOS?

I have a server running on localhost:5000 on my desktop, and when I make http requests through my react-native app when running on the iOS simulation to it, it works. However, when I connect to a real device, the http requests don't work. What am I doing wrong? Is there something I have to configure?
localhost in your desktop is not the same ip of the localhost of your device.
Get the ip of your computer by typing ifconfig in a terminal, then replace localhost by this ip, you should type something like that in your device browser:
192.168.0.23:5000
Maybe my answer is too late but I ran into a similar situation today and I got it to work by running my node server using the IPv4 of my desktop and then making the request to that IP.
For example, I am running my nodejs development server at http://192.168.0.135:3000(local IP of my desktop) instead of localhost and then I make the fetch API request from my react-native app to http://192.168.0.135:3000/.
Just make sure your nodejs server and your app are on the same local network. My react-native server (metro bundler) is running on a separate PC also in the same wifi network.
If your are on macOS go to settings -> Wifi / and show more,
on bottom you see "IP address", it's your correct localhost for ios physical device !

Paho-mqtt connect via ppp0

I am working on an embedded linux based device that runs ubuntu. Now the device driver for the wifi is really crappy so I cannot create a hotspot so this device connects to another device which is running a hotspot. Now I am connecting to that device for some input but at the same time connecting to internet to send mqtt message using paho mqtt in python via a gsm modem. The modem connect to internet using pon command and it works nicely. But when both connections are running, paho-mqtt cannot connect to internet anymore. pinging using -I ppp0 works fine. I tried to bind ppp0 ip address to paho-mqtt client using the bind_address argument but it does not work. How to resolve this issue?

Unable to connect Rainbow Hat/Raspberry pi3 with Android Things using adb

I'm using Pimoroni Rainbow-Hat Raspberry pi3 kit. I have loaded android things image on sdcard. I have power cable and ethernet cable connected.
I can see Android things boot screen on display but i don't see the IP.
When i try to connect with adb connect Android.local it's not working(getting unknow host). I tried the ethernet cable from pi3 ethernet port to laptop , i can see the lan ip when i do ipconfig /all but when i try adb connect <-ip-:5555, still connection gets refused. but am able ping to the ip.
I am using Windows 7 OS.
Tried turning off IP v6, Windows Firewall, rebooting host etc, still not able to connect.
My main problem is getting the Aot device recognised on the host and load the app onto it.
I'm aware but haven't tried usb to ttl serial cable option mentioned here
I'm familiar with Android but new to iot/Aot , any help about where i am going wrong would be appreciated.
When i try to connect with adb connect Android.local it's not working(getting unknow host).
I tried the ethernet cable from pi3 ethernet port to laptop
The Raspberry Pi is a computer in its own right.
You need to connect the ethernet cable from the Pi3 to your router aka to the local network (not into your computer directly)
The follow the steps from the docs here and setup wifi to avoid further cable issues.

iPhone Simulator can not open (localhost) http://127.0.0.1:8000/foo/bar/

iPhone Simulator can not open (localhost) http://127.0.0.1:8000/foo/bar/
What is the reason?
The iOS Simulator uses the host machine network so you should be able to just use localhost or your machines IP address, whichever IP your web service is listening on.
So, try out this:
http://localhost:8000/your_path

How could one connect their iPhone to a Mac OS X's Safari Console?

I'm using my local ip :
ipconfig getifaddr $(route -n get default|awk '/interface/ { print $2 }')
Which returns :
192.168.200.11
And I'm running a Sinatra app that can be accessed via my computer at :
http://localhost:3000
If I do on my iPhone :
192.168.200.11:3000
It times out. And the same results occur on my laptop as well when I try and connect to the same address.
How do I connect my iPhone from here so that I can see my locally running app?
Extra miscellaneous infos
From my Iphone if I go to :
192.168.200.11
It brings up my pow is installed page..
Sounds like a firewall issue on your computer. It's allowing connections to port 3000 from localhost, but not from the local subnet. However, that rule is different for port 80.
You're sure your iPhone is on the same LAN as your computer? I.e. going to http://icanhazip.com/ on your iPhone gives you the same IP as going there with your computer?

Resources