Payload Decoding in Postgres Integration

Hello,

I recently did the Postgres integration as indicated on the official Chirpstack V4 page. The problem I have is that the data that is being saved is in binary, so to be able to read it I have to convert it one by one to hexadecimal and decode it. To do this, I have thought of a way to save them already decoded in the database but I am not sure how to do it.
One way is to write the following to the chirpstack.toml file:

[integration.postgresql]
dsn=“postgres://chirpstack_integration:chirpstack_integration@$POSTGRESQL_HOST/chirpstack_integration?sslmode=disable”
data_parser=“/path/to/your/python/file.py”

The file.py being thus a python code that decodes the signal, in this way would file.py be executed before being saved?
Another option is to put a code in the Codec option of the Device profile, but I don’t know how the input and output of the functions should be or if it is useful for postgres integration.

Thanks for the attention.
All the best.

This is the recommended way and the decoded payload will be stored as jsonb in the object column.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.