Grafana & Android App Problem

Hi
Using Grafana 10.2.3
Openhab 4.1
on RPi
Android App 3.8.0 on Local network
HTTP
Using Pages Layout with Widgets

Hi - Beginner here.
Am having some challenges in getting Grafana to show on my Android phone.

With the help of https://community.openhab.org/t/oh3-image-card-in-mainui-how-to-refresh-image/112722 and various other Grafana help topics, together with influxdb, I have managed to produce the below chart in Pages:

Source URL:
http://localhost:3000/d-solo/d35b32ed-af1f-4782-8260-fa4a1bf880d1/first-oh-chart?orgId=1&refresh=1m&theme=dark&w=0100&render=true&{period}&width=auto&height=auto&panelId=1&refresh=30s

However on the Android App, on my cellphone in local network, I get the following:

I would be grateful for step by step guidance on how to solve this. I have read the forums and have seen several issues have been encountered by others - though these may not be applicable - they are not always relevant to MainUI Pages and are not particularly recent.

Much appreciated !

Change localhost to the ip address of the grafana server and see if that works.

Thx - it is already. I just typed localhost for purpose of posting on the forum.

In /etc/grafana/grafana.ini

put this in:

#################################### Anonymous Auth ######################
[auth.anonymous]
# enable anonymous access
enabled = true

and also this:

# set to true if you want to allow browsers to render Grafana in a <frame>, <iframe>, <embed> or <object>. default is false.

allow_embedding = true

Then restart grafana

Also I am just using the grafana widget that is in the market place.

And use the parameters like this for example:

The widget grafana with time ranges can use this format
http://192.168.1.164:3000/d/a787a9b7-e4bf-4cd7-9587-974e150d1abd/water?kiosk&orgId=1&viewPanel=1&from=now-{period}&to=now
to use kiosk mode add the word kiosk after the ? 

and these options
1d=1 day,7d=7 days ,1M=1 month

thanks.
Though still not working.
I checked the grafana ini file.
Restarted grafana.
Tried several variations on the widget source URL.

All still fine in a browser (both on pc and on phone).
There is something about the implementation in the Android app (with regard to Grafana) which is the problem.
Ideas welcome!

Cheers

Did you enable the .logs for troubleshooting in the android app. The generated log might give you more information about the issue.

In my case the app did not like to embed http:// - as it uses https:// (mixed content). But let’s check the log. If it is the mixed content problem I might be able to give you some hints.

Showing just the errors - seems that there is something wrong here

12-31 16:11:34.978  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:34.985  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:35.124  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:35.126  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:35.127  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:35.153  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:37.205  8887  8887 E AbstractWebViewFragment: onReceivedError() on URL: https://<openhab-local-address-openHAB1>:8443/rest/events/states
12-31 16:11:37.290  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:37.291  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:37.316  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:42.322  8887  8887 E AbstractWebViewFragment: onReceivedError() on URL: https://<openhab-local-address-openHAB1>:8443/rest/events/states
12-31 16:11:42.415  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:42.419  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:42.922  8887  9122 E chromium: [ERROR:ssl_client_socket_impl.cc(975)] handshake failed; returned -1, SSL error code 1, net_error -202
12-31 16:11:44.314  8887  8887 E chromium: [ERROR:aw_browser_terminator.cc(154)] Renderer process (22702) crash detected (code -1).
12-31 16:13:49.440  8887  8887 E JavaBinder: !!! FAILED BINDER TRANSACTION !!!  (parcel size = 1199704

Would be grateful for views on how to address this. It does seem like it is something to do with https. Are there simple steps I could follow to resolve this? Really appreciate it!

I just created a page and added masonry and made it a web frame card and pasted in my URL and it worked fine on an android phone and the openhab app.

http://192.168.1.164:3000/d/a787a9b7-e4bf-4cd7-9587-974e150d1abd/water?kiosk&orgId=1&viewPanel=1&from=1682660100000&to=1703914680000

Here it is:

I am using OH 4.0.4 and android app and grafana version 10.2.3

I have no issues getting it to work at all.

The localhost is most likely a problem as well - you’ll have to replace it with the server ip of your raspery. However, if you would like to use the graph via myopenhab from remote as well a more elaborate setup will be required. You can try to set the IP - then it might accept the http:// protocol in the local network (not sure about that); but I would be surprised if this works via remote. But there are ways to get this working of course; but the setup is a bit more complex.

But step by step - do you get the graph with the ip instead of localhost - or you still see an SSL related error message in the application log?

Gives some hints about a possible setup to get interactive grafana charts working locally and from remote via myopenhab.

OK thank you all !
I have it working locally now. It was a certs issue. Was using https (apparently) for the openhab items, yet this was not working well with the http for grafana.

I will no doubt have to come back to this group when I am ready to access the graphs remotely - thank you in advance.
Happy holidays!

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.