Readings from MQTT Gateway

i got the following pub message from the sensors via the MQTT gateway:

{“00:13:A2:00:41:98:12:F9” {“transmission_count”:26,“battery_level”:3.29406,“type”:8,“node_id”:0,“rssi”:20,“rms_x”:6410.23,“rms_y”:6904.31,“rms_z”:5181.43,“max_x”:50782.72,“max_y”:49469.44,“max_z”:12554.24,“min_x”:-44410.88,“min_y”:-45721.6,“min_z”:-56401.93,“temperature”:33}}
{“00:13:A2:00:41:8D:15:58”:{“transmission_count”:234,“battery_level”:3.29406,“type”:8,“node_id”:0,“rssi”:100,“rms_x”:346327,“rms_y”:299653.1,“rms_z”:892848.6,“max_x”:823590.4,“max_y”:765309.4,“max_z”:1608013,“min_x”:-913157.1,“min_y”:-820024.3,“min_z”:-1793528,“temperature”:35}}

The two vibration sensors are giving extremely high values eg, “rms_x”:346327". If the values are in mg, we are looking at 346 g. Does not look right.

Is the values in mg?

@Bhaskar,

This is the conversion code for type 8 sensors:

dataObject["rms_x"] = (float)(signedInt(data, 9, 24)/100.00);
dataObject["rms_y"] = (float)(signedInt(data, 12, 24)/100.00);
dataObject["rms_z"] = (float)(signedInt(data, 15, 24)/100.00);
dataObject["max_x"] = (float)(signedInt(data, 18, 24)/100.00);
dataObject["max_y"] = (float)(signedInt(data, 21, 24)/100.00);
dataObject["max_z"] = (float)(signedInt(data, 24, 24)/100.00);
dataObject["min_x"] = (float)(signedInt(data, 27, 24)/100.00);
dataObject["min_y"] = (float)(signedInt(data, 30, 24)/100.00);
dataObject["min_z"] = (float)(signedInt(data, 33, 24)/100.00);
dataObject["temperature"] = (int16_t)(data[36]<<8)+data[37]; 

It looks like the bytes are converted to 24 bit and then divided by 100. Let me know if there are any issues with this.

Sorry I cannot understand. I am getting directly from the MQTT message string. Now can I obtain data from the message string.

do you have any USB modem or mega modem ?
if you do i will recommend testing the sensor with them and see what kind of results you are getting there.

Install the sensor and then hit reset. first few seconds it will calibrate itself and then send values.
Thanks

I am sure the MQTT Gateway is giving wrong data. Can ncd publish a firmware release to fix this.

Does not make sense as customer to help ncd to debug their problem.

I have used node-red and I getting different values via node-red and the MQTT Gateway.

I do not want to use node-red to get the data from the sensors as there are extra hardware required to run node-red and ncd wireless USB modem. I am expecting the the ncd MQTT Gateway can do the same as a node-red and ncd wireless USB modem.

I cannot release a firmware update as I can see nothing wrong with the firmware. The conversion code appears to be correct. @Bhaskar can you confirm the gateway conversion code is correct? The only thing I could speculate is that the byte indexes of the packet were somehow shifted off but that does not appear to be the case since battery voltage, node ID, and transmission count appear to be correct.

I have compared the conversion code of the gateway against, Node-Red and the documentation. It is correct as far as I can tell.

the conversion code looks correct. Travis can you run a quick test using a vibration sensor.

Do we have a type 8 sensor here? All I have is a type 40.

This is the data obtained from node-red of the same sensor:

{“nodeId”:0,“battery”:3.2940600000000004,“counter”:1,“sensor_type”:8,“sensor_data”:{“rms_x”:26.69,“rms_y”:23.95,“rms_z”:11.19,“max_x”:196.9,“max_y”:191.05,“max_z”:31.47,“min_x”:-174.94,“min_y”:-180.8,“min_z”:-35.86,“temperature”:33},“sensor_name”:“Vibration”,“type”:“sensor_data”,“addr”:“00:13:a2:00:41:98:12:f9”,“received”: 1571846643673,“time”:“10/23/2019 04:04:33 PM”}

I just powered up a Type 8 Sensor, connected it to a MQTT Gateway and this is the message string I am seeing:

{  
   "transmission_count":6,
   "battery_level":3.29406,
   "type":8,
   "node_id":0,
   "rssi":100,
   "rms_x":3069.43,
   "rms_y":320,
   "rms_z":742.4,
   "max_x":47787.51,
   "max_y":2810.88,
   "max_z":2621.44,
   "min_x":-3932.17,
   "min_y":-3184.64,
   "min_z":-4119.05,
   "temperature":24
}

Personally I don’t know anything about Vibration readings so I do not know if these would be good readings or not. The sensor is on a desk with no vibration.

@TravisE_NCD_Technica looks like something is getting messed up in the gateway conversion… the values should be more like

{“nodeId”:0,“battery”:3.2940600000000004,“counter”:1,“sensor_type”:8,“sensor_data”:{“rms_x”:26.69,“rms_y”:23.95,“rms_z”:11.19,“max_x”:196.9,“max_y”:191.05,“max_z”:31.47,“min_x”:-174.94,“min_y”:-180.8,“min_z”:-35.86,“temperature”:33},“sensor_name”:“Vibration”,“type”:“sensor_data”,“addr”:“00:13:a2:00:41:98:12:f9”,“received”: 1571846643673,“time”:“10/23/2019 04:04:33 PM”}

when sensor is sitting on desk.

I have identified the problem and am now working to resolve it in a firmware update.

@cbmsingapore, we have an update script for updating the firmware on the gateway boards. This update however requires access to the USB connector on the gateway processor. You will need to pull the Processor module out of the Gateway and plug a USB Micro cable into it. Instructions for the update script are available here if you want to get a head start:


I will let you know as soon as the firmware is on our server and you can run the update script.

@cbmsingapore, The updates are live on our server. You can now run the update script to update your gateway module. This will reset all settings in the gateway so it will boot in config mode and you will need to re enter your MQTT Broker Host Settings as well as your wifi network settings. Let me know if you need anything else.

Thank you for the quick response.

I will try to install the firmware.