Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

local WLAN http-pages, influx-db integration and translation system #453

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

tom-r
Copy link

@tom-r tom-r commented Apr 7, 2022

Implements

  1. 2 local http-pages on sensor, which are accessible in the local WLAN
  • first page is display of actual sensor values, Wifi-quality, memory, etc
  • temp./humidity&pressure are displayed if BME 2/680 sensor is connected
  • second page show log-infos, which are normally visible on serial output only.
  • Debug level is temporarily adjustable
    Purpose is to monitor the current status of the sensor being installed outside, without the necessity to take it back in.
    Sensor data can also be monitored with broken Internet connection as long as WLAN is available.
  1. added an influx-db data export to the Config-page.
  2. added a translation system, so that language of texts displayed on the 2 pages can be selected at compile-time. Firmware is compiled then with the selected language.
    the only prerequisite is to set a build-flag '-DTRANSL_XX', where XX is the language.
    see platformio-example.ini for a sample. Languages DE and EN are available already.
    Auswahl_010-thumb
    Auswahl_011

tom-r added 3 commits March 31, 2022 22:25
* a web page with actual sensor data, incl. wifi signal quality, firmware version...
* a debug web page, showing the serial log, change of log level
* adds a influx-db option in the configuration
* fixes a bug in the configuration page : on first time call, text attributes were filled with ????
…roduced.

See platformio-example.ini, use
[env:geiger] to compile in DE,
[env:geger_en] for compilation with EN texts

Translations not yet fully done (log messages and config page still only in EN, as before)
various smaller fixes
@@ -0,0 +1,52 @@
/* TR, 07.04.2022
add new translation strings to ALL files translations_xx.h !!!
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

translations have to work based on the already established workflow we already use for documentation (standard gettext / po files / transifex as nice UI for translators).

do not reinvent the wheel.

and also please do not put something major like this into another pull request.

Copy link
Author

@tom-r tom-r Apr 7, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did not reinvent the wheel, this is all (!) ported from the Luftdaten-Sensor project, with some improvements...
This is an ESP32, not a computer, and you really have to tweak the code for memory and size consumption. You have to move this from the heap and put it into flash memory/PROGMEM as much as possible, to get it performing at least somehow. Standard gettext & po files will not really work with an ESP32. I'm not even sure it the macros for po/gettext are available for the ESP platform ( I didn't check this, to be honest).
On the other hand : When else would you need text translations in a web page, if not upon introduction of the pages themselves ...

Copy link
Contributor

@ThomasWaldmann ThomasWaldmann Apr 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this PR is way too big and unfocussed IMHO.

it needs to get split up, please start with a PR that ONLY implements the http pages (in English).

no translations, no influxdb.

tom-r added 3 commits April 8, 2022 12:11
Readme file adopted with changes in this fork
README_Fork_changes.md added
platformio-example.ini updated with IT language
@t-pi
Copy link
Contributor

t-pi commented Apr 8, 2022

@tw, imo the translation for the embedded pages can differ from the translation for the documentation.
@tom-r, there is a pull request in validation to simplify somewhat the different events (currently under transmit or publish) into a single event processing function. I propose to wait for its approval and then integrate influx connection afterwards.

@tom-r
Copy link
Author

tom-r commented Apr 8, 2022

Da gibt's noch 'ne Baustelle die mir aufgefallen ist, mit den Logleveln:
In der V1.17-0-dev existieren 2 unterschiedliche Log-Zyklen, einmal der Loglevel-Kreis mit NOLOG. CRITICAL, ERROR, WARNING, INFO und DEBUG (s. log.h), wobei NOLOG unüblicherweise = 999 gesetzt ist und dann von 4 abwärts bis DEBUG = 0; also kleinere Zahl --> mehr Info
Und weiterhin der im multigeiger.ino verwendete "Serial_Print_Mode" (s. log_data.h). Hier wird mehr Info bei steigenden Werten ausgegeben.
Das ist gegenläufig und schießt sich selbst ins Knie ...
Deswegen hab ich in diesem PR den NOLOG ... DEBUG Zyklus umgedreht ( die hinterlegten Nummern und diese 'inkludiere alle kleineren Werte'-Regel).

Üblicherweise setzt man loglevel auf 0 und hat keine Ausgabe und je höher der Wert, desto mehr Log wird ausgegeben (so wie im Serial_Print_Mode).
Zumindest kenn ich das so aus dem Berufsleben.
Dann hast' außerdem die Möglichkeit noch ein zusätzliches Level mit mehr Infos einzuführen und stehst' net bei Null an ...

Am Ende gehört aber m.E. der Serial_Print_Mode-Zyklus aus log_data.h in die normalen Loglevel überführt ...
(Das habe ich nicht gemacht )

* removed CRITICAL and WARNING as they are not used at all
* integrated the second compile time logdata selection behind Serial_Print_Mode
--> see log_data.h for details
Log-Levels are now
NOLOG     0 --> incl. Serial_None, display ALARMS, else turn off logging
ERROR     1 --> incl.  0 (=alarms)
MIN_INFO  2 --> incl. Serial_Statistics_Log + 0 + 1
MED_INFO  3 --> incl. Serial_One_Minute_Log + 0 + 1
MAX_INFO  4 --> incl. Serial_Logging + 0 + 1
DEBUG     5 --> incl. Serial_Debug + 0 + 1 + 4
That means it is possible to switch the serial log output by changing the log level
on the debug page.
Be aware that Serial_One_Minute_Log only creates output 1/min. Until then the frame is empty ...

* log levels also changed on debug page
* rollover messages added on some of the log level buttons
* minor fixes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants