Terry,
We've been working on this and have it sort of working, but still running into an issue. Hopefully you'll be able to provide some insight and get us over the hump.
I'm using Packet Sender software to test sending varius HEX values to the server and being read by the serial data source. As you suggested a Meta data source was created to convert the Mango stored value back to HEX.
This is close to working, but the issue is that whenever I send a hex value greater than the 128th ASCII value, Mango saves it as � Is this due to Mango trying to convert it to ASCII, or could there be something on the server side that we need to modify to allow Mango to save it properly?
Here is a walkthrough of our process working with HEX values that convert to regular ASCII:
- Pass "this is a test" in hex to the server (hex: 74 68 69 73 20 69 73 20 61 20 74 65 73 74)
- Data point is saved as "this is a test"

- Meta DP converts it properly back to the HEX value
- Meta DP Code:
var str = varPacket.value;
print("Str: "+str);
var bytes = []; // char codes
for (var i = 0; i < str.length; ++i) {
var code = str.charCodeAt(i);
bytes = bytes.concat([code]);
}
print('bytes', bytes.join(', '));
function toHexString(bytes) {
return bytes.map(function(byte) {
return ('0'+(byte & 0xFF).toString(16)).slice(-2);
}).join('')
}
print ("\nTEST: "+toHexString(bytes));
- Output of script validation:

You can see all looks good.
If I pass another HEX value to the DS, but use values past the 128 characters of ASCII, then things don't work.
- Pass a9 a9 a9 a9 a9 a9 to Mango DS (© character)
- The DP value is incorrectly saved as������

- The Meta DS cannot validate since the � character converts to 65533 / fd in HEX

I hope we're doing something wrong on our side and it's a simple setting that can fix this. Is Mango truly trying to convert the hex to ASCII and not converting it properly since there are a lot more hex values than ASCII?
Here's a quick snippet of the serial DS log, which sees the proper hex values:
2021/10/18-11:40:34,891 I 7468697320697320612074657374
2021/10/18-11:45:13,536 I a9a9a9a9a9a9
Also, the ma.log file shows the values being read properly, but saved incorrectly.
DEBUG 2021-10-18T15:40:35,406 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValue:640) - Message matched regex:
DEBUG 2021-10-18T15:40:35,406 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValue:653) - Point Identified:
DEBUG 2021-10-18T15:40:35,406 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValue:659) - Point Value matched regex: .* and extracted value 7468697320697320612074657374
DEBUG 2021-10-18T15:40:35,406 (com.infiniteautomation.serial.rt.SerialDataSourceRT.updatePointValue:545) - Saving value: PointValueTime(this is a test@2021/10/18 11:40:35.406)
DEBUG 2021-10-18T15:45:14,052 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValue:640) - Message matched regex:
DEBUG 2021-10-18T15:45:14,052 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValue:653) - Point Identified:
DEBUG 2021-10-18T15:45:14,052 (com.infiniteautomation.serial.rt.SerialDataSourceRT.matchPointValue:659) - Point Value matched regex: .* and extracted value a9a9a9a9a9a9
DEBUG 2021-10-18T15:45:14,052 (com.infiniteautomation.serial.rt.SerialDataSourceRT.updatePointValue:545) - Saving value: PointValueTime(??????@2021/10/18 11:45:14.052)
Look forward to hearing any suggestions.
Thanks,
Chad