Hi, I am working on an MQTT implementation and need to debug the JS file, but I can’t find a log output, feedback, or something like that. Also, the code I’m implementing works fine with the same JSON in another environment.
JS file in Communicator/Configuration Files/:
function base64ToArrayBytes(base64) {
var binaryString = atob(base64);
var bytes = new Uint8Array(binaryString.length);
var buffer_data = []
for (var i = 0; i < binaryString.length; i++) {
let buffer_binary = "0000000" + binaryString.charCodeAt(i).toString(2)
let buffer_n_bin = buffer_binary.length
buffer_binary = buffer_binary.substr(buffer_n_bin - 8)
buffer_data.push(buffer_binary)
}
return buffer_data;
}
let dispo = JSON.parse(payload)
let fcnt = dispo.fCnt
let data_base64 = dispo.data
let data_bytes = base64ToArrayBytes(data_base64)
//setValue(0, dispo.fCnt)
//setValue(1, dispo.fCnt)
//setValue(2, dispo.fCnt)
//setValue(3, dispo.fCnt)
//setValue(4, dispo.fCnt)
//setValue(5, dispo.fCnt)
setValue(6, fcnt)