Enterprise IoT Shadow Updates in AWS

Hello,

I’m trying to create shadow updates for my Enterprise IoT Gateway working with a 2-channel vibration sensor.

I followed the steps in the setup guide and the additional instructions you sent to help modify the tutorial for my type of sensor.

Right now, I am able to see that my gateway is connected to AWS and I can see it sending information to the correct topic. However, I haven’t been able to make a working classic shadow for the Enterprise yet.

I tried following the advice in the below linked thread:

I adjusted the message topic to send to the shadow update and I am now getting the same final error:
{
“code”: 400,
“message”: “Missing required node: state”
}
Because of the difference in sensors and gateways, I’m not sure how to fix this error with the Enterprise IoT. Is there a way to adjust the message format to work with the AWS format?

Thanks!

Can you Provide both the topic you are publishing to as well as the JSON payload you are publishing to that topic?

Thank you,
Travis

I’m publishing to the topic:
$aws/things/Enterprise-27D7/shadow/update

I’m not adjusting the payload from the default. That might be one of the sources of the problem I’m facing. Currently the payload looks like this from the node-red debug window:

And it looks like this in the topic subscription on AWS:

Let me know if you need more information.

Your Topic appears to be correct

Yes, you will need to adjust the JSON object format to meet the requirements of AWS Shadow document.

You can reference AWS documentation here:

All telemetry parameters you want to publish need to be nested like this:

{
    "state": {
        "reported" : {
            "mode" : 0,
            "s1_odr" : "100Hz",
            "x1_temperature":20.79,
            etc...
        }
    }
}

You will probably do this inside a function node in Node-Red.

Adjusting the JSON object format did the trick and I’m now getting the shadow updates and activity. The function node did the trick converting the message. For reference, I used this basic function layout:

Thanks!

1 Like

Unrelated, but my 2-channel vibration sensor stopped sending information.

The LED began to blink 3 or 4 times in succession about every minute when it was supposed to send data. I turned it off and then turned it on again when I noticed the missing data, but now the LED never blinks, not even when I hit the reset button.

It was working fine earlier today but it started to give this odd result later in the day, and I really noticed it when I turned on another sensor. Did the LED’s blinking like that mean a certain status of the machine?

Hi @cshoerrner let me ask if your vibration sensor is powered by an external power supply or battery?

Based on the sensor data screenshot, I noticed the battery voltage is very low (~1.49V). If the battery voltage drops below approximately 2.8V, we recommend replacing the batteries.

Let me know if you have any questions.
Thank you,
Eduardo M.

Yep, it absolutely was the batteries that I had in the sensor. They just coincidentally died when I turned on the other sensor, so it looked like a weirder event than it was. I replaced the batteries and the two sensors are working fine now.

Thanks!

1 Like