Git Product home page Git Product logo

sensordecoders's People

Contributors

ajkolstad avatar milesight-iot avatar milesight-sway avatar ursalink-cn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sensordecoders's Issues

AT101 payload and decoder incorrectly uses positive longitude for West

I'm located in California, near 38.169N and 122.137W. By convention, southern latitudes and western longitudes are given a negative sign, so this should be:

38.169, -122.137

However, the AT101 payload and decoded value shows 38.169, 122.137.

If I give this string to Google Maps, it shows the correct location in California:

image

However, the AT101 payload and decoded value shows 38.169, 122.137, which is in the sea between China and Korea:

image

Perhaps the decoder should multiply the longitude by -1 ?

UC51x decoder doesn't correctly handle unknown/new data items

The UC51x decoder is structured with if {} else if {} else if {} else break. We had a older decoder installed on ChirpStack and did not realize it. Newer UC51x v3 has new data items that the decoder does not recognize, which fall down to the break - meaning a single new data item in a payload stops decoding the remainder of the payload.

Suggest removing the 'else break' and just test for each known data item. Unknown/new data items (like in UC51x v4) should be ignored without terminating decoding.

Encoder for WT201

We are looking for the encoder for the WT201 to write data such as the temperature set point, fan speed and mode. Is there an encoder available Will the encore for the WT30x work?

UC50x decoder doesn't work in ChripStack v4

Hi there,

I tried to upload the codec from UC_Series/UC50x/UC50x_Decoder.js and it doesn't work instead it logs me out of ChirpStack.

Ended up having to clean the script to allow it to save into ChirpStack v4.

Problem decoding up messages in EM300DI

HI, we are integrating this EM300-DI device into Chirpstack 4.8.1, after loading the decode that you have published.

https://github.com/Milesight-IoT/SensorDecoders/blob/main/EM_Series/EM300_Series/EM300-DI/EM300-DI_Decoder.js

I have a configuration where the totalizer of a water meter is sent every minute.

And I get these error messages randomly due to decoding failure.
image

Here is an image of a UP that cannot decode
image

And here is an image of a UP that decodes correctly
image

EM-300-DI.log.json

I am attaching a more complete log where you can see UP messages correctly decoded and others that are not.

What could be happening?

thanks for your help

EM-300 payload without battery value?

As payload for the EM-300-TH sensor I am receiving:
0367AD00046873

Per the decoder in github, the temperature and humidity can be decoded, but it seems that the payloadstring lacks the battery value.

Is the payload format changed with firmware 1.2, so that battery is no longer a part of the payload?

UC511-DI-868M

I am trouble pulling the battery level from the device. I used the code as given here but only gets 4 values from the object.
data:"AwEABMgAAAAABQEABsgAAAAA"
objectJASON: 4keys{}
valve1:"off"
valve1_pulse:0
valve2:"off"
valve2_pulse:0

Please assist

EM300 with hourly measurements keeps sending empty payload.

We have a thousands of units thats been configured to have an hourly measurement.

But the sensors keeps sending blank payloads 2 times every hour, and the measurement once an hour.
Measurements are sent on Port 85 as described in documentation.
However the blank payloads are sent on application port 0 and is nowhere to be found in documentation.

We are considered that this will cost battery lifetime.

  • Why is the sensor sending these empty payloads?
  • Will it cost battery lifetime?
  • If so, How is that turned off?

We do not see this type of behavior on other provider of sensors or in EM500.

image

UC511-DI-868M Battery Levels

The UC511-DI-868M controller sends the battery reading every 6 hours, as an integer value:

"battery":5,"valve1":"off","valve1_pulse":0,"valve2":"off","valve2_pulse":0	-	"2022-10-12 14:00:53"
"battery":5,"valve1":"off","valve1_pulse":0,"valve2":"off","valve2_pulse":0	-	"2022-10-12 20:20:32"
"battery":5,"valve1":"off","valve1_pulse":0,"valve2":"off","valve2_pulse":0	-	"2022-10-13 02:20:32"
"battery":0,"valve1":"on","valve1_pulse":0,"valve2":"off","valve2_pulse":0	-	"2022-10-13 08:20:31"

I assumed that the integer is the voltage, however after receiving the 0 value, the controller is still transmitting messages. Can you please share how to translate the battery levels from the integer (0, 5) to either a voltage, or percentage value?

TS30X Payload Definition doesnt fit with decoder

Hi,

Payload definition of TS30x doesn't say that "magnet_chn1_alarm" exists but in the decoder.js it does exist. (line 109)

line 108                    data.magnet_chn1 = readInt16LE(bytes.slice(i, i + 2)) === 0 ? "closed" : "opened";
line 109                    data.magnet_chn1_alarm = "threshold";
line 110                    break;

