Help with RPI Openhab full hang. (WAS Rule for longest ever uptime?)

Hi @5iver thanks for a response

I’m currently using RRD4J & MapDB

@vzorglub Hi again thanks for the reply does that give me the result for a month how do you do longest forever

Neither of those store long term data, so not suitable.

1 Like

Install another one
I recommend influxdb

now.minusDays(1000000)
Should do the trick

2 Likes

With me now running on a pi I was hoping too get grapfina up and running for nicer charts but it looked extremely complex

Don’t you need too install influx dB too get that up and running isn’t it included with openhabian

Step by Step guide:

Hi @sihui

I have looked at that post a few times looks complicated can’t I just use the openhabian config?

Not sure, have never used openHABian, just try it, looks promising.

1 Like

@sihui

It says that this will install influxdB and grafana but it can not like the two together at the moment please see a community post…

I’m assuming Openhabian is for beginners it makes getting oh running easy and has things like frontail smb shares ect already installed I’m sure you already know tho :wink:

Let me take my system offline and image my sd card :frowning: i always do before messing with important stuff

I will run the command and see what happens will post back

@sihui

I have Finished that now it said setup successful onscreen readings at bottom of this post

I’m not sure what too do next its directed me too the same post as you posted

having a scroll through too see if i can find answers

im not after setting grafana up atm although i can access a logon page for grafana from the OH Start Page

but getting influx working would be nice

I have tried too access the webfrontend by typing in 192.168.0.94:8086 into my browser it brings up a 404 error (Google says the web frontend has been removed since v1.3) ?

where should i type the commands from the post you linked too create the database / users after i have SSH into the RPI Here ?
Untitled


What was said onscreen during install i have since done the updates still stuck

2018-07-16_20:44:54_BST [openHABian] Checking for changes in origin... OK
2018-07-16_20:45:01_BST [openHABian] Setting up InfluxDB and Grafana...

$ apt -y install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
apt-transport-https is already the newest version (1.4.8).
0 upgraded, 0 newly installed, 0 to remove and 1 not upgraded.

InfluxDB...
--2018-07-16 20:45:40--  https://repos.influxdata.com/influxdb.key
Resolving repos.influxdata.com (repos.influxdata.com)... 54.192.2.93, 54.192.2.117, 54.192.2.128, ...
Connecting to repos.influxdata.com (repos.influxdata.com)|54.192.2.93|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 3108 (3.0K) [application/pgp-keys]
Saving to: ‘STDOUT’

-                                         100%[=====================================================================================>]   3.04K  --.-KB/s    in 0s

2018-07-16 20:45:40 (40.3 MB/s) - written to stdout [3108/3108]

OK

