Device Data Error - Only one field received from device others disappear


#1

I updated my device manifest and have begun sending data to the cloud using MQTT. The message I am sending is as follows: {“humidity”:80,“pH”:7}

Once i look at the result on the cloud data logs all that shows up is: {“humidity”:80}

If I remove the humidity field from my message the resulting data shows up empty as: {}

My manifest appears to be configured correctly for both fields so I do not believe it is an issue with that configuration. I have also been able to send messages for other device types in the past with multiple data fields. There are no errors generated in the log or on the device.

Has anyone encountered this behavior?


#2

Doing a bit more troubleshooting, I seem to be narrowing down the source of our problems. If I send only a subset of the properties of my manifest in the mqtt message the messages start appearing. The issue seems to be internal to the cloud. Usually having different data types (especially double and int) results in non-receipt of the message.

The workaround I have found for now is to send the payload in pieces so as not to confuse the cloud…


#3

I believe the root cause is the discrepancy between the data you sent and the corresponding Manifest field definition for pH field.

Go to https://developer.artik.cloud/documentation/api-reference/rest-api.html#post-a-message, search “Error cases”. There it mentions one example that causes a missing field.

If your data {“pH”:7} matches the Manifest definition, have you ever bumped up the version of Manifest? In the newer version, you changed the definition of ‘pH’ field? For example, the newer version defines pH field is integer but the old define it as string? or newer version does not have “pH” instead have “PH” et al.

In addition, I suggest you to use api-console (https://developer.artik.cloud/api-console/) when trouble shooting (reduce the change of programming error in your code).


#4

I had painstakingly verified that my message contents perfectly matched the manifest. I also copied the manifest over to a new device definition to ensure that the multiple manifest versions were not the same. I simplified my explanation for the forum but I am actually sending a total of 10 properties in the message. I can reliable send properties of the same type to the cloud but when there are integers and doubles in the message it doesn’t appear.

The most concerning is that I am not getting ANY error message in the cloud developer portal. I would at least expect to get a manifest validation error but there is nothing! To me the problem seems to be internal to the cloud at this point, or at least there are errors being generated that are not available to me.


#5

I tried and could not reproduce your issue. Here are my reproduction steps:

  1. On Developer Dashboard, create a device type with the following Manifest

  2. Connect a device of that type in User Portal by following the instruction

  3. Login to API-console

  4. Make a POST call to send a message with two fields (I used jsonvalidator to verify the data payload has correct json format)

  5. Go to https://my.artik.cloud/datalogs and verify that ARTIK Cloud received a message with field {“pH”: 7, “humidity”: 80}

I suggest you to follow the above steps to trouble shoot.

============================
You can see normalization error at https://developer.artik.cloud/dashboard/devicetypes/your_device_type/errors only if the data type is wrong(data payload use int but manifest expect string). If data field name is incorrect ( data use pH but Manifest expect ph), that data field is ignored and no normalization error is produced.


#6

I am sorry, I didn’t specify that ph is a double and humidity is an integer. Following your steps with this one change has replicated my error. I get a 200 successful response code but I do not have a new entry in the data log.


#7

can you provide the following three screenshots?

  • your Manifest screenshot (like screenshot of my step 1)
  • post message (screenshot of my step 4)<== please hide your access token in Authorization field
  • Data log screenshot (my step 5)

#8

Absolutely, Here is the manifest with humidity and ph:
image

Here is a succesfully “sent” message:

Here we can see that there are no received messages:

And lastly the data logs filtered by device:


#9

In your manifest screen, the field name is ‘ph’.
When you make post call in api console, you use ‘pH’.

“ph” != “pH”. That is why your message is dropped.
Please try again with ‘ph’


#10

I have figured out my mysterious issue. The MQTT messenger that I was using had a maximum message size of 128bytes. Raising this limit fixed all of my issues.


#11

Great. Glad to know it works for you now.