Skip to content

Commit

Permalink
refactor the data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
universam1 committed Oct 24, 2021
1 parent a20d94b commit 8860598
Show file tree
Hide file tree
Showing 6 changed files with 245 additions and 224 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Check out [IOT DEVICE PULLS ITS WEIGHT IN HOME BREWING](http://hackaday.com/2017
- [Schaltplan](#schaltplan)
- [Schlitten](#schlitten)
- [Konfiguration](#konfiguration)
- [Test Server](#test-server)
- [Ubidots](#ubidots)
- [Portal](#portal)
- [BierBot Bricks](#bierbot-bricks)
Expand Down Expand Up @@ -211,6 +212,10 @@ Die obige Platine kann (über Trenn-Schnitt) mit dem Kunstoff Schlitten in Kombi

## Konfiguration

### Test Server

[simple test server](tools/TestServer/Readme.md)

### Ubidots

- Zu Beginn muss ein kostenloser Account bei [Ubidots.com](https://ubidots.com) erstellt werden
Expand Down
50 changes: 33 additions & 17 deletions docs/README_en.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,23 +28,35 @@ iSpindle (iSpindel) Documentation
- [Ubidots scripting](ubidotsscripting_en.md)


- [License](#license)
- [Principle](#principle)
- [Metacentric Height](#metacentric-height)
- [Construction](#construction)
- [Components](#components)
- [Circuit Diagram](#circuit-diagram)
- [Sled](#sled)
- [Configuration](#configuration)
- [Ubidots](#ubidots)
- [Portal](#portal)
- [BierBot Bricks](#bierbot-bricks)
- [Blynk](#blynk)
- [Graphical User Interface](#graphical-user-interface)
- [Calibrating the Spindle](#calibration)
- [Ubidots Graphen](#ubidots-graphen)
- [CraftBeerPi](#craftbeerpi)
- [Software](#software)
- [iSpindle Documentation](#ispindle-documentation)
- [iSpindle (iSpindel) Documentation](#ispindle-ispindel-documentation)
- [Table of Contents](#table-of-contents)
- [License](#license)
- [Principle](#principle)
- [*Metacentric Height*](#metacentric-height)
- [Construction](#construction)
- [see Parts](#see-parts)
- [see Sourcing](#see-sourcing)
- [see Circuit Diagram](#see-circuit-diagram)
- [see iSpindel Breadboard Mounting](#see-ispindel-breadboard-mounting)
- [Drawer](#drawer)
- [Configuration](#configuration)
- [Test Server](#test-server)
- [Ubidots](#ubidots)
- [Portal](#portal)
- [BierBot Bricks](#bierbot-bricks)
- [Blynk](#blynk)
- [Cloning the Example](#cloning-the-example)
- [Using your own App](#using-your-own-app)
- [MQTT](#mqtt)
- [Home Assistant](#home-assistant)
- [Other MQTT broker](#other-mqtt-broker)
- [Graphical User Interface](#graphical-user-interface)
- [Calibration](#calibration)
- [Ubidots Graphen](#ubidots-graphen)
- [CraftBeerPi](#craftbeerpi)
- [Software](#software)
- [Firmware flashing](#firmware-flashing)


***
Expand Down Expand Up @@ -107,6 +119,10 @@ alt="Druck" width="240" height="180" border="10" /></a>

## Configuration

### Test Server

[simple test server](tools/TestServer/Readme.md)

### Ubidots

- To start, you must create a free account at [Ubidots.com](https://ubidots.com)
Expand Down
46 changes: 23 additions & 23 deletions pio/lib/Globals/Globals.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
extern Ticker flasher;

// defines go here
#define FIRMWAREVERSION "7.1.3"
#define FIRMWAREVERSION "7.1.4"

#define API_FHEM true
#define API_UBIDOTS true
Expand Down Expand Up @@ -114,7 +114,7 @@ extern Ticker flasher;
// sleep management
#define RTCSLEEPADDR 5
#define MAXSLEEPTIME 3600UL //TODO
#define EMERGENCYSLEEP (myData.my_sleeptime * 3 < MAXSLEEPTIME ? MAXSLEEPTIME : myData.my_sleeptime * 3)
#define EMERGENCYSLEEP (myData.sleeptime * 3 < MAXSLEEPTIME ? MAXSLEEPTIME : myData.sleeptime * 3)
#define LOWBATT 3.3

#define UNINIT 0
Expand All @@ -133,28 +133,28 @@ String tempScaleLabel(uint8_t);

struct iData
{
char my_token[TKIDSIZE * 2];
char my_name[TKIDSIZE] = "iSpindel000";
char my_server[DNSSIZE];
char my_uri[DNSSIZE];
char my_db[TKIDSIZE] = "ispindel";
char my_username[TKIDSIZE];
char my_password[TKIDSIZE];
char my_job[TKIDSIZE] = "ispindel";
char my_instance[TKIDSIZE] = "000";
char my_polynominal[1000] = "-0.00031*tilt^2+0.557*tilt-14.054";
String my_ssid;
String my_psk;
uint8_t my_api;
uint32_t my_sleeptime = 15 * 60;
uint16_t my_port = 80;
uint32_t my_channel;
float my_vfact = ADCDIVISOR;
int16_t my_Offset[6];
uint8_t my_tempscale = TEMP_CELSIUS;
int8_t my_OWpin = -1;
char token[TKIDSIZE * 2];
char name[TKIDSIZE] = "iSpindel000";
char server[DNSSIZE];
char uri[DNSSIZE];
char db[TKIDSIZE] = "ispindel";
char username[TKIDSIZE];
char password[TKIDSIZE];
char job[TKIDSIZE] = "ispindel";
char instance[TKIDSIZE] = "000";
char polynominal[1000] = "-0.00031*tilt^2+0.557*tilt-14.054";
String ssid;
String psk;
uint8_t api;
uint32_t sleeptime = 15 * 60;
uint16_t port = 80;
uint32_t channel;
float vfact = ADCDIVISOR;
int16_t Offset[6];
uint8_t tempscale = TEMP_CELSIUS;
int8_t OWpin = -1;
#if API_MQTT_HASSIO
bool my_hassio = false;
bool hassio = false;
#endif
};

Expand Down
4 changes: 2 additions & 2 deletions pio/lib/WiFiManagerKT/WiFiManagerKT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -986,9 +986,9 @@ void WiFiManager::handleiSpindel()
page += Tilt;
page += F("&deg;</td></tr>");
page += F("<tr><td>Temperature:</td><td>");
page += scaleTemperatureFromC(Temperatur, myData.my_tempscale);
page += scaleTemperatureFromC(Temperatur, myData.tempscale);
page += F("&deg;");
page += tempScaleLabel(myData.my_tempscale);
page += tempScaleLabel(myData.tempscale);
page += F("</td></tr>");
page += F("<tr><td>Battery:</td><td>");
page += Volt;
Expand Down
Loading

0 comments on commit 8860598

Please sign in to comment.