basic led code

This commit is contained in:
2018-09-02 19:10:32 +02:00
parent bafc541cbb
commit e9ba25c4db
20 changed files with 910 additions and 1 deletions

10
data/example.config.json Normal file
View File

@@ -0,0 +1,10 @@
{
"stationMode": 0,
"channel": 11,
"meshPort": 5555,
"meshSSID": "illucat-mesh",
"meshPassword": "th3r31sn0sp00n",
"stationSSID": "MyAP",
"stationPassword": "th3r31sn0sp00n",
"hostname": "illucat"
}

22
data/www/index.html Normal file
View File

@@ -0,0 +1,22 @@
<html>
<head>
<script src="jquery-3.3.1.min.js"></script>
<script src="script.js"></script>
</head>
<body>
<h1>Sprocket Config</h1>
<button class="js-restart">Restart</button>
<br>
<br>
<form action="/config" method="post">
<textarea name="config" class="js-config" rows="20" cols="50"></textarea>
<br>
<input type="submit" value="Submit">
</form>
</body>
</html>

2
data/www/jquery-3.3.1.min.js vendored Normal file

File diff suppressed because one or more lines are too long

25
data/www/script.js Normal file
View File

@@ -0,0 +1,25 @@
// mesh topology:
const exampleMesh = [{
"nodeId": 757307929, "subs": [
{ "nodeId": 2138241514, "subs": [] },
{ "nodeId": 757307466, "subs": [] }
]
}, {
"nodeId": 757308244, "subs": [
{ "nodeId": 3154639577, "subs": [] }
]
}, {
"nodeId": 3954439712, "subs": []
}];
$(() => {
// load config
$.get("/config.json", (data) => {
$('.js-config').val(JSON.stringify(data, null, 4));
});
// add handlers
$('.js-restart').click(() => {
$.post('/restart');
alert('restarting...');
});
});