0

Sorry if I am confusing things (don't know much about this topic). Basically, I want to access my raspberry pi wirelessly from my phone as long as I am within a few meters of it, and in this situation there is no wireless internet available.

So, I want the raspberry pi to serve as a wireless access point. I have seen other tutorials out there for this, so that isn't my question. After the wireless access point is set up, I want to connect to its network using my phone, and then on my phone navigate to 127.0.0.1 (I think this is the localhost default?) and see a webpage hosted by the pi --> how to get a webpage here is part 1 of my question.

Part 2 --> after I make my .html file and embed it with javascript to detect button pushes, etc., how can I communicate javascript actions into terminal commands on the pi?

I know this is convoluted, so I appreciate any bits of help offered. Thanks guys!

PS - I am trying to build a raspberry pi based dash cam. The user (driver of the car) will connect to the pi by accessing the pi's wifi network, load the pi's webpage, and then can control the dashcam's ability (on/off, checking storage, deleting old stuff, livepreview, etc.) through an interactive page hosted by the pi. Once complete I'll happily make it open-source!

1

1 Answer 1

2

As you mentioned you have a few items confused. You mentioned you configured the Pi as an Access Point from other tutorials so assuming it is set up correctly, we'll start with validating that setup and move on to the web server.

  1. On the Pi we want to ensure a web server is running. Having enable an 802.11 Access Point does not start a web server. This is a separate step. Read additional tutorials on Pi to install software - specifically a web server. Once complete, proceed.

  2. You are correct in stating localhost has an IP of 127.0.0.1 -- however those two items are the same for every single computer. On the Raspberry Pi if you open a browser and navigate to http://127.0.0.1 then you will access the Pi's web server (which was installed in step 1 above). It should give you a page. If not go back to those tutorials until you have this step working - probably needs additional configuration of the web server.

  3. Now you need to determine the IP address of the Pi. 127.0.0.1 as we know is the localhost IP ... we need the external IP. On a desktop machine you would open a terminal and run "ifconfig" or "ipconfig." I would suspect you configured an IP as part of the setup of the Access Point ...

  4. Now that you know the IP of the Pi -- connect another machine to that AP. Now we come to a third topic of tutorials for you to learn -- you will need to enable DHCP on the Pi to offer valid IP addresses to clients which connect to the AP. Go learn this now. Once you have configured the Pi to issue IP's via DHCP, when you connect a client machine check that it has an appropriate IP for the AP.

  5. Now we can remotely connect to the Pi's web server from our client machine (smart phone?) ... open a browser on the client machine and enter the IP of the Pi. You should see the same page as in step 2.

  6. Go and code your project.

Caveat -- this all presumes you have a functioning OS on your Pi and that it in fact can run a web server, DHCp server and 802.11 Wifi Access Point ...

1
  • Great explanation, put me in the right direction. thanks!
    – jake9115
    Feb 18, 2015 at 18:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .