Extracting Data from TTN (TheThings Network) using REST API - lorawan

I have successfully Integrated TTN theThingsNetwork with my LoRaWAN Gateway. Also I am able to forward data between from Nodes to theThingsNetwork. Now I am looking for information to fetch data from TTN Thethingsnetwork to my own server. Any information will be appreciated.
Thanks in advance.
Regards,
Zaheen

First, let me welcome your on The Things Network !
To get your data to your own server, you have several possibilities:
The first one is to create a MQTT client running on your server to receive all your data in real-time. For this, you can use several SDKs provided by The Things Network at https://www.thethingsnetwork.org/docs/applications/sdks.html
The next way to do it is using integrations. In the upper-right corder of your application management console, you should see an "Integration" tab.
Using this tab, you can create two different types of integrations:
The first type is the "HTTP integration". Using this one, all received messages for your application will be forwarded to the url provided in the integration configuration. A complete documentation is available at https://www.thethingsnetwork.org/docs/applications/http/
The second type is the "Storage integration". Using this one, all your received messages are stored in a database for 7 days ans are query-able via REST. A complete documentation is available at https://www.thethingsnetwork.org/docs/applications/http/ https://www.thethingsnetwork.org/docs/applications/storage/

Related

Symmetric DS simple configuration guidance

Over the past couple of weeks I have been prototyping out some examples in symmetric DS. Looking for some guidance and examples because I am really running into some walls here. I have used the server and android examples successfully, don't need any assistance with setup on getting the basics working. It is a complex tool and I;m still learning it as well.
So I am trying to setup an environment where all the clients that run on android device sync up to a server. So I know it's fairly straight forward to do a setup where its 1 MASTER -> <- multiple clients, as the example that they provide do.
What I am trying to do is multiple masters to multiple clients. Essentially I want a database on the server for each client. Ill attach a diagram to try to help explain but I want a database for each store so store #1 has a master DB on the server and it syncs both ways with the client device.
server-diagram
SymmetricDS requires having a central node to store the configuration. I would recommend to have a central node with bunch of databases that connect to the central database. Connect each android application to another database. This topology will allow configuring what data syncs from the central node to the bunch of databases and what goes back
On the router from client to server you can set the target catalog to be a variable : $(sourceExternalId). This will use the clients external id as the database name on your server.
If you also need to replicate data back down you can set the external select on the triggers at the server. This would need to be an expression on your server database that would evaluate the current database. This would fire when a change occurs on the server database and populate the external_data column on sym_data during capture with the database that the change occurred in. You would then adjust the router from server to client to be a column match router type. Your expression then for the router would be: EXTERNAL_DATA=:EXTERNAL_ID. This would ensure that this data only be sent to the appropriate client.

Spring Integration XMPP and File Transfer

I need to transfer files to a user connected to a XMPP Server.
The file transfer is supported by Spring Integration XMPP? (The current release version is 4.1.6-RELEASE, the snapshot is 4.2.0-SNAPSHOT).
I succesfully send text messages using the XMPP Message Outbound Gateway using a configuration like this:
<int-xmpp:outbound-channel-adapter id="outboundEventAdapter"
channel="outboundEventChannel"
xmpp-connection="testConnection"/>
Using this Outbound Gateway I'm not able to send files (only String and org.jivesoftware.smack.packet.Message payloads are supported)
Thanks in advance.
Massimo
The Spring Integration XMPP module is fully based on the Smack library, so I'd be glad to hear from you or from anybody else who confirm and show us how to do that with Smack first of all.
And only after that we will be able to come with some adaptation from our perspective.
Please, refer to Smack XMPP File Transfer for more information.
From other side if you are able to come up with some solution on the matter you always can wrap it to the standard <int:service-activator> to make your application working.

IIS Streaming/Pushing JSON to iOS

