I have a RN-171 WiFLy module (I'm very new to working with hardware, btw) and I need it to talk to an iPhone over WiFi.
To achieve that, I've chosen to host a web server on the iPhone using CocoaHTTPServer, set the RN-171 in Adhoc mode, join the network via the iPhone and then send requests to the iPhone server via the device.
The module works correctly when I try to load a page on my Mac (running on Apache). The device prints out *OPEN*, shows the returned HTML and then prints out *CLOSE*.
With the iPhone application, however, it simply hangs at *OPEN* for a while until it times out and then shows *CLOSE*. I've put a breakpoint in the application and can indeed see that it is hitting the iPhone server but for some reason the server is responding correctly.
I couldn't figure out the issue by stepping through the application but I'm guessing that the request isn't being closed or something.
set dns name www.rovingnetworks.com
set ip host 0
set ip remote 80
set ip proto 18
set com remote GET$/server.php?value=
set sys auto 10
set option format 1
set uart mode 2
save
reboot
The above are the commands I'm entering into the device to try and get it to connect taken from manual. In my case, I'm setting the dns name to the iPhone IP and the remote string to the GET$/index.html?value= however I'm not having any luck.
Any ideas?
I was using Picocom to talk to the device. I set the options to convert linefeeds and carriage returns to CRLF and it worked correctly.
Related
I am trying to make something work but I am not sure it is even possible. Here is the rundown on the devices I have connected.
Main linux webserver - Authenticated website, controls some things, ran on device 1, IP address exposed to the internet.
2nd linux webserver - Accessed on local network only, device controls different things than the 1st. Ran on device 2.
3rd linux webserver - Once again, accessed on local network only, device controls different things than the 1st and 2nd. Ran on device 3.
Is it possible to display the webpage of the 2nd and 3rd web server via an iframe off the first main device webpage? I first thought I could do a reverse proxy but, when I followed guides on the internet, I could get the iframe to only display off the main webserver page when the client device was on the local network, otherwise it looks like the iframe is trying to connect to the ip address of the 2nd and 3rd device which is not exposed to the internet.
Would a reverse proxy be able to achieve this without exposing the other 2 devices directly to the web and I just didn't set it up correctly? Is there another way to do this or just deal with this limitation?
Thank you!
I tried setting up a reverse proxy from this guide: https://www.digitalocean.com/community/tutorials/how-to-use-apache-as-a-reverse-proxy-with-mod_proxy-on-ubuntu-16-04 and https://www.digitalocean.com/community/tutorials/how-to-use-apache-http-server-as-reverse-proxy-using-mod_proxy-extension
'Main linux webserver' must be able to ping the other two servers.
The other two local servers have a unique IP address - right?
On the other two local servers you could have apache serving up web pages.
Then 'Main linux webserver' can then request the URL pages from other two servers to get the pages into iframes.
I'm developing an API and I am hosting it on my desktop server running Windows 10 using php -S localhost:8080 -t D:\Code\Projects\Website.
I want to be able to use my iPhone to visit this localhost:port webpage without plugging my iPhone into my computer via a USB since they are on the same network. Although, my desktop does not have WiFi capabilities; rather it is using an ethernet cable plugged directly into my router. When I use this address on my desktop, it works fine and takes me to my index.php page.
If I open my default gateway 10.0.0.1 NETGEAR Genie, I can see my iPhone's IP is listed as an "attached device."
I added an Inbound rule to my Firewall (TCP, port:8080, allow access, domain/public/private enabled), but I still cannot use my iPhone to reach this webpage using [my_desktop_ipv4]:[8080].
Would there be any security restrictions from my iPhone's iOS settings? Or am I missing something?
I'm developing an iPhone app that has a network component. I'm developing the app in Java (Google App Engine actually), running on port 8080. And it works, when I test my app in the iPhone simulator.
But now I am trying to test on the device, and I can't hit my Jetty instance. I can certainly access my Mac via the iPhone because I'm able to hit http://10.0.1.7/~brianpapa/ and view my Home Folder when Web Sharing is turned on. But when I try to hit http://10.0.1.7:8080/, it says it can't connect to the server.
Interestingly, if I try to hit http://10.0.1.7:8080/ from my mac, it doesn't work either - I have to use localhost as the hostname instead, then it's fine. Has anybody ever encountered this before, and know how to fix it?
You need to bind the server to your external ip address. See the docs:
--address=...
The host address to use for the server. You may need to set this to be able to access the development server from another computer on your network. An address of 0.0.0.0 allows both localhost access and hostname access. Default is localhost.
I want to create an iPhone app which makes calls to a web service. For testing, I want to first create the API calls on my mac (server running XAMPP) and if it works fine there I want to port it to the actual server.
If my iPhone and mac are on the same network, can I access the web service using the IP address of my mac?
Thanks.
Any time someone answers with "why not," ignore the post. This just takes up space and adds absolutely no value...their post imitating their life.
Anyway, I access my laptop localhost (WAMP stack) from my iPod Touch by entering the IP address of my laptop on my Touch location bar. There is some configuration that needs to happen for this to work. I found what I needed at:
http://www.frihost.com/forums/vt-88381.html
Good Luck!
I can not speak about actual development, however I access intranet pages from a Ipod Touch all the time by either typing http ://ip or http://local_dns_name
As long as the iphone / ipod is on the network correctly (e.g. through standard wifi and not 3g/whatever) you should be able to access any and all local resources.
What I do:
Connected to the same network, I go in to the wireless settings and create a manual proxy that points to my machine. I use Charles proxy for testing a lot/seeing traffic, works like a charm and it lets me use my macbook hosts file so I don't need to do any funky listening rules in apache - just the same vhost settings I use on my machine already.
http://www.charlesproxy.com/documentation/faqs/using-charles-from-an-iphone/
Why not?
Have you tried it and have some problems?
Is there any way I can capture network traffic (using application like Ethereal, on Mac ) while the application is running on iPhone and connected to xcode
Thanks
Connect you mac using an ethernet cable. Share your network connection on the mac over your AirPort. Attach the iPhone to your Mac's ad-hoc network.
Run Wireshark or HTTPScoop on your mac and you will be able to see all traffic from the iPhone.
I'm no aware of any way to do this for the WAN connection though. I'd be surprised if it is possible.
To capture packets from your iPhone using Wireshark, you have to first get your device id for the phone from iTunes. Plug in your iPhone via USB to your Mac...then open iTunes and click the iPhone icon in top navbar.
You can't copy the UUID, so you have to write it down manually. After you have the UUID, you'll need to mount the device.
Open a terminal and type: rvictl -s <device-id>
I created an alias in ~/.bash_aliases as alias mntios='rvictl -s <device-id>' -- as long as you have the same phone your device UUID won't change, even if you re-install the OS.
Once you have the device mounted startup wireshark. brew install wireshark (see: http://brew.sh)
One of the network adaptors should be rvi0 -- this is the network interface for your iPhone.
Now you can capture packets -- double click it to start capturing.
If you want to filter for specific urls you can type a filter like: http.request.full_uri contains <string-in-url> to filter requests.
On your computer, run an HTTP debugging proxy like Charles (Mac) or Fiddler2 (Windows). In the phone's wi-fi settings, turn on the HTTP proxy, entering your computer's IP address and the port number of the proxy. Make the sure the proxy is configured to allow connections from your phone. (It may allow localhost-only by default.)