Is this correct or should this be a different property?

How do you handle the negative coordinates (south or west)

Hi,

In the specification you wrote the following: "If the device fails toget GNSSdata, the latitude or longitude will show FFFFFFFF."

Then how do you encode the negative coorinates (for example any south 0.000001° or west 0.000001° coordinates)?

It seems that the decoder in the following lines simply ignoring these "error" values and generating valid coordinates for the int -1 (FFFFFFFF) values.

else if ((channel_id === 0x04 || channel_id == 0x84) && channel_type === 0x88) {
decoded.latitude = readInt32LE(bytes.slice(i, i + 4)) / 1000000;
decoded.longitude = readInt32LE(bytes.slice(i + 4, i + 8)) / 1000000;
var status = bytes[i + 8];
decoded.motion_status = readMotionStatus(status & 0x0f);
decoded.geofence_status = readGeofenceStatus(status >> 4);
i += 9;
}

Or simply do not put any device to that 2 (~20 cm width, ~40.000 km long) circles? :)

How to decode the double precision floating point packet?

22fb20cb827a5c40: Little endian (little Endian), 0x405c7a82cb20fb22, the data is of double type, needs to be converted to floating point number, longitude value: 113.9142330000000 (dd.dddd format); (Double type, need change the data to Floating point)

21ea3e00a9953640: Little endian (little Endian), 0x403695a9003eea21, the data is of double type, needs to be converted to floating point number, longitude value: 22.5846100000000 (dd.dddd format); (Double type, need change the data to Floating point)

According to the IEEE 754 standard, a double precision float has the following structure:

1 bit for the sign
11 bits for the exponent
52 bits for the significand (mantissa)

I use this code, but it unable to decoded.

function hexArrayToDouble(hexArray) {
    var buffer = new ArrayBuffer(8);
    
    var uint8Array = new Uint8Array(buffer);
    for (var i = 0; i < hexArray.length; i++) {
    uint8Array[i] = hexArray[i];
    }
    
    var dataView = new DataView(buffer);
    var doubleValue = dataView.getFloat64(0, false);
    
    return doubleValue;
}
var hexArray = [0x40, 0x5c, 0x7a, 0x82, 0xcb, 0x20, 0xfb, 0x22];
var doubleValue = hexArrayToDouble(hexArray); //113.914233

Occurred Error:
js vm error: ReferenceError: 'ArrayBuffer' is not defined
js vm error: ReferenceError: 'Uint8Array' is not defined
js vm error: ReferenceError: 'DataView' is not defined

Issue in UC-t11 code

Dears

I am trying the decoder function but in response, I am getting below error packet:

Error:”js vm error: ReferenceError: ‘Decode’ is not defined”,

Also I have noted that the sensor is not sending Battery information in the packet.

See the below packet details:

Payload(hex): 0167100102683f

Encoder for WT101

Can you please post the encoder for the WT101 to allow writing of target temperature, control mode and position?

Why are there separate Chirpstack (v3) and ChirpStack v4 decoders? Single decoder works

There's no need for two different decoders, especially since this creates the chance of error where the actual payload decoding does not match.

Chirpstack v3 calls this function:

// Decode decodes an array of bytes into an object.
//  - fPort contains the LoRaWAN fPort number
//  - bytes is an array of bytes, e.g. [225, 230, 255, 0]
//  - variables contains the device variables e.g. {"calibration": "3.5"} (both the key / value are of type string)
// The function must return an object, e.g. {"temperature": 22.5}
function Decode(fPort, bytes, variables) {
  return {};
}

Chirpstack v4 calls this function:

// Decode uplink function.
//
// Input is an object with the following fields:
// - bytes = Byte array containing the uplink payload, e.g. [255, 230, 255, 0]
// - fPort = Uplink fPort.
// - variables = Object containing the configured device variables.
//
// Output must be an object with the following fields:
// - data = Object representing the decoded payload.
function decodeUplink(input) {
  return {
    data: {
      temp: 22.5
    }
  };
}

A single decoder file may contain both functions, which call a single actual decoding code.
Thus a single file will serve for both v3 and v4, allowing MileSight to make changes to a single file and users to use a single file, preventing errors.

get devEUI inside the decoder

Hello,

I'm testing the UG56 GW, to get data from em300-DI sensors, with custom decoder (copied from this github repo).
My system/application receive the data through the MQTT interface in the gateway.

the issue is that the received MQTT message is the same as the decoder output which does not include the devEUI.
so my question, is there a way to read/know the devEUI within the decoder, so we can add it to the output message?

WT201 Decoder

Im looking for a decoder for WT201-915 Thermostat. Any chance any of the current WT101 TTN code will work?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.