Sidewalk: The IoT network from Amazon
08.05.2024
Elektronik | Funk | Software
Der Technik-Blog
This article is an update to the project From TTN to your own website, which was developed under TTN V2. With the new TTN Stack V3 the existing project is no longer compatible, because the JSON formatting has changed. In addition, with TTN V3 the layout of the console has changed a lot compared to Stack V2. For this reason, a new, completely updated article has been written.
Basically, a LoRaWAN network only takes care of the data transfer, but not the storage of this data. The user has to take care of storing the data himself and tell the LoRaWAN network an interface to which the data can be sent. For this purpose, there are many ready-made services, some of them free of charge, which store these data and display them graphically. Alternatively, you can send the data from TTN to your own web space using a webhook (formerly HTTP integration). The project presented on this page is a small PHP application that stores and displays the measurement data from the Dragino LHT65 in a small MySQL database. This is a working example project, which should be adapted to your own needs or further developed.
Everybody who owns a homepage already has a webspace. But there are also free webspace providers like bplaced.net. There are no special requirements for the webserver. Only the PHP script should have write permissions in the main directory, so that a logfile can be created. Additionally a database (ideally MySQL) is needed to store the data.
In the ZIP-Archive there are four files in total. First open the file [config.php] with a text editor and adjust the parameters for the database server. You get the access data as well as the server address from the respective provider. The configuration could look like this:
After the login data has been modified, the file can be saved. The following files to be uploaded to the web space via an FTP-Client (for example FileZilla):
If the PHP files have been uploaded to the web space and the database server has been configured correctly, the following error message should appear when calling the URL:
Webhooks (integrations) are HTTP/HTTPS interfaces between the LoRaWAN network or application and the Internet. To get the data from TTN to your own website, you have to set up a webhook with the URL to your webspace. In the Application under Integrations -> Webhooks -> Add Webhook a "Custom webhook" must be created. The following parameters must be specified:
After successful setup, TTN automatically forwards new measurement data from the LHT65 to the webapp. If everything has been set up correctly, the measurement data can be viewed on the website just a few seconds after transmission:
Every day hundreds of meteorological radiosondes fall from the sky. In this article we convert a radiosonde into a GPS tracker for APRS, RTTY & CW
read moreAlternative payload decoder for the SenseCAP T1000 LoRaWAN GPS tracker. Compatible with TTN Mapper, LoWTrack and other apps.
read moreAEQ-WEB © 2015-2024 All Right Reserved