I want to store the uplink-data into Postgresql,where is the proper location to put my code
Is it in func handleCollectedDataUpPackets() ? Good news is that it seems the PHYPayload decrypt already done. Anyone already do this job?
Normally you would like to have a separate application that subscribes on some MQTT topic (see this for more information) and that pushes the data to the database.
If you don't want to create another application, you can add implementation of ApplicationBackend (check this one for example), but then you might have problems merging when the loraserver changes in future versions...
in func handleCollectedDataUpPackets() how to read the content of macPL.FRMPayload?
Best would, as @ivajloip already mentioned, to subscribe to your node(s) MQTT topic(s) (application/[AppEUI]/node/[DevEUI]/rx) and persist the data yourself.
I would expect peristemcy to be handled by the application server. In my case, I grab the data from Mqtt, interpret it, insert it into InfluxDB and then connect Grafana to it for visual presentation. With InfluxDB you can control retention period etc, so you could have different classes of service etc.
@VirTERM how you are connecting from mqtt to influxdb? Using python?