Reading data from mqtt topic in application workflow,need protobuf decoding of the data and store the data in table. Need info about protobuf decoding. and while inserting rows to table from the output of function node getting error as “message”: “column msgtype is required.” “type”: “validation”.
Immediate help is required.
Hello @Gitanjali_Apet,
Losant does not have built-in support for Protobuf decoding. The best solution I can recommend is to use a cloud function like AWS Lambda, Google Cloud Functions, or Azure Functions. The code to decode protobuf would be executed in a cloud function and invoked by a Losant workflow with the data received over MQTT.
As for your error:
column msgtype is required
This indicates you attempted to insert a row into a data table but did not provide a value for msgtype
. When configuring a data table, you can mark certain columns as being required. Losant will then validate inserts automatically to ensure a value has been provided.
As a side note, data tables are not designed for device data. If this is timeseries data being reported by a device, it should not be written to a data table. It should be written to Device Attributes. There’s a further explanation here:
For protobuf decoding can i use Function node from Losant?
Is time series database good solution for long term storage?
Can i retrieve the data from time series database anytime and visualize the data?
Protobuf is not supported in the Losant function node.
I answered this on your other thread here:
The time series database, which stores data for device attributes, is the primary source of data for Losant Dashboards. If you want to retrieve the time series data for offline processing or other visualization, it can be exported at any time. I provided details about exported data in your other thread linked above.