@craigweb said in HTTP Retriever and JSON data:
Looks like your URL has illegal characters. try replacing [ & ] with %5B and %5D respectively.
Thanks, that helped.
@craigweb said in HTTP Retriever and JSON data:
Looks like your URL has illegal characters. try replacing [ & ] with %5B and %5D respectively.
Thanks, that helped.
Hello,
Im trying to read data from JSON service.
JSON data addres is: http://192.168.1.250/iolinkmaster/port[4]/iolinkdevice/pdin/getdata
Data is: {"cid":-1,"data":{"value":"0079FD03"},"code":200}
I used HTTP Retriever, with that URL. Received value is in hexadecimal format, Im interestet in first 4 characters.
Using https://regex-testdrive.com/en/dotest I made a RegEx: .*"value":"([0-9A-Z]+)FD03"},"code":200}
Next I made a data point with that RexEx. But when I click on "Test value parameters" button I get error: java.lang.IllegalArgumentException: Illegal character in path at index 38: http://192.168.1.250/iolinkmaster/port[4]/iolinkdevice/pdin/getdata
Also it doesn't matter if I use RegEx on data point - I still get that error trying to test value. .
And now I need help how to resolve this error.
Also my next question is how to convert hexadecimal data value to decimal.
Regards.
Yes I tried to stop and start Mango again but it didn't help at all.
Finally I resolved it by editing script in ma-start.bat -
"%EXECJAVA%" %JPDA% %JAVAOPTS% -server -Xmx2500m -Xms1000m -Dma.home="%MA_HOME%" -cp "%MA_CP%" com.serotonin.m2m2.Main
Maybe it's not elegant but now I see change in memory usage after starting Mango.
Thanks for help.
Greetings
Yes, Mango is running od Windows system.
So I tried with putting a .bat file in "ext-enabled" folder.
memory-small.bat
if "%1" == "init" (
rem Startup with Java Memory setup for small installation
set JAVAOPTS=%JAVAOPTS% -Xms2500m -Xmx3200m
)
It still doesn't work. But when I tried .bat file on my test Mango installation with core 3.2.1 it worked perfectly.
//Edit
Hm, in Mango 3,2,1 on Windows max memory space limit comes from .sh file. I tried deleting .bat file and nothing changes. When I changed limits in .sh file to 1600M, I see in task manager the Java is taking that 1600M.
Hello,
I wanted to use script to increase memory space for Java to use.
I've copied "memory-small.sh" script from "ext-available" to "ext-enabled" folder. And unfortunally nothing happens. In internal metrics there's still "JVM maximum available memory (MB) - 622Mb" and nothing changes.
Mango version is licensed 2.8.8.
Greetings
Thanks for help. Now it's fine :)
Hello,
I'm working with serial charts coding. At the moment I have chart showing two series and it works fine. First series is for temperature and the second is for humidity,
But I want to add maximum and minimum limit lines (horizontal) to that chart too. So it would be 3 lines - min and max for temperature and max for humidity.
I tried with guides:
options="{guides: [{fillAlpha: 0.25,value: 20, color: blue }]}"
It's almost what I need but this way I can only add one line on chart.
Do you have any ideas how to add more lines to chart ?
Thanks ! This way works fine.
So maybe I should wait for the next 2.8.X update?
What's interesting:
I installed Mango 3.0 beta version. And I noticed on example page "Energy Dashboard" that Maximum Demand (kW) and Total Energy (kWh) gauges aren't working corecctly - they have same problem that I have - showing "NaN" value.
But in this case adding rendered="false" to <ma-point-statistics> solved the problem.
Why isn't it helping to me? :)
Eh, it didn't help. I disabled cache and even tried on different browser with that Custom Page and there's still the same error.
Simple viewing values is working but subtraction not.
Hey, thanks for your respond,
But unfortunately its still not working. The same problem. I tried adding rendered="false"
to <ma-point-statistics>
but it didnt help.
Below is full code of my script:
<p>Alternatively use the date and time pickers individually</p>
<div layout="row">
<md-input-container flex="">
<label>From date</label>
<ma-date-picker ng-model="from"></ma-date-picker>
</md-input-container>
</div>
<div layout="row">
<md-input-container flex="">
<label>To date</label>
<ma-date-picker ng-model="to"></ma-date-picker>
</md-input-container>
</div>
<p>
You have chosen a date range of {{ from | moment:'format':'ll LTS' }} to {{ to | moment:'format':'ll LTS' }}.
</p>
<div layout="row">
<md-input-container flex="">
<label>Choose a point</label>
<ma-point-list limit="700" ng-model="myPoint"></ma-point-list>
</md-input-container>
</div>
<ma-point-statistics point="myPoint" from="from" to="to" statistics="statsObj" rendered="false"></ma-point-statistics>
<div>The average for the period is {{ statsObj.average.value }} at {{ statsObj.average.timestamp | moment:'format':'lll' }}
<br>
The max value for the period is {{ statsObj.maximum.value }}
<br>
{{ statsObj.last.value - statsObj.first.value }} L
<br>
{{ statsObj.last.value }}
<br>
{{ statsObj.first.value }}
</div>
Hello.
Im working with dashboards and I want to generate point statistics. Everything is working fine, but I have one problem.
Im using this code from example:
<ma-point-statistics point="myPoint" from="from" to="to" statistics="statsObj"></ma-point-statistics>
<div>The average for the period is {{ statsObj.average.value }} at {{ statsObj.average.timestamp | moment:'format':'lll' }}<br>
The max value for the period is {{ statsObj.maximum.value }}
<br>
{{ statsObj.last.value - statsObj.first.value }} L
<br>
{{ statsObj.last.value }}
<br>
{{ statsObj.first.value }}
</div>
And the problem is that
{{ statsObj.last.value - statsObj.first.value }} L
Is not working. It returns the "NaN L".
L is for unit of my datapoint.
Other part of script is working. Last and first values are showing corecctly.