Skip to content

Commit

Permalink
new updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dimecho committed Dec 30, 2022
1 parent 819a582 commit 76cdcf6
Show file tree
Hide file tree
Showing 40 changed files with 2,550 additions and 1,259 deletions.
1,786 changes: 1,155 additions & 631 deletions ESPTiny-Plant.ino

Large diffs are not rendered by default.

44 changes: 23 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,24 @@ This is the next evolution from the original [ATtiny13 Plant](https://github.com
- Battery Deep Sleep (20μA)
- Modular PCB (ESP-12E Module, TP4056)

<p align="center">

![Photo](Web/img/photo.jpg?raw=true)

![GUI](Web/img/interface.png?raw=true)
![Diagram](Web/img/diagram.png?raw=true)

</p>

## Download

[ESP8266 Firmware](../../releases/download/1.0/ESPTiny-Plant-Firmware.zip)
[ESP8266 Firmware](../../releases/download/latest/ESPTiny-Plant-Firmware.zip)

## Connect

SSID: Plant
Password: (blank)
Interface: http://192.168.8.8

## Update

1) Connect to ESP8266 WiFi
2) Go to http://192.168.8.8/update

## BOM (Bill of Materials)

| Part | Value | Function |
Expand All @@ -46,34 +45,37 @@ This is the next evolution from the original [ATtiny13 Plant](https://github.com

For 12V Battery use HT7533**-2** Regulator

## Diagram
## Technical

![Diagram](Web/img/diagram.png?raw=true)
<p align="center">

![Technical](Web/img/technical.png?raw=true)

</p>

## Build

Sketch (Firmware)

1. Install [Arduino IDE](https://www.arduino.cc/en/main/software)
2. Arduino/File -> Preferences -> Additional Boards Manager URLs: http://arduino.esp8266.com/stable/package_esp8266com_index.json
3. Tools -> Boards -> Board Manager -> esp8266 -> Install
4. Tools -> Boards -> NodeMCU 1.0 -> Flash Size -> 4M (3M SPIFFS)
4. Tools -> Boards -> NodeMCU 1.0 -> Flash Size -> 4M (2M SPIFFS)
5. Sketch -> Export compiled Binary

Additional Libraries
Firmware Binary: `build/esp8266.esp8266.nodemcuv2/ESPTiny-Plant.ino.bin`

https://github.com/me-no-dev/ESPAsyncWebServer
https://github.com/devyte/ESPAsyncDNSServer
https://github.com/me-no-dev/ESPAsyncTCP
https://github.com/me-no-dev/ESPAsyncUDP
https://github.com/mobizt/ESP-Mail-Client
Additional Libraries

* https://github.com/me-no-dev/ESPAsyncWebServer
* https://github.com/devyte/ESPAsyncDNSServer
* https://github.com/me-no-dev/ESPAsyncTCP
* https://github.com/me-no-dev/ESPAsyncUDP
* https://github.com/mobizt/ESP-Mail-Client

FileSystem (Web Interface)
File System (Web Interface)

1. Run "littlefs-build-mac" (Mac) to build LittleFS "/data"
1. Run "littlefs-build-mac" (Mac) or "littlefs-build-win.ps1" (Windows) to build. LittleFS Binary: `build/flash-littlefs.bin`

**Note:** Files must be GZIP'ed. HTTP server sends compressed code to the Browser for decompression.
```
Expand All @@ -82,9 +84,9 @@ response->addHeader("Content-Encoding", "gzip");

Flashing Options:

1. [Wireless - Web Interface](http://192.168.8.8/update)
2. [USB-Serial/TTL - Arduino LittleFS Plugin](https://github.com/earlephilhower/arduino-esp8266littlefs-plugin)
3. USB-Serial/TTL - Script "littlefs" (Mac)
1. Wireless - Web Browser [http://192.168.8.8/update](http://192.168.8.8/update)
2. USB-Serial/TTL - [Arduino LittleFS Plugin](https://github.com/earlephilhower/arduino-esp8266littlefs-plugin)
3. USB-Serial/TTL - Script "littlefs-flash-mac" (Mac) or "littlefs-flash-win.ps1" (Windows)

![Flash](Web/img/flash.png?raw=true)

Expand Down
4 changes: 2 additions & 2 deletions Web/css/bootstrap.css
100644 → 100755

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions Web/css/bootstrap.slate.css
100644 → 100755

Large diffs are not rendered by default.

Empty file modified Web/css/rangeslider.css
100644 → 100755
Empty file.
Empty file modified Web/favicon.ico
100644 → 100755
Empty file.
4 changes: 2 additions & 2 deletions Web/graph.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<script src="js/graph.js"></script>
</head>
<body>
<div class="toast-container position-absolute top-0 end-0 p-3" id="notify" style="z-index:2000"></div>
<div class="container-fluid d-flex flex-column">
<div class="row d-flex mt-4">
<div class="col-auto mr-auto mb-auto mt-auto" id="buildGraphButtons"></div>
Expand All @@ -53,8 +54,7 @@
</div>
</div>
<div class="row p-4">
<div class="col" id="buildGraphSlider">
</div>
<div class="col" id="buildGraphSlider"></div>
</div>
<div class="row mt-4"></div>
</div>
Expand Down
Empty file modified Web/img/diagram.drawio
100644 → 100755
Empty file.
Empty file modified Web/img/diagram.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Web/img/flash.drawio
100644 → 100755
Empty file.
Empty file modified Web/img/flash.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Web/img/icon.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Web/img/icon.svg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified Web/img/interface.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Web/img/photo.jpg
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified Web/img/technical.drawio
100644 → 100755
Empty file.
Empty file modified Web/img/technical.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
350 changes: 255 additions & 95 deletions Web/index.html
100644 → 100755

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions Web/js/bootstrap.js
100644 → 100755

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Web/js/chart.js
100644 → 100755

Large diffs are not rendered by default.

30 changes: 26 additions & 4 deletions Web/js/graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@ var graphDivision = 60;
var lineWidth = 3;
var pageLimit = 4;

var LOG_INTERVAL = 10;
var DEEP_SLEEP = 22;

var chart_datasets = [{
type: 'line',
label: 'ADC Value',
Expand Down Expand Up @@ -109,8 +112,9 @@ function buildGraphMenu() {
var menu_buttons = $('#buildGraphButtons'); //.empty();
var export_buttons = $('#buildGraphExport'); //.empty();

var btn_start = $('<button>', { class: 'btn btn-success mr-4' }).append('Start Graph');
var btn_stop = $('<button>', { class: 'btn btn-danger mr-4' }).append('Stop Graph');
var btn_start = $('<button>', { class: 'btn btn-success m-2' }).append('Start Graph');
var btn_stop = $('<button>', { class: 'btn btn-danger m-2' }).append('Stop Graph');
var btn_clean = $('<button>', { class: 'btn btn-warning m-2' }).append('Clear Data');

var e_settings = $('<i>', { class: 'icons icon-settings h1 ml-4', 'data-toggle': 'tooltip', 'title': 'Settings' });
var e_img = $('<i>', { class: 'icons icon-png h1 ml-4', onClick: 'exportPNG()', 'data-toggle': 'tooltip', 'title': 'Export Image' });
Expand All @@ -135,6 +139,23 @@ function buildGraphMenu() {
btn_start.prop('disabled', false);
});

btn_clean.click(function() {
var log = new XMLHttpRequest();
log.open('GET', 'clearlog', true);
log.send();
log.onload = function() {
if (log.status == 200) {
if (log.responseText == "...") {
notify('', 'Logs Cleaned', 'success');
}else{
notify('', 'Logs Uknown', 'warning');
}
}else{
notify('', 'Logs Failed', 'danger');
}
};
});

e_settings.click(function() {
window.location.href = '#graphSettings';
document.getElementById('graphSettings').style.display = 'block';
Expand Down Expand Up @@ -166,10 +187,10 @@ function buildGraphMenu() {
if(btn_start[0].disabled == true) {

var xhr = new XMLHttpRequest();
//xhr.open('GET', 'nvram?offset=9&value=10', true);
//xhr.open('GET', 'nvram.json?offset=' + LOG_INTERVAL + '&value=10', true);
//xhr.send();

xhr.open('GET', 'nvram?offset=20&value=' + (e.from * 60), true);
xhr.open('GET', 'nvram.json?offset=' + DEEP_SLEEP + '&value=' + (e.from * 60), true);
xhr.send();

//if (xhr) xhr.abort();
Expand All @@ -181,6 +202,7 @@ function buildGraphMenu() {

menu_buttons.append(btn_start);
menu_buttons.append(btn_stop);
menu_buttons.append(btn_clean);

export_buttons.append(e_settings);
export_buttons.append(e_img);
Expand Down
Loading

0 comments on commit 76cdcf6

Please sign in to comment.