kwgt / envlog

A logger for environment data.
MIT License
0 stars 0 forks source link

envlog

A logger for environment data.

Installation

gems

I am not registered gem file to gem.org at the moment, so build a gem file by yourself.

$ bundle install
$ rake build

Use the file to install it with the gem command.

$ gem install pkg/envlog-0.x.x.gem

This gem also uses MySQL (or MariaDB) and SQLite3 as its choice. for this reason, dependencies for the database interface are not specified in gemspec . Please install one of the gems beforehand.

$ gem install sqlite3

or

$ gem install mysql2

sensor and gateway devices

Both can be built using PlatformIO. Edit the source "src/main.ino" and change the settings, and then build it as follows.

$ pio run

If you want to upload to your device, do the following:

$ pio run -t upload

Usage

Logger process

This process is receiving data from a sensor and registering it in the database. Data can be received input by serial device via gateway device or by UDP and TCP available. You can choose to use either SQLite3 or MySQL(MariaDB) as the database.

envlog-logger [options]

options:
    -c, --config-file=FILE
    -s, --dump-config-template
    -l, --list-device
    -a, --add-device=ADDR,POWER-SOURCE,DESCR
    -r, --remove-device=ADDR

options

-c, --config-file=FILE
Specifies the configuration file to be used. This configuration file can use the same file as the envlog-viewer.
-s, --dump-config-template
Outputs the template of configuration file to the STDOUT.
-l, --list-device
Show a list of currently registered sensor devices.
-a, --add-device=ADDR,POWER-SOURCE,DESCR
Register a sensor device. In order to receive the data, the sensor device must be activated with this option It is. The same goes for sensor devices that are automatically registered as unknown devices.
-r, --remove-device=ADDR
De-register the sensor device.

Viewer process

It works as an HTTP server for referencing stored data.

envlog-viewer [options]

options:
    -c, --config-file=FILE
    -s, --dump-config-template
    -A, --add-user
        --develop-mode

options

-c, --config-file=FILE
Specifies the configuration file to be used. This configuration file can use the same file as the envlog-logger.
-s, --dump-config-template
Outputs the template of configuration file to the STDOUT.
-A, --add-user
User registration for digest authentication is performed (Digest authentication settings (e.g., enable/disable, path for password file, etc.) are specified in the configurationpecify this option, shall add your username and password to the addtional arguments. file).

How to bootstrap

T.B.D

Database upgrade

When migrate before 0.8 to after 0.9

ince version 0.9, the data recording table has been changed (table DATA_TABLE to DATA_TABLE_V2). Use the "op/upgrade" script if you want to inherit the previous data.

ruby opt/upgrade -c <CONFIG-FILE>

When the migration is complete, the old table (DATA_TABLE) is not required and can be deleted.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/kwgt/envlog

etc

About image data

it is use the modified version of the 『特撮映画のイラスト』(https://www.irasutoya.com/2018/12/blog-post_90.html) distributed at いらすとや (https://www.irasutoya.com).

License

The gem is available as open source under the terms of the MIT License.