Trying to setup influxdb and grafana

Trying to setup influxdb and grafana (https://home-assistant.io/blog/2015/12/07/influxdb-and-grafana/) abd started with this command:
sudo dnf -y install http://influxdb.s3.amazonaws.com/influxdb-0.9.5.1-1.x86_64.rpm
which doesn’t work. I have the AIO HASS btw.

So then I went to https://docs.influxdata.com/influxdb/v0.13/introduction/installation
and tried:
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add - source /etc/os-release

First it just fired off:
curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add -
and because only: source /etc/os-release
doesn’t do anything, I ran the command again like this: curl -sL https://repos.influxdata.com/influxdb.key | sudo apt-key add - source /etc/os-release
It then gives an OK.

So I try the next command: sudo apt-get update && sudo apt-get install influxdb (I also ran the 2 test commands).
But this is the result:
E: The method driver /usr/lib/apt/methods/https could not be found. N: Is the package apt-transport-https installed?
Any ideas?

Is the package apt-transport-https installed?

apt-get install apt-transport-https

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

are you root?

sudo apt-get install apt-transport-https

oops. tried too quickly.
now it’s running! :slight_smile:
thanks!

Ok, so I think I managed to install Influxdb correctly now, but failing with grafana.
I have AIO so that’s based oin raspbian jessie so that’s a debian install, right?
When I try to follow the instructions on http://docs.grafana.org/installation/debian/
it fails at step: sudo dpkg -i grafana_3.1.0-1468321182_amd64.deb
with this error:

dpkg: error processing archive grafana_3.1.0-1468321182_amd64.deb (--install):
 package architecture (amd64) does not match system (armhf)
Errors were encountered while processing:
 grafana_3.1.0-1468321182_amd64.deb

I can’t find a way to get it installed :frowning:

Also I get this error in HASS log about influxdb:

16-07-30 17:25:46 homeassistant.components.influxdb: Error saving event "[{'time': datetime.datetime(2016, 7, 30, 15, 25, 46, 404126, tzinfo=<UTC>), 'fields': {'value': 'playing'}, 'measurement': 'media_player.tv_lukas__sascha', 'tags': {'entity_id': 'tv_lukas__sascha', 'domain': 'media_player'}}]" to InfluxDB
Traceback (most recent call last):
  File "/srv/hass/hass_venv/lib/python3.4/site-packages/homeassistant/components/influxdb.py", line 103, in influx_event_listener
    influx.write_points(json_body)
  File "/home/hass/deps/influxdb/client.py", line 402, in write_points
    tags=tags)
  File "/home/hass/deps/influxdb/client.py", line 447, in _write_points
    expected_response_code=204
  File "/home/hass/deps/influxdb/client.py", line 289, in write
    headers=headers
  File "/home/hass/deps/influxdb/client.py", line 259, in request
    raise InfluxDBClientError(response.content, response.status_code)
influxdb.exceptions.InfluxDBClientError: 400: {"error":"field type conflict: input field \"value\" on measurement \"media_player.tv_lukas__sascha\" is type string, already exists as type integer"}

grafana_3.1.0-1468321182_amd64.deb

You downloaded the x86_64 package but your system is the armhf architecture. This cannot be.

Find grafana for armhf (Raspberry) and install that package. (Good luck - it’s officially in sid but not jessie)

Before I started I expected it to be much easier :confused:, as it was in a HASS blog.

Anyway, I found this: https://github.com/fg2it/grafana-on-raspberry/tree/master/jessie/v3.1.0-beta1
and downloaded that straight to my pi3 and trie to install it, but grrrr it’s coming with an error again (if you btw also now how to fix my influxdb error I posted in my last post…):

pi@raspberrypi:~ $ wget https://github.com/fg2it/grafana-on-raspberry/blob/master/jessie/v3.1.0-beta1/grafana_3.1.0-1466707812beta1_armhf.deb
--2016-07-30 18:29:14--  https://github.com/fg2it/grafana-on-raspberry/blob/master/jessie/v3.1.0-beta1/grafana_3.1.0-1466707812beta1_armhf.deb
Resolving github.com (github.com)... 192.30.253.113
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘grafana_3.1.0-1466707812beta1_armhf.deb’

grafana_3.1.0-14667     [ <=>                  ]  35.56K  --.-KB/s   in 0.1s

2016-07-30 18:29:15 (312 KB/s) - ‘grafana_3.1.0-1466707812beta1_armhf.deb’ saved [36418]