Quick Version:
I want to send timely data updates (in JSON) from an IIS WCF RESTfull webservice to an iOS custom-application. I don't want to poll due to bandwidth costs and the update-rate I need to achieve. My clients communicate to their server over the internet.
I'm confused by my options, and most of the information I read is out of date, targeted for web-browsers, or for media streaming.
Is there a current best-practice / standard-practice I should be using?
Extra Details:
I have approx 25-100 iOS (v5.1) clients (iPads).
I 'd like my clients to see an update within about 5 seconds of an event occurring.
My clients are running 24x7, and communicate over a 3G network.
The application only needs to receive the data while it is running (no requirement to show a notification when the app is minimized).
Using a 3rd party service, or having to set-up a special server on my end is a no-go.
Whatever I do needs to integrate nicely with my existing IIS WCF webservice.
No additional research is required because you've asked a perfectly constrained question:
There are only two choices: push or pull, and pull is ruled out.
There is only one way to push: APNS.
Without third party assistance, there's only one option: build an APNs provider.

Advice - Real time data processing from client to server

I am looking for advice/guidance on how to achieve the following:
I have a circuit mounted and connected to an Arduino and I am able to easily retrieve data from it, using Python and the pySerial module. It allows me to determine the value of an analog input over time.
At the moment I am storing that data to a file, with a time stamp and the correspondent value and I would love to hear opinions and thoughts on how I could 'share' this data to a web server and 'play' it live.
Is it possible to 'stream' the values into the dump file and retrieve data from it at the same time through an AJAX request or should I look into event-driven web servers like 'Tornado', 'Twisted'...
I am a bit lost here. Just for the record, I am comfortable with PHP and JavaScript for the final output, I just don't have a clue on how to constantly 'stream' the data I need.
Thanks in advance.
If you don't plan to update the Ardunio device too much then it would make sense to have the Python component continue to collect the data over the serial port and publish it in a way that can easily be consumed by a service which can distribute the information in a more efficient, and probably flexible, manner.
e.g.
read the data from the serial port and publish messages onto a message queue. The message queue can then be read by any other component and the data can then be distributed to other applications/clients.
Make a web call to a server that can process each update and distribute to other applications/clients.
You could use something like Pusher (who I work for) and make a call to the REST API to deliver each message to any connected clients. Whilst this is a good way of distributing your data you will be publishing your data even if no clients are listening so I think you are best to get the data to a component like a web server first.
Assuming you go with 1 or 2, you can then use realtime web solution to distribute the data to any number of clients. You could use Pusher here or you could use a self hosted solution.
So, the data flow as I see it would be:
Ardunio -> small Python app -> Queue (or HTTP request to Web server) -> Realtime Web Technology -> Many clients

Sync the sqlite data of iphone application to server

I am trying to make the sync data application in which user have some value into the data base .And he have to send this data on to the server .With help http request how can i do that .
I need the
I am not using the php web server .
I am using the Normal HTTP web page .
ANd i have the some data in my iphone application and i want to Synchronization that data to server .
I it must check the Internet is available or not .If the Internet is ON than only he will Synchronization the data .that's my question .
Nothing else .You got my point or not .
I thing people will reply me soon please
Thanks
You have got to have some kind of server backend for synchronization of the local database. You can't do that using just the static HTML pages.
Your application and server have to have a way to talk to each other using a web service protocol, like SOAP or JSON/REST. Then your application has to translate the data from the database into such web service data objects.
Both your local database and the server (in case of more than one client) will have keep the records of at least the times of last synchronizations so both know what should be sent over the air in order to become in sync.
Also, in the usual case of more than one client, you have to solve the problem of conflicts resolution.
Web service versioning is important as well, as there will be very likely a need to improve the communication channel, maybe there will be changes in the database model to be synchronized.
As you can see, the idea of synchronizing local database to a server is not that simple, and if you think you can do it in a simple way, in time you'll realise that you're gradually reimplementing the aforementioned ideas.
Do a research on web service technologies, writing web services-aware apps, on synchronization with web services and on Reachability, for starters.
To check internet availability, check out the Reachability class from Apple. See this article.
To send data to a simple HTTP form via POST use NSURLConnection like in this article.
Cheers,
S