Hi
I use cubecell with sensor BMP180 , connected to TTN gateway, TTN and to Tagoio.
Payload is string : 0000c0418096c5475f9b56410002
I dont have any payload parser or decoder to get out temperature data etc.
Any help please.
Cubecell BMP180
Here ya go
function tofloat32(a1,a2,a3,a4){
var s=(a1&0xff)>>7;
var E=(a1<<1&0xff)|a2>>7;
var M0=(a2&0x7f)<<16|a3<<8|a4;
var M=1;
for(var i=0;i<23;i++)
{
if(M0>>i&0x01==1)
{
M=M+Math.pow(2,i-23);
}
}
var result=Math.pow(-1,s)*M*Math.pow(2,E-127);
return result;
}
function Decoder(bytes, Port)
{
var temperature = tofloat32(bytes[3],bytes[2],bytes[1],bytes[0]);
var humidity = tofloat32(bytes[7],bytes[6],bytes[5],bytes[4]);
var voltge = bytes[8]<<8|bytes[9];
var result={
“sensor”:{
“Temperature”:temperature,
“Humidity”:humidity,
“Voltge”:voltge,
}
}
return result;
}
Hi, thanks a lot. I am not sure where to put this function? I have tried in tagoio parser but nothing happens. Definitely i am doing something wrong. This is my first parser integration so, apologize for bothering.
Rgds
Sorry, know nothing about Tagoio. I use this parser in TTN and it works.fine. Sorry 'bout the poor formatting, couldn’t remember how to insert code. Think I should have used */
Good luck