-As explained in [wifi tutorial](/wifi.html), Tessel 2 can easily connect to wifi networks using the command line tool. If we're using a device connected to the same network as the Tessel, then we can connect to it through our device's web browser. Like most network-connected devices, communication over the web depends on a shared router, or access point, to direct requests and responses between every device on the network or through the Internet. This is fine and dandy if we want to use Tessel in a place with an available network, but what happens when that's not possible?
+A typical WiFi setup consists of a couple of devices: a modem, which is connected by wire to the internet, and a wireless access point (also called a WAP or router), wired to the modem, which directs requests and responses between every device on the network.
+
+As explained in [wifi tutorial](/wifi.html), Tessel 2 can easily connect to wifi networks using the command line tool. If your computer is connected to the same WAP as the Tessel, then the two devices can talk to each other. This is how we push code to Tessel over LAN (local area network).
+
+The connection setup looks about like this:
-
+

-
-Instead of requiring a shared network through a standalone router, we can use the command line tool for configuring Tessel to emit a custom Wifi network and use it as an access point. Then, using Node, we can also start a web server for communicating with any connected device. Unfortunately, we won't be able to connect to the Internet but there is still a lot we can do without that. By the end of this article, we'll be able to control the Tessel LEDs through a web app served by the Tessel.
+
+This is fine and dandy if we want to use Tessel in a place where there's a modem and WAP already set up, but what happens when that's not possible?
+
+We can't access the Internet without a modem, but we can create a LAN connection between devices by turning Tessel 2 into a WAP. Devices on the network can all talk to each other, like this:
+
-
+

+
+This tutorial shows you to turn Tessel into a wireless access point, thus creating your own local network.
+
-
+
-In your command line, make a folder for your Tessel code, then initialize a Tessel project in that folder by running each of the following commands in the terminal:
-
-`mkdir tessel-router`
-
-`cd tessel-router`
-
-`t2 init`
-
-Rename the “index.js” file you’ve just created to “ap.js”, then copy and paste the below script over the existing text:
-
-{% highlight javascript %}
-// Import the interface to Tessel hardware
-var tessel = require('tessel');
-// Load the http module to create an http server.
-var http = require('http');
-
-// Configure our HTTP server to respond with "Hello from Tessel!" to all requests.
-var server = http.createServer(function (request, response) {
- response.writeHead(200, {"Content-Type": "text/plain"});
- response.end("Hello from Tessel!\n");
-});
-
-// Listen on port 8080, IP defaults to 192.168.1.101. Also accessible through [tessel-name].local
-server.listen(8080);
-
-// Put a friendly message on the terminal
-console.log("Server running at http://192.168.1.101:8080/");
-
-{% endhighlight %}
Now that our server is in place, let's get our access point set up. In the terminal, run the following command:
-`t2 ap -n TesselRouter`
-
-This will make an open, or password-less, wifi network called TesselRouter. If you open the wifi setting of your computer or a separate device like a smartphone or tablet, and scan for new devices, you should be able to see and connect to this new network. For info about making a secure network, take a look at [the cli docs](https://tessel.io/docs/cli#usage). After connecting to TesselRouter, run the following command in your terminal:
-
-`t2 run ap.js`
-
-
-Once you see "Server running at http://192.168.1.101:8080/" in the terminal, we can connect to that URL (or http://tessel.local:8080/, replacing "tessel" with the name of your Tessel) in a web browser of the device connected to the TesselRouter network.
-
-
-Now let's take it up a notch by adding some interactivity between the web page and the Tessel!
-
-
-
-Let's start this next part by building out the web page we want Tessel to send to your web browser. Create a file called `index.html` in your project directory and open it up in your preferred text editor to add the initial html for our web page:
-
-{% highlight html %}
-
-
-
-
- Tessel Web App
-
-
-
Hello from Tessel!
-
Press a button to toggle an LED.
-
-
-
- Status:
-
-
-
- Status:
-
-
-
-
-{% endhighlight %}
-
-
-In that html, we have a heading, a line of instructions for the user, and a list of buttons for controlling a corresponding LED on the Tessel. Below that list of buttons we'll add some JavaScript for communicating with the Tessel:
-