This section is under development.
Modify minimal refresh rate for Grafana¶
By defaylt, in Grafana 7 refresh rate for dashboard cannot be set to lower than 5 s. Whiel in production environment this might be good feature to avoid undesired too high load on the system, during development and testing it is often better to have faster refresh rates.
Minimum refresh interval can be modified in Grafana configuragion file
grafana.ini, which might be located in different places depending on your deployment. Refer this page to find out locations: https://grafana.com/docs/grafana/latest/administration/configuration/#config-file-locations
In case of Docker, configuration file is not accessible easily from the host machine. In this case it can be copied to the host machine, modified, and then copied back to the container. Example steps are described below:
Open command line terminal
Copy file from container to the host machine:docker cp ogamma-logger_grafana_1:/etc/grafana/grafana.ini .
min_refresh_intervalto desired minumum value.
Copy file back to the container:docker cp ./grafana.ini ogamma-logger_grafana_1:/etc/grafana/grafana.ini
Restart the container.
How to enable SQL Server Authentication and TCP in Microsoft SQL Server Express¶
The ogamma Visual Logger for OPC connects to Microsoft SQL servers (including Express version) using
SQL Server Authentication mode, over TCP connection. When you install MS SQL Server’s Express version, by default both of these options are disabled.
Enabling SQL authentication Mode.¶
SQL Server Authentication mode, the
Microsoft SQL Server Management Studio can be used. It is installed separately from SQL Server Express. With it, connect to the SQL Express instance using
Windows Authentication mode, then select this connection node in the
Object Explorer and open context menu by mouse right click. Then click on the
Properties menu command, and open
Server Properties dialog window. There, in the left side panel select
Security page and set option
Server Authentication to
SQL Server and Windows Authentication Mode.
Also you can enable default user
sa if it was disabled. For that, in the
Object Explorer panel expand the
Security node, and
Logins node under it, and under it select the node
sa. Open its
Properties dialog window (by using context menu), select
Status page, and set the option
You can also reset password for the
sa user. Or add other users as required.
Enabling TCP connections.¶
To enable TCP connections,
SQL Server Configuration Manager can be used (it should be installed when the MS SQL Express is installed. If you type
SQL in the Windows search field, it should appear in the found applications list.
In its left side panel, find node
SQL Server Network Configuration /
Protocols for SQLEXPRESS. If you have multiple instances running, there might be multiple nodes under the
SQL Server Network configuration node - select the desired one.
In the main panel, select node
TCP/IP, and open its
Properties dialog window. In the
Protocol tab page, set option
Listen All to
IP Addresses tab page, scroll down to the
IPAll node, and clear
TCP Dynamic Ports field, and set
TCP Port to 1433 (or other port if it is used by another instance of the SQL Server). You can also set settings for each IP address separately.
To apply modifications restart the MS SQL Server service (for that you can use either
SQL Server Configuration Manager or
Microsoft SQL Server Management Studio).
Enable horizontal scrolling in the Logged Variables table.¶
In the version 2.0.0 and later horizontal scrolling should be enabled. If it is not, this might be due to the cached settings, saved in the previous version. To clear the cache in Google Chrome, open developer tools (Settings / More tools / Developer Tools), select Application tab, and delete Local Storage entries for the URL of ogamma Visual Logger web GUI.
Upgrade time-series database from InfluxDB 2.0 Beta version to InfluxDB 2.0.3 released version.¶
Upgrading InfluxDB from 2.0 beta version to 2.0.x release version is not automatic, requires some manual steps. Therefore this
HowTo section is created to describe the upgrade process step by step.
HowTo guide is applicable only in case if databases are running in Docker containers, and you are using InfluxDB 2.0 beta only to store data and not using dashboards, tasks, alerts. If you need to upgrade and transfer not only data but also all other settings (dashboards, tasks, alerts), refer to the guide provided by InfluxData at https://docs.influxdata.com/influxdb/v2.0/upgrade/v2-beta-to-v2/
- Prepare new docker-compose file, which uses new version 2.0.3 of the InfluxDB. You can use file
influxdb2.0.3.ymlfrom GitHub repository https://github.com/onewayautomation/ogamma-logger (in folder
docker). Start container and configure instance of the InfluxDB 2.0.3 to use the same settings for organization and bucket, where the OVL was storing data in InfluxDB 2.0 Beta version. You can use configuration web GUI of the InflxuDB 2.0.3 to configure these settings, which is available over URL
localhost:8016in case of using this docker-compose file.
- In ogamma Visual Logger for OPC, create new TSDB connection of type “InfluxDb 2.0” for Influx 2.0.3 release version. Configure all settings (measurement, tags, buckets etc.), but do not enter token yet in the
Passwordfield, clear it and leave empty. This is required to prevent ogamma Visual Logger for OPC connecting to the InfluxDB before completion of the upgrade. If you click the button
Test Connection, it should show that the connection status as OK, because during this testing it does not try to write data yet.
The released version 2.0.x of the InfluxDB uses port number 8086 by default, not 9999 used by the beta version. In case of using Docker compose file
influxdb2.0.3.yml, host name in the TSDB settings should be set to
- Modify settings for the instance (via menu
Settings/Instances, selecting current instance and opening it for editing) to use the database IndluxDB 2.0.3 configured in the previous step.
After this, refresh OVL configuration GUI web page and verify that in the
Logged Variablestable columns
Tagshave correct values. If they have incorrect values, then revise Measurement generation mode and Tags Generation Mode settings and JSON field settings in the InfluxDB 2.0.3 configuration settings.
Also, open Statistics dialog window via menu
Tools/Statisticsand verify that the
TSDB Statusfield displays connection error message.
Collected data will be stored in the Local Storage buffer now.
- Connect to the InfluxDB 2.0.3 container’s terminal:
docker exec -it ogamma-logger_influxdb2.0.3_1 bash
ogamma-logger_influxdb2.0.3_1is container name.
- Export data from InxlusDB 2.0 Beta container (connecting to it remotely), and import data to the InfluxDB 2.0.3:
Export from InxluDB 2.0. Beta:influx query 'from(bucket: "ogamma") |> range(start: -3y)' -r --host http://influxdb2:9999 -o ogamma -t secrettoken > data.csv
Here option -o defines organization, option -t - authorization token. You might need to adjust these values.
Export and Import can take significant time if database has large amount of data.
Import to the InfluxDB 2.0.3:influx write --format csv -o ogamma -b ogamma -f data.csv -t secrettoken
Exit from container terminal by running command
- Verify that data is imported into InfluxDB 2.0.3. This can be done by connectign to its GUI and runnign queries, or via Grafana.
- In ogamma Visual Logger for OPC GUI, set correct authorization token for the InfluxDB 2.0.3 database.
Verify that data is being stored into the new database: in the
TSDB Statusfield should display
connected, and number of stored values should be increasing, and field
Balanceshould display small number of values left in the Local Storage.
- Stop InfluxDB 2.0 beta version.
If all previous steps were completed successfully, in the Docker host machine, run command:docker-compose -f influxdb2.0.yml down
This command might report an error
error while removing network, which can be ignored.