Skip to content

Commit

Permalink
Updated example esphttpd
Browse files Browse the repository at this point in the history
Signed-off-by: Mikhail Grigorev <sleuthhound@gmail.com>
  • Loading branch information
CHERTS committed Dec 1, 2015
1 parent c451902 commit b578081
Show file tree
Hide file tree
Showing 35 changed files with 715 additions and 4,324 deletions.
2 changes: 1 addition & 1 deletion Espressif/examples/esphttpd/Makefile
Expand Up @@ -121,7 +121,7 @@ MODULES = user
EXTRA_INCDIR = include libesphttpd/include

# libraries used in this project, mainly provided by the SDK
LIBS = c gcc hal phy pp net80211 wpa main lwip crypto
LIBS = c gcc hal phy pp net80211 wpa main lwip
#Add in esphttpd lib
LIBS += esphttpd

Expand Down
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions Espressif/examples/esphttpd/html/index.tpl
Expand Up @@ -12,12 +12,15 @@ been loaded <b>%counter%</b> times.
<li>If you haven't connected this device to your WLAN network now, you can <a href="/wifi">do so.</a></li>
<li>You can also control the <a href="led.tpl">LED</a>.</li>
<li>You can download the raw <a href="flash.bin">contents</a> of the SPI flash rom</li>
<li>Esphttpd now also supports <a href="websocket/index.html">websockets</a>.</li>
<li>And because I can, here's a link to my <a href="http://spritesmods.com/?f=esphttpd">website</a></ul>
</ul>
</p>

<p>And because we're on the Internets now, here are the required pictures of cats:<br />
<img src="cats/cross-eyed-cat.jpg"><br />
<img src="cats/junge-katze-iv.jpg"><br />
<img src="cats/kitten-loves-toy.jpg"><br />
</p>
</div>
</body></html>
69 changes: 69 additions & 0 deletions Espressif/examples/esphttpd/html/websocket/index.html
@@ -0,0 +1,69 @@
<!DOCTYPE html>

<meta charset="utf-8" />

<title>WebSocket Test</title>

<script language="javascript" type="text/javascript">

var wsUri = "ws://"+window.location.host+"/websocket/ws.cgi";
var output;

function init()
{
output = document.getElementById("output");
testWebSocket();
}

function testWebSocket()
{
websocket = new WebSocket(wsUri);
websocket.onopen = function(evt) { onOpen(evt) };
websocket.onclose = function(evt) { onClose(evt) };
websocket.onmessage = function(evt) { onMessage(evt) };
websocket.onerror = function(evt) { onError(evt) };
}

function onOpen(evt)
{
writeToScreen("CONNECTED");
doSend("WebSocket rocks");
}

function onClose(evt)
{
writeToScreen("DISCONNECTED");
}

function onMessage(evt)
{
writeToScreen('<span style="color: blue;">RECEIVED: ' + evt.data+'</span>');
// websocket.close();
}

function onError(evt)
{
writeToScreen('<span style="color: red;">ERROR:</span> ' + evt.data);
}

function doSend(message)
{
writeToScreen("SENT: " + message);
websocket.send(message);
}

function writeToScreen(message)
{
var pre = document.createElement("p");
pre.style.wordWrap = "break-word";
pre.innerHTML = message;
output.appendChild(pre);
}

window.addEventListener("load", init, false);

</script>

<h2>WebSocket Test</h2>

<div id="output"></div>
10 changes: 0 additions & 10 deletions Espressif/examples/esphttpd/include/user_config.h
@@ -1,11 +1 @@
#ifndef __USER_CONFIG_H__
#define __USER_CONFIG_H__

#define USE_WIFI_MODE STATIONAP_MODE
#define WIFI_CLIENTSSID "MYAP"
#define WIFI_CLIENTPASSWORD "00000000"
#define WIFI_AP_NAME "ESP8266"
#define WIFI_AP_PASSWORD "00000000"
#define PLATFORM_DEBUG true

#endif
14 changes: 0 additions & 14 deletions Espressif/examples/esphttpd/lib/heatshrink/LICENSE

This file was deleted.

49 changes: 0 additions & 49 deletions Espressif/examples/esphttpd/lib/heatshrink/Makefile

This file was deleted.

49 changes: 0 additions & 49 deletions Espressif/examples/esphttpd/lib/heatshrink/README.md

This file was deleted.

52 changes: 0 additions & 52 deletions Espressif/examples/esphttpd/lib/heatshrink/dec_sm.dot

This file was deleted.

51 changes: 0 additions & 51 deletions Espressif/examples/esphttpd/lib/heatshrink/enc_sm.dot

This file was deleted.

0 comments on commit b578081

Please sign in to comment.