Skip to content

Instantly share code, notes, and snippets.

@jonmarkgo
Created June 18, 2012 17:36
Show Gist options
  • Save jonmarkgo/2949583 to your computer and use it in GitHub Desktop.
Save jonmarkgo/2949583 to your computer and use it in GitHub Desktop.
Basic WiFly Setup
#include <SPI.h>
#include <WiFly.h>
char* ssid = "my$ssid$lol"; //enter your SSID here, replace all spaces with $ (ex. "my ssid lol" = "my$ssid$lol")
char* pass = "abc123"; //enter your wifi passphrase here
char* serverAddress = "1.2.3.4"; //enter the IP of your node.js server
int serverPort = 1337; //enter the port your node.js server is running on, by default it is 1337
WiFlyClient client;
void setup() {
Serial.begin(9600);
WiFly.setUart(&Serial);
WiFly.begin();
WiFly.join(ssid, pass, true);
client.connect(serverAddress,serverPort);
}
void loop()
{
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment