Eastron SDM230 / SDM630 Decoding

Hi All.

Using Datacake to decode the Eastron. they had a template as below… But the issue I am having is i’m not getting all the parameters. Could someone please help me tweak it?

Thanks

function Decoder(bytes, port) {

var decoded = {};

if ( bytes[4] == 01) {

decoded.IMPORT_KWH = (bytesToFloat(bytes.slice(06, 10))).toFixed(2);
decoded.VOLTAGE = (bytesToFloat(bytes.slice(10, 14))).toFixed(2);
decoded.current = (bytesToFloat(bytes.slice(14, 18))).toFixed(3);
decoded.ACTIVE_POWER = (bytesToFloat(bytes.slice(18, 22))).toFixed(0);
decoded.FREQUENCY = (bytesToFloat(bytes.slice(22, 26))).toFixed(1);
decoded.VOLTAGE_2 = (bytesToFloat(bytes.slice(26, 28))).toFixed(1);
decoded.VARIABLE1 = (bytesToFloat(bytes.slice(28, 30))).toFixed(1);
decoded.VOLTAGE_3 = (bytesToFloat(bytes.slice(30, 34))).toFixed(1);
decoded.VARIABLE4 = (bytesToFloat(bytes.slice(34, 38))).toFixed(1);
}

try {
    decoded.LORA_RSSI = (!!normalizedPayload.gateways && !!normalizedPayload.gateways[0] && normalizedPayload.gateways[0].rssi) || 0;
    decoded.LORA_SNR = (!!normalizedPayload.gateways && !!normalizedPayload.gateways[0] && normalizedPayload.gateways[0].snr) || 0;
    decoded.LORA_DATARATE = normalizedPayload.data_rate;  	    
} catch (e) {
    console.log(e);
}

return decoded;

}

function bytesToFloat(bytes) {
var bits = bytes[0]<<24 | bytes[1]<<16 | bytes[2]<<8 | bytes[3];
var sign = (bits>>>31 === 0) ? 1.0 : -1.0;
var e = bits>>>23 & 0xff;
var m = (e === 0) ? (bits & 0x7fffff)<<1 : (bits & 0x7fffff) | 0x800000;
var f = sign * m * Math.pow(2, e - 150);
return f;
}

Can you please use the </> from the post formatting tools to post text of code

We will maybe need a payload from the sensor and what parts are you missing?

And till now no one can help with this?

Pehaps a bit specialist for many of the TTN users & forumites? There are other threads dealing with Eastron products - 230 & 630 included have you looked at those for help? (Forum search top right of every thread page is your friend :slight_smile: If your problem also a Datacake one have you reached out to Datacake support for assistance?

I did try but gave up any hope to get support from datacake I never get any reply from them for any support request and yes been all over the search and results are all confusing besides the anomosity vs the company manufacturer for not adhering to Lorawan standards for how they handle payloads non the less I dont think any change will happen from the Eastron side. And all materials I have give confusing info I can only get the imported watts thats it rest all is wrong!

Btw even the close all relays and open mentioned in forums all doesnt work I tried both direct from TTN and datacake.

I have SDM530-LR.