For one’s own server (like a Raspberry Pi), those are indeed the two options. As you don’t seem to understand the difference:
-
An HTTP web server along with the HTTP Integration needs you to carefully open up your Pi to the internet (some settings in your modem/router) to allow TTN to connect to it, and needs you to set up the integration in TTN Console.
-
An MQTT client for the MQTT Data API connects to TTN itself, so does not need the Pi to be accessible over the internet. Also, many Pi’s come with Node-RED installed, which has built-in support for MQTT. This does not need any configuration in TTN Console (though you could add an extra application Access Key for this specific client).
Both options need to be running at all times. (Though HTTP could be using AWS Lambda’s/Azure Functions and the like for on-demand access.)
I’d use MQTT.
If you’ve got Node-RED installed then I’d dive into that, as it makes it easy to run it in the background at all times, does not need much programming skills, and has good debug “nodes” to see what’s going on. There’s a lot to be found on the internet about that, including writing to a database rather than just a file. (But use the built-in Node-RED MQTT Input; do not use the archived TTN Node-RED library.)
If you don’t have Node-RED installed, then the Pi will still have Python available, so a Python MQTT client could be made to write to a file. (But use the bare Paho client; do not use the discontinued TTN Python SDK.) Or probably easier if you don’t have much programming skills: the command line mosquitto_sub
client could simply be run in the background and pipe its output to a file.