Question regarding connection to Raspberry Pi

Good morning,

I am planning on building a structural vibration sensor controlled via Raspberry pi 3b+ that will send data to Amazon AWS via 3G using a 3G hat for my Pi. I was thinking of using a Industrial IoT Wireless Vibration & Temperature Sensor V2 MEMS (https://store.ncd.io/product/industrial-iot-wireless-vibration-temperature-sensor/) connected to the Pi via a 900HP-S3B Long Range Wireless Mesh Modem with USB Interface (https://store.ncd.io/product/900hp-s3b-long-range-wireless-mesh-modem-with-usb-interface/).

My plan is to add a couple extra sensors to the Pi, get the data from the vibration and temperature sensor, pack it in a json message with the other sensors data and send it to AWS cloud. Will I be able to retrieve the data from the NCD sensor via a python script? Just want to make sure before I purchase all the sensor I need for my work.

Thanks so much,

Joan

Hi Joan,

@Jacob has developed a python library for our enterprise wireless sensors here:

This library will receive and parse transmissions from our Enterprise series wireless sensors. Please take a look and let us know if you have any questions.

Thank you,
Travis Elliott

Thanks so much.

So do I need to purchase both components? Or can I just purchase the sensor and connect it via WiFi to the raspberry?

Hi,

We do not currently have any WiFi connected sensors. The Enterprise wireless sensors operate on 900 MHz so you will need a way to connect the Pi via 900 MHz. You can use the USB modem you linked above or a Pi XBee overlay + 900 MHz module like this:

Thanks so much, I will then buy Industrial IoT Wireless Vibration & Temperature Sensor V2 MEMS (https://store.ncd.io/product/industrial-iot-wireless-vibration-temperature-sensor/) connected to the Pi via a 900HP-S3B Long Range Wireless Mesh Modem with USB Interface (https://store.ncd.io/product/900hp-s3b-long-range-wireless-mesh-modem-with-usb-interface/) and use the Python library you mentioned. I will let you know if I have any issues.

PS: Amazing company, so happy you guys answer so fast and are so helpful

No problem Joan, we’re happy to have you. Please let us know if we can help with anything else.

@joanfernandeze

I just realized which sensor you’re planning to use with this. There’s a dev branch of the Python library that works with this sensor when its in time series data mode: https://github.com/ncd-io/NCDEnterpise-Python/tree/v2-Vibration-Mems

Currently it doesn’t have the temperature data in this mode, but I have a fix for it I just need to find some time to fully validate and push it to the master branch.

Dear Jacob,

The python library works really well. However, we are interested in sending a request to the sensor so that it can read and send the data back. Is it possible to request the sensor for data? What is the maximum amount of times per second you get data from the sensor? Our idea is to have the raspberry pi turn on and get the data from the sensor, so we need to be able to request data on demand several times in a short amount of time and then send the device to sleep until we ask for more data.

Thanks,

Joan

Is it possible to request the sensor for data?
Yes and no. The sensor will only wake up on interval and send its data, but there is a mode wherein it doesn’t send the time series data. In this mode it will send the regular single reading of the Vibration Temperature and will stay awake for a command to send the time series data. I don’t have support for the optional command after read functionality at this time. Its vastly different than the methodology to monitor any of the other Enterprise sensors and it takes substantially more time to support it.

What is the maximum amount of times per second you get data from the sensor?
If time series data is enabled the sensor will 340 readings at once. This can only be done once ever ~3-5 seconds. @bhaskar knows more about the sensor’s data.

The products and libraries were designed with an always on server in mind that multiple sensors could spontaneously broadcast to. Making both the server and the sensor go to sleep you’ll miss data and waste battery time on the sensor as it broadcasts to a sleeping receiver.

Hi Jacob, I’m working with Joan in this project. The thing is we are trying to use the sensor for vibration analysis, and we would need a way to read acceleration in the time domain with the highest possible resolution. We have noticed that the python code returns RMS, minimum and maximum values, but we need a time series data with all the data points. We also have seen that the labview plugin can see vibration data for FRF construction (which is what we want), so the data must exist in the serial data from the usb. Is there any way we can get the time series data necessary for a FRF using the python code?

Hi,
for that you will need this sensor

pyhton does support time domain data.
Thanks

To get the Python library to receive the time domain data you will need to configure the sensor to always send time domain data. The sensor itself is only sending out the RMS, minimum and maximum values and I don’t query it for the time domain data.

And how would we go about configuring the sensor in that way? We have set the delay between packages sent to 0 using the visual studio program, but we don’t see any ‘time domain’ setting we can enable. We would greatly appreciate any data you have regarding how to enable that ‘time domain’ mode.

Hi Jacob,

The time series data is working fine on Python library. Any chance to update the code on temperature data too on time series data mode?

If I can track down one of the sensors today I should be able to test and push the code.

The temperature is now supported from the beta version of the library: https://github.com/ncd-io/NCDEnterpise-Python/tree/v2-Vibration-Mems

Hi Jacob, thanks for your hard work! We have been trying to use the labview utility and it definitely works marvels and we are perfectly capable of viewing both time series data and FFTs. When using the python, though, we have not been as successful. We see the time series data now, but we are unsure of what the data we see in python means. When we run the example, it returns a list of 340 RMS values (with which we are happy) in a dictionary and temperature, battery status, etc. From time to time it returns a mems buffer error and the data doesn’t make much sense (temperatures skyrocket, battery percentage goes above 100%) we are, therefore, unsure about the veracity of the read acceleration, and we would like to know what the errors mean and if we can solve them.

Just so that you get an idea of what we are talking about, this is what we see upon executing the example code:

312: {'rms_z': -1071, 'rms_y': 1825, 'rms_x': 2306}, 313: {'rms_z': -1143, 'rms_y': 1745, 'rms_x': 2282}, 314: {'rms_z': -1144, 'rms_y': 1766, 'rms_x': 2268}, 315: {'rms_z': -1029, 'rms_y': 1826, 'rms_x': 2324}, 316: {'rms_z': -1053, 'rms_y': 1745, 'rms_x': 2289}, 317: {'rms_z': -1127, 'rms_y': 1760, 'rms_x': 2280}, 318: {'rms_z': -1111, 'rms_y': 1894, 'rms_x': 2323}, 319: {'rms_z': -1112, 'rms_y': 1786, 'rms_x': 2290}, 320: {'rms_z': -1115, 'rms_y': 1765, 'rms_x': 2279}, 321: {'rms_z': -1005, 'rms_y': 1846, 'rms_x': 2314}, 322: {'rms_z': -1096, 'rms_y': 1737, 'rms_x': 2324}, 323: {'rms_z': -1105, 'rms_y': 1781, 'rms_x': 2236}, 324: {'rms_z': -1035, 'rms_y': 1832, 'rms_x': 2326}, 325: {'rms_z': -1133, 'rms_y': 1777, 'rms_x': 2322}, 326: {'rms_z': -1127, 'rms_y': 1711, 'rms_x': 2247}, 327: {'rms_z': -1050, 'rms_y': 1786, 'rms_x': 2308}, 328: {'rms_z': -1099, 'rms_y': 1809, 'rms_x': 2317}, 329: {'rms_z': -1090, 'rms_y': 1773, 'rms_x': 2298}, 330: {'rms_z': -1069, 'rms_y': 1855, 'rms_x': 2328}, 331: {'rms_z': -1137, 'rms_y': 1739, 'rms_x': 2297}, 332: {'rms_z': -1098, 'rms_y': 1747, 'rms_x': 2244}, 333: {'rms_z': -1114, 'rms_y': 1778, 'rms_x': 2314}, 334: {'rms_z': -1042, 'rms_y': 1841, 'rms_x': 2317}, 335: {'rms_z': -1108, 'rms_y': 1758, 'rms_x': 2288}, 336: {'rms_z': -1107, 'rms_y': 1747, 'rms_x': 2331}, 337: {'rms_z': -1071, 'rms_y': 1829, 'rms_x': 2282}, 338: {'rms_z': -1079, 'rms_y': 1817, 'rms_x': 2329}, 339: {'rms_z': -1161, 'rms_y': 1758, 'rms_x': 2323}, 340: {'rms_z': -1162, 'rms_y': 1768, 'rms_x': 2324}, 'temperature': 2312}
counter NA
sensor_type_id 40
battery_percent 8259.58128078818%
source_address 0013A20041941854
battery 168.9695
nodeId 0
sensor_type_string Vibration Time Series
firmware 6
odr 6
error reported in V2 Mems Buffer
error reported in V2 Mems Buffer
error reported in V2 Mems Buffer
error reported in V2 Mems Buffer
error reported in V2 Mems Buffer

We appreciate the ability to read temperature, but it is a piority for us to read acceleration time domain data in order to compute the FRF.

That is a catch all error I put in place to inform customers that their data may be skewed or that a dataset was found invalid or thrown out. I did not personally run into this while writing the code so I’m not sure what is causing it. I’ll need to trigger the issue on my end to really solve the issue.

When you encounter this issue, how many Vibration/Temperature sensors do you have reporting to a single modem?

How often are they reporting?

So I can reproduce this issue. If left long enough a packet will be missed. I’ve altered the code locally to prevent this from happening, but I’m considering best practices for reporting this issue. Should have something shortly.

The fix for missing packets of data is now live in the beta branch: https://github.com/ncd-io/NCDEnterpise-Python/tree/v2-Vibration-Mems

Support for the Kwarg ‘error_handler’ was added. See the example for details.

In a nutshell I added additional processing and error reporting. It will now not return corrupt data to your main callback. Instead if the library detects an error and you have an error_callback set it will send what data it could collect (in raw bytes) as well as the time that the bad dataset was detected.

Let me know if this fixes the issue or if you have any requests for handling.