pi@raspberrypi:~ $ sudo dpkg -i grafana_3.1.0-1466707812beta1_armhf.deb         dpkg-deb: error: `grafana_3.1.0-1466707812beta1_armhf.deb' is not a debian format archive
dpkg: error processing archive grafana_3.1.0-1466707812beta1_armhf.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 grafana_3.1.0-1466707812beta1_armhf.deb

I have uploaded an armhf version of Grafana i compiled here https://github.com/timstanley1985/raspberry_pi_debs

Thanks for this, but I think I’m still doing something wrong:

pi@raspberrypi:~ $ wget  https://github.com/timstanley1985/raspberry_pi_debs/blob/master/Grafana/grafana_3.1.0-1468447908_armhf.deb
--2016-08-08 20:34:03--  https://github.com/timstanley1985/raspberry_pi_debs/blob/master/Grafana/grafana_3.1.0-1468447908_armhf.deb
Resolving github.com (github.com)... 192.30.253.113
Connecting to github.com (github.com)|192.30.253.113|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: unspecified [text/html]
Saving to: ‘grafana_3.1.0-1468447908_armhf.deb’

grafana_3.1.0-14684     [ <=>                  ]  31.40K  --.-KB/s   in 0.1s

2016-08-08 20:34:03 (305 KB/s) - ‘grafana_3.1.0-1468447908_armhf.deb’ saved [32152]

pi@raspberrypi:~ $ sudo apt-get install -y adduser libfontconfig
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'libfontconfig1' instead of 'libfontconfig'
adduser is already the newest version.
libfontconfig1 is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 32 not upgraded.
pi@raspberrypi:~ $ sudo dpkg -i grafana_3.1.0-1468447908_armhf.deb              dpkg-deb: error: `grafana_3.1.0-1468447908_armhf.deb' is not a debian format archive
dpkg: error processing archive grafana_3.1.0-1468447908_armhf.deb (--install):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 grafana_3.1.0-1468447908_armhf.deb
pi@raspberrypi:~ $

Yes, something is wrong and it is not the archives, both should be working. The problem is the download part : from your log, you can read

and

If you open the downloaded file with your browser, you will see it is indeed an html page.
Instead, download the .deb file from the release section, which is the best practice recommended by github :

wget https://github.com/fg2it/grafana-on-raspberry/releases/download/v3.1.1-jessie/grafana_3.1.1-1470786449_armhf.deb 

If you really need to download large binary file from a repo, you have to change the url and use something like

wget https://raw.githubusercontent.com/fg2it/grafana-on-raspberry/master/jessie/v3.1.1/grafana_3.1.1-1470786449_armhf.deb

but this is discouraged by github (in fact, for that usage, binary files in repo don’t follow the github’s recommendation and we should not even but the binary there …)

By the way, I should add that I didn’t test the package on a pi3.

1 Like

Thanks for your reply! I could install Grafana now and it’s working! :slight_smile:

Thanks a lot everyone!

Nice. Now I know it works on pi3. Could you tell me if the png rendering feature in the share menu is working ?

I don’t see PNG.
You mean sharing the dashboard?
I only see Link to Dashboard, Snapshot and Export.
For snapshot I can chose local or online, which is this:
https://snapshot.raintank.io/dashboard/snapshot/6z1IFVuG0tImBLo73MfckdpGQFfrOurS

I’m totally new to Grafana so if you can tell me exactly where I can find it, I can check it for you.

When you click on a panel title, select “share” in the opening box, then at the bottom of the new box, you have “Direct link rendered image”. This should create a png snapshot on the panel.

Gotcha.
And yes that’s working fine as well. Opens a new window with the image which you can save as PNG.

Thank you for the feedback ! Now I know it is working on raspberry pi 3, even the phantomjs part.

You’re welcome.
I am wondering now, isn’t it bad to run influx and grafana on a pi3? Because it’s reading/writing all the the time to the sd card.
Can both be run on a synology nas instead?

Yeah, phathomjs part should work, I compiled this dependency first as arm binary was not available. Took 48 hours to compile!

PS - grafana was compiled on an RPi 1 so should work on all Pi variants

There may be some confusion here. I think PuckStar use the package I provide. By the time I build phantomjs, the resulting binary wasn’t as static as the developers wanted it to be and as far as I can see your binary as also some dependencies that should not be here. A consequence of that is the binary is tied to the distro used to build it. I was unsure of the behavior on pi3 due to these dependencies.
Anyway, now I have the answer.