You also might have a look at the VPN MTU settings, as your problems seems related to that.
Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.
Posts made by hengst
-
RE: Trouble fully loading Dashboards over VPN
-
RE: Chinese brand PSU_monitoring rs485 and Mango
i do see now, i got some Years in there that are far from now, gehehe . thats why it didnt had effect probably..
thnx for the pointers.
-
RE: Chinese brand PSU_monitoring rs485 and Mango
Thanks Phil(lips) , i am going to play with it , little stupid off topic question :
"How to purge all Information on "Urgent events" or "information " . seems there is no option/knob when viewing the list. ( clear dates , seem to do nothing when selected periode )
-
RE: Chinese brand PSU_monitoring rs485 and Mango
Did made some progress, via an other approach ;
Created : tcp/ip source ( 2 sec update period )
Created : Data Point to that :"loggingType":"NONE", "dataType":"ALPHANUMERIC", "queryable":true, "readCommand":"<your_hex_request_for_your_device>", "settable":false, "valueIndex":0, "valueRegex":".*",
Created META-source
Created : Data Point to that :"name":"DoorAlarm", "enabled":true, "dataType":"ALPHANUMERIC", "updateContext":true, "varName":"p110"
added in script field :
// get Hex from source // Alarm relays Bit ( 1 is Alarm ) var DoorAlarm = /[0-9A-Fa-f]{185}([0-9A-Fa-f]{1}).*/.exec(p110.value); var extractedValue = DoorAlarm[1]; // payload return "DoorAlarm- " + DoorAlarm[1];
...
So i added some other "Meta-data points" for other values.
This works ok, and i can understand how it works.Now the first approach has probably benefits in setting up many same kind devices/values i guess , so i am focusing on that as well , as i would like to understand how that should work.
-
RE: Chinese brand PSU_monitoring rs485 and Mango
Alright. made some changes as, reading where not what the should be. now i get the right results from reading the Hex.
Script "message Queue"
// get Hex from source var busVoltage = /[0-9A-Fa-f]{30}([0-9A-Fa-f]{16}).*/.exec(source.value); var extractedValue = busVoltage[1]; var PsuLoad = /[0-9A-Fa-f]{78}([0-9A-Fa-f]{16}).*/.exec(source.value); var extractedValue = PsuLoad[1]; // Alarm relays Bit ( 1 is Alarm ) var Alarm = /[0-9A-Fa-f]{185}([0-9A-Fa-f]{1}).*/.exec(source.value); var extractedValue = Alarm[1]; // door alarm Bit (1 is Door open ) var DoorAlarm = /[0-9A-Fa-f]{185}([0-9A-Fa-f]{1}).*/.exec(source.value); var extractedValue = DoorAlarm[1]; var message = busVoltage[1]; function toASCII(message) { var result = ""; while(message.length > 1) { //parse two characters at a time var charCode = message.substr(0, 2); result += String.fromCharCode( "0x" + charCode ); message = message.substr(2); } return result; } // swap bytes /hex function swap32(val) { return ((val & 0xFF) << 24) | ((val & 0xFF00) << 8) | ((val >> 8) & 0xFF00) | ((val >> 24) & 0xFF); } //print (message); function hex2float(num) { var sign = (num & 0x80000000) ? -1 : 1; var exponent = ((num >> 23) & 0xff) - 127; var mantissa = 1 + ((num & 0x7fffff) / 0x7fffff); return sign * mantissa * Math.pow(2, exponent); } function roundToTwo(num) { return +(Math.round(num + "e+2") + "e-2"); } // covert Hex to String var subresult = (toASCII(message)); // create human readabe number var result = (roundToTwo(hex2float("0x" +subresult))); // send payload return target.value + "MainAlarm-" + Alarm[1] + ";" + "Door-" + DoorAlarm[1] + ";" + "busvolt-" + result + ";" ;
at this point i get as result : MainAlarm-0;Door-0;busvolt-53.68;
thats correct.
so i have right input , further i am still completely lost in how i should proceed.
i added my other (modbus) device and thats straight forward , enter the source and add data points to it. thats easy.
now why cant i see the logic for the other source.. -
RE: Chinese brand PSU_monitoring rs485 and Mango
Well, looks something is working :
i ques this is normal ?
-
RE: Chinese brand PSU_monitoring rs485 and Mango
this is what i got,
and point link details :
-
RE: Chinese brand PSU_monitoring rs485 and Mango
"messageIdentiefier" is the variable/object coming from point link script right ?
-
RE: Chinese brand PSU_monitoring rs485 and Mango
ok learned "Object"
Can someone point me some explanation links about :
var identifierMap = { "messageIdentifier" : contextPoint1 .... }
cant find much on " indentifierMap " on internet somehow.
-
RE: Chinese brand PSU_monitoring rs485 and Mango
identifiers, object etc, is probably JavaScript terms....hmm and i was thinking it was almost done, gehehe.
i need a neighbor with programming skills ( the neighbors house is for sale btw )
so back to learning books .. -
RE: Chinese brand PSU_monitoring rs485 and Mango
i got this in " point links as script " , is this ok ?
and what to put in :
the script - source script. ?
i tried 1000 different combinations. and reading the wiki / manuals. but sorry, i don't
get it... -
RE: Mango Enterprise Server Timeout
can you simply , ping the server ?
-
RE: Chinese brand PSU_monitoring rs485 and Mango
now put all this in Mango needs again some pointers i think..
-
RE: Chinese brand PSU_monitoring rs485 and Mango
little update ,
i found that i need to convert in javascript the with sort of
function hex2float(num) { var sign = (num & 0x80000000) ? -1 : 1; var exponent = ((num >> 23) & 0xff) - 127; var mantissa = 1 + ((num & 0x7fffff) / 0x7fffff); return sign * mantissa * Math.pow(2, exponent); } window.alert (hex2float("0xA4703942")); //flipped does the trick window.alert (hex2float("0x423970A4")); // outcome 46,36..... ( not rounded ) `` so little progress here.
-
RE: Chinese brand PSU_monitoring rs485 and Mango
Alright i got it. thnx.
i had little play with :
var busVoltage = /[0-9A-Fa-f]{46}([0-9A-Fa-f]{8}).*/.exec(source.value);
var extractedValue = busVoltage[1];print (busVoltage[1]);
Script result:
42453939so that works, i found code for converting the hex to float, but no knowledge of writing (java) coding structure is a show stopper at the moment. but i do have fun learning , gehehe
-
RE: Chinese brand PSU_monitoring rs485 and Mango
That fixed it indeed.
i noticed i can check scripting code by clicking on the "little green Script dot".
Its still not clear to me.
-
Data source collects makes connection to device. ( interval for set here )
that is the easy part, -
tcp/ip Data point asks for data ( command data point )
-
tcp/ip Data point response listen for data
-
tcp/ip Data point "link" this to Scripting data point, "message queue" datapoint.
-
in the "link" script screen i put in ?? which pieces of code ?
-
in the Script Data source i also put in which pieces ?
i tried a lot of combinations, but i don t see it.
-
-
RE: Chinese brand PSU_monitoring rs485 and Mango
i removed everything and restarted Mango.
The "value index: set to 1 was indeed the bottleneck. ( i checked to see what difference 0 or 1 made.
so i have data again,
The errors
"
WARN 2016-10-31 23:57:49,316 (com.serotonin.m2m2.rt.dataSource.PollingDataSource$2.execute:228) - PSU-tcp_ip: poll scheduled at 2016/10/31 23:57:49.316 aborted because Task Currently Runnining
"
in terminal are still there do.i don t care at the moment, as getting things running is more important to me at the moment.
now i start building COMMAND and RESPONSE from the beginning of the forum..
-
RE: Chinese brand PSU_monitoring rs485 and Mango
Nope, reboot did not help, rebooting device and connections did not help.
settings :