$ apt update
Get:1 http://raspbian.raspberrypi.org/raspbian stretch InRelease [15.0 kB]
Get:2 http://archive.raspberrypi.org/debian stretch InRelease [25.3 kB]
Ign:3 http://repos.azulsystems.com/debian stable InRelease
Hit:4 http://repos.azulsystems.com/debian stable Release
Ign:5 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:6 https://repos.influxdata.com/debian stretch InRelease [4,732 B]
Hit:7 https://dl.bintray.com/openhab/apt-repo2 stable Release
Hit:8 https://deb.nodesource.com/node_8.x stretch InRelease
Get:9 http://raspbian.raspberrypi.org/raspbian stretch/main armhf Packages [11.7 MB]
Get:10 http://archive.raspberrypi.org/debian stretch/ui armhf Packages [34.0 kB]
Get:12 http://raspbian.raspberrypi.org/raspbian stretch/contrib armhf Packages [56.9 kB]
Get:13 https://repos.influxdata.com/debian stretch/stable armhf Packages [925 B]
Fetched 11.8 MB in 10s (1,137 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
18 packages can be upgraded. Run 'apt list --upgradable' to see them.

$ apt -y install influxdb
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  influxdb
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 21.3 MB of archives.
After this operation, 66.6 MB of additional disk space will be used.
Get:1 https://repos.influxdata.com/debian stretch/stable armhf influxdb armhf 1.6.0-1 [21.3 MB]
Fetched 21.3 MB in 3s (5,423 kB/s)
Selecting previously unselected package influxdb.
(Reading database ... 47418 files and directories currently installed.)
Preparing to unpack .../influxdb_1.6.0-1_armhf.deb ...
Unpacking influxdb (1.6.0-1) ...
Setting up influxdb (1.6.0-1) ...
Created symlink /etc/systemd/system/influxd.service → /lib/systemd/system/influxdb.service.
Created symlink /etc/systemd/system/multi-user.target.wants/influxdb.service → /lib/systemd/system/influxdb.service.
Processing triggers for man-db (2.7.6.1-2) ...
Updating FireMotD available updates count ...

$ systemctl daemon-reload

$ systemctl enable influxdb.service

$ systemctl start influxdb.service
OK
Grafana...

$ apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 
Executing: /tmp/apt-key-gpghome.RqmtlxTanG/gpg.1.sh --keyserver keyserver.ubuntu.com --recv-keys 
gpg: key : public key "Bintray (by JFrog) <bintray@bintray.com>" imported
gpg: Total number processed: 1
gpg:               imported: 1

$ apt update
Hit:1 http://archive.raspberrypi.org/debian stretch InRelease
Hit:2 http://raspbian.raspberrypi.org/raspbian stretch InRelease
Ign:3 http://repos.azulsystems.com/debian stable InRelease
Hit:4 http://repos.azulsystems.com/debian stable Release
Hit:5 https://repos.influxdata.com/debian stretch InRelease
Hit:6 https://deb.nodesource.com/node_8.x stretch InRelease
Ign:7 https://dl.bintray.com/fg2it/deb stretch InRelease
Ign:8 https://dl.bintray.com/openhab/apt-repo2 stable InRelease
Get:9 https://dl.bintray.com/fg2it/deb stretch Release [5,300 B]
Hit:10 https://dl.bintray.com/openhab/apt-repo2 stable Release
Get:11 https://dl.bintray.com/fg2it/deb stretch Release.gpg [821 B]
Get:14 https://dl.bintray.com/fg2it/deb stretch/main armhf Packages [1,784 B]
Fetched 7,905 B in 3s (2,163 B/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
18 packages can be upgraded. Run 'apt list --upgradable' to see them.

$ apt -y install grafana
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  grafana
0 upgraded, 1 newly installed, 0 to remove and 18 not upgraded.
Need to get 48.5 MB of archives.
After this operation, 131 MB of additional disk space will be used.
Get:1 https://dl.bintray.com/fg2it/deb stretch/main armhf grafana armhf 5.1.4 [48.5 MB]
Fetched 48.5 MB in 1min 15s (645 kB/s)
Selecting previously unselected package grafana.
(Reading database ... 47444 files and directories currently installed.)
Preparing to unpack .../grafana_5.1.4_armhf.deb ...
Unpacking grafana (5.1.4) ...
Processing triggers for systemd (232-25+deb9u2) ...
Setting up grafana (5.1.4) ...
Adding system user `grafana' (UID 111) ...
Adding new user `grafana' (UID 111) with group `grafana' ...
Not creating home directory `/usr/share/grafana'.
### NOT starting on installation, please execute the following statements to configure grafana to start automatically using systemd
 sudo /bin/systemctl daemon-reload
 sudo /bin/systemctl enable grafana-server
### You can start grafana-server by executing
 sudo /bin/systemctl start grafana-server
Processing triggers for systemd (232-25+deb9u2) ...
Updating FireMotD available updates count ...

$ systemctl daemon-reload

$ systemctl enable grafana-server.service
Synchronizing state of grafana-server.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install enable grafana-server
Created symlink /etc/systemd/system/multi-user.target.wants/grafana-server.service → /usr/lib/systemd/system/grafana-server.service.

$ systemctl start grafana-server.service
OK
Connecting (TODO)...
Adding openHAB dashboard tile...
2018-07-16_20:48:23_BST [openHABian] Adding an openHAB dashboard tile for 'grafana'... OK
2018-07-16_20:48:36_BST [openHABian] Checking for default openHABian username:password combination... OK
2018-07-16_20:48:36_BST [openHABian] We hope you got what you came for! See you again soon ;)

since you are in the InfluxDB shell I think you just type in the commands there.

1 Like

Hi Rich

I have typed the commands there i wasen’t sure i was in the right place im still new too this

i Still cant access the web frontend for influx
grafana seems too be working not joined with influx but working

i have edited the text config files too

I new this would be tricky I can’t work out what I need too do now or next im getting tired too so that never helps

Any hints appreciated

I am picking some of the linux stuff up and am. Enjoying it at the same time it’s just slightly different than I’m used too with windows

It may be gone. It was deprecated shortly after that tutorial was written but still hanging around and usable. I guess they finally just dropped it entirely.

Reading through the Influxdb+grafana tutorial it doesn’t mention anything about the web based interface for InfluxDB. What tutorial are you following?

@rlkoshak

I’m following the one posted above

But I didn’t install influx or grafana myself I used the openhabian-config add component and followed the guide it linked me too again it was the same one posted above

What is the monitering host? I’m not sure about this

WHAT I DID

  1. I used the openhabian-config to install the influx and grafana packages

It told me too follow the guide posted above I did
The parts influxdb install and setup

2)Entered the commands in the influx cli (created users and dB)

3)I then changed the influx.config

restarted influx

I didn’t inject data

4)I tried too connect too OH installed influx persistence edited influx.cfg

5)Created a persist file

Rebooted rpi

It’s the machine where you installed InfluxDB.

You have yet to indicate what, if anything, the problem is. Are you seeing errors? If so what are they? Is persistence not working? If not then how are you checking?

Ok so I don’t have too really worry about that it’s installed on the same rpi

Yes the problems just getting it working so I can start using the rules posted above

I’m just struggling with what too actually do maby it’s just not working as expected getting mapdb and rrd4j running was easy I have just been checking the persistence folder for files created by influx but I don’t know how too check the simple stuff like if the actual influx dB is running as it told me it’s accessible on localhost:8086 and then I couldent access it there

Did you install the influxdb persistence service in OH?
Do you get any influxdb related error messages when you start OH?

@vzorglub

I have installed it yes

I have just put the log in debug mode it is saying stuff about

got DecimalType value 24.61

got onoff type value 1

I have been using the frontail Web log and haven’t seen anything there or should I check somewhere else?

PLEASE NOTE

I’m not trying too be rude or short I’m just very tired I do actually appreciate the help from you all

InfluxDB is a whole separate thing from OH. rrd4j and mapdb are what are called embedded databases. They run inside of OH. InfluxDB is its own software with its own places to store data and such. It doesn’t store anything in the persistence folder of OH. It actually stores it’s data in /var/lib/influxdb/data. You should see an openhab_db folder in there. You can dig further but the folders and files and such will make no sense to you (or me for that matter).

It is accessible on localhost:8086 using InfluxDB’s protocol. That doesn’t mean it runs a webpage on that port. That is how OH talks to InfluxDB. The way you talk to InfluxDB is through the interface that you typed in the command to create the database and such previously.

So you can either run a query from that influx command prompt, see the InfluxDB docs for how to do that (I don’t know off the top of my head). Or you can run a query from the OH REST API under persistence. Just be sure to supply influxdb and your Item name for the /persistence/items/{itemname} endpoint.

If there are no errors it is either not installed, not configured, or working just fine. Since you installed the influxdb binding, configured an influxdb.persist file and influxdb.cfg file then it is probably working.

Rich

Thank you

I already knew some of that but the parts I didn’t have filled in alot of gaps mainly the way I talk too influx and the way oh does and where the files are stored

I could not have asked for a better explanation

I’m going too look in the location for the dB file you said