gopal
(korrapati.gopal)
October 10, 2017, 12:03pm
1
Hi,
I started working on the sensors.I am able to read the data on the serial . that reading I am not able to make a the graph? for these I wrote some configuration on the site map as below
Chart item=Temperature period=h refresh=6000 service=“rrd4j”.
It shown the graph but nothing came on it.
Please help me?
rlkoshak
(Rich Koshak)
October 10, 2017, 3:15pm
2
Do you have persistence set up on those Items? Since you are using rrd4j, do you save the value every minute?
gopal
(korrapati.gopal)
October 11, 2017, 3:45am
3
yes, I am able to see that values, I am print it also
opus
(Jürgen Baginski)
October 11, 2017, 4:14am
4
How is the item Temperature defined, it should be a number type strings can’t be persisted by rrd4j!
You are printing the values? Are you printing the actual ones or really the persisted ones?
gopal
(korrapati.gopal)
October 11, 2017, 4:17am
5
i am hard coated some of the values. randomly i am printing that values.
gopal
(korrapati.gopal)
October 11, 2017, 4:18am
6
you have any example to see the gragh or chat please share me.
opus
(Jürgen Baginski)
October 11, 2017, 4:24am
7
The definition of the graph looks OK to me, hence my questions. Please show your item definition. And also the definition of your persistence.
Blockquote
gopal
(korrapati.gopal)
October 11, 2017, 4:46am
8
I am taking string as data from serial and converting to float sending to Temperature item.
Here are my declarations item,persistance,rule, sitemap.
item :-
String MySerialDevice “Temperature [%s]” { serial="/dev/ttyUSB1@115200" }
Number Temperature “Temperature [%.1f °C]”
persistance :-
Strategies {
everyMinute:"0 * * * * ?"
everyHour : "0 0 * * * ?"
everyDay : "0 0 0 * * ?"
default = everyChange
}
Items {
Temparature : strategy = everyUpdate, everyMinute
}
rule :-
import org.openhab.core.library.types.*
import java.util.List
rule “Data"
when
Item MySerialDevice received update
then
var List items = MySerialDevice.state.toString().trim().split(” ")
var Number value
value = Float.parseFloat(items.get(0))
Temperature.postUpdate(value)
end
sitemap:-
sitemap default label=“Phytec” {
Frame label=“Demo” {
Text item=Temperature label=“Temperature [%.1f °C]” icon=“temperature”
}
Frame label=“Graph” {
Chart item=Temperature period=h refresh=600 service=“rrd4j”
}
}
opus
(Jürgen Baginski)
October 11, 2017, 4:54am
9
Looks OK to me as well.
Did you have a look into the values persisted using the REST API? That way you could ensure that values are persisted, limiting the area where the problem is.
Sorry for the typos, it is a bit early in here.
opus
(Jürgen Baginski)
October 11, 2017, 4:59am
11
The Screenshot shows what you have told before.
Are you familiar with the REST API?
gopal
(korrapati.gopal)
October 11, 2017, 5:02am
12
I am not familiar with RESET API.can you just help me.
opus
(Jürgen Baginski)
October 11, 2017, 5:19am
13
If you haven’t done already, then install REST DOCS via PaperUI.
opus
(Jürgen Baginski)
October 11, 2017, 5:26am
14
After installing start the REST API via:
http://IP-OF-YOUR-OH-System:8080/doc/index.html
Then go to the “persistence” page , on this page hit the GET BUTTON next to “persistence/items/{itemname}”
In here put in “rrd4j” as the SERVICEID and the itemname and hit try it out.
You should get displayed a JSON like output with several values.
gopal
(korrapati.gopal)
October 11, 2017, 6:05am
15
These are the screen shots .
opus
(Jürgen Baginski)
October 11, 2017, 6:12am
16
That’s what I was thinking, your persistence isn’t setup correctly.
Did you install rrd4j persistence at all?
gopal
(korrapati.gopal)
October 11, 2017, 6:19am
17
Yes, I have installed rrd4j.
gopal
(korrapati.gopal)
October 11, 2017, 6:20am
18
Is anything else I want to do .
opus
(Jürgen Baginski)
October 11, 2017, 8:56am
19
In this case I’d check the logs for a hint.You might need the set the logging level for rrd4j to DEBUG.
On the karaf console use this command to set the debug level
log:set DEBUG org.openhab.persistence.rrd4j
And use “log:tail” to show a actual log entries as they are written.
gopal
(korrapati.gopal)
October 12, 2017, 11:26am
20
yesterday working fine, I sea the graph but today I got one error as below
2017-10-12 16:50:08.708 [WARN ] [thome.ui.internal.chart.ChartServlet] - Illegal argument in chart: Persistence service not found ‘rrd4j’.
please help me.