Ruby on Rails How to Integrate GPS Tracking System - ruby-on-rails

I am using following versions
ruby 2.3.0p0 (2015-12-25 revision 53290) [x86_64-linux],
Rails 4.2.4
I have GPS Tracking Devices which works with SMS Commands.when we send sms they reply location,etc. The problem i'm sending SMS through SMS API. now, how can i can get reply and to which server (my server or server of SMS API providing company) and how to handle it.
They have given some documentation regarding protocol (works with ASCII codes) that totally i could not understand.
I am using Benway Technologies GPS Tracking Devices.
Kindly, help me.
Thanks in advance.

Reading a bit this https://benway.en.ec21.com/GPS_Tracker--9810443.html
"...Real-time reporting car status Mainboard support Voice monitor function Check location information via SMS and GPRS(TCP)..."
and this
"...GPS-blue, Power-red Data Transmit TCP..."
Your devices are using GPRS protocol, wich means that they have some IP address. With this functionality, the GPS devices work like a little server, so IT IS POSSIBLE to do what you are looking for: request GPS data to the devices and handle it in your own server.
To achieve this:
1) You need to configure the GPS devices by reprogramming them (via SMS or SERIAL) to allow incoming requests from your server. Also you need to configure your devices to send data to your server.
Just tell to your GPS devices that myownserver.tt or 276.333.456.23(your server public ip) will be the domain / ip to send and receive data via GPRS with TCP protocol.
I have some experience using ENFORA and RUPTELA trackers, there is a a lot of info about them, now, in your case, you must read all the info about your GPS devices, if there is none, just use another brand.
2) You need a proper server to handle incoming TCP data (the GPS devices data). Lets say some Debian based server. To handle the data, you need some script (PHP, Ruby, Java, your choice) in the server to decode this data (NMEA in most cases, you can read more here http: //aprs.gids.nl/nmea/) and then a front end if you wanna see this data (You already have RoR).
3) Rails is a web framework with all the Ruby magic ready for us. You need to do the step 1 and 2 first to integrate a GPS tracking system.
Hope it helps!

Related

External MQTT server subscription

I am using IBM IoT service. Registered a device. Now i want to receive messages (this device) from external mqtt server (CloudMQTT). Please, provide detail info about the way can i subscribe to this external server.
Regards,
Mindaugas
Depends on how you are planning to subscribe: Using an app that the device came with? An app that you are going to write, if so which programming language? Node-RED?
Based on the vagueness of your question I am going to suggest that you haven't actually thought about this, in which case your best be is to use Node-RED, for which there already is a range of prebuilt IOT nodes that you can use.

does MQTT API exist to send downlink to lora device?

I'm making an application to communicate with LoRa Device.
I found a guide to the REST API to send downlink.
However, i'm finding MQTT API to do.
Does it exist?
MQTT is used by applications only to consume data in real time.
Device Management action (send downlink etc) must be done by using REST API
regards
Device state notification is not yet available throuh MQTT. You can get device status using REST API. See Live Objects documentation https://liveobjects.orange-business.com/doc/html/lo_manual_v2.html#NODE_STATUS and swagger https://liveobjects.orange-business.com/swagger-ui/index.html#!/Device_management_-Interfaces-_V1/listInterfacesForADeviceUsingGET
regards

What is the major scenario to use Socket.IO

I just wonder why and for what kind of application or case we need the Socket.IO.
I am the iOS developer of a known open source project socket.IO-objc
Usually, we need HTTP or HTTPS to communicate with server. The socket aims to conduct real time communication (It should always keep a live HTTP connection.)
Libraries like socket.IO are needed when we need real-time in our app. Let me explain this in little more detail. Let's assume that you are developing a game, which is multiplayer and 2 or more users can play that simultaneously. Then, in that case, you won't be making HTTP or HTTPS calls because of many reasons and one of them is that their packet size is large and other is that these calls are very slow. In such scenarios we use libraries like sockets to send and receive data to and from the server. Sockets are really fast and are capable of sending only those data packets which are needed. Using HTTP programming you can never create any multiplayer game or any app which will be interacting with a server on a realtime basis.
Let's take another example. Let's assume that you are working on a chat application. When user A is typing something then user B should know that A is typing (similar to gtalk of facebook messenger). If you will use HTTP calls at that point of time then "B" will never be able to see the actual status of the other person because of the delay. So what we can use is sockets so that when user A is typing anything then his device will send only one data packet which will just notify the server that he is typing and will be delivered to user B, this process is really fast (almost realtime) and will reduce the data transfer also.
I'm working on chat application using socket.io also. So it seems to replacing everythings with socket.io. This is making me in doubt and curiousness. I totally agree with real-time app like chat suits for socket.io. However there is round-trip communication (such as user login) that's more suitable for HTTP.
Socket.io uses web socket to pass data among users who are all connected to a web server. With web socket, there is no negotiation protocols and connection remain open as long as users concerned are registering for service with the web server. As pointed out also, the payload is significantly less than http/https protocol.
Socket.IO is a JavaScript library for realtime web applications. It enables realtime, bi-directional communication between web clients and server. It has two parts: a client-side library that runs in the browser, and a server-side library for node.js. Both components have a nearly identical API.

How do iOS apps typically communicate with a server?

I am a Ruby on Rails developer and I have a question about iOS development.
How do iPhone applications typically interact with a server?
For example, let's say you wish to send GPS coords from the iPhone to the server to be stored or processed. How is that typically done? Is it through a typical server API (like JSON)?
Sorry for such a basic question.
EDIT: Thanks for the answers below. Now, how about pushing data from the server to the iPhone app (without a request). How is that done?
The communication format is usually XML or JSON via HTTP call, but it depends on your data you wish to communicate between server and app. You may use socket connection.
Typically, every client and server exchange information via public API's.
in iOS, we prefer, RESTful webservices that deliver JSON. (There are other options also, but we prefer this)
I'd say that the best way to ensure delivery of data to the app from the server depends on whether you know the app is running or not. Push notification can deliver payload data, albeit in small quantities, to the app and it does not matter whether it's currently running or not. It's a big subject but thats a good start.

Provide geolocation data to iOS from Windows

I'd like to use a computer using Windows 7 to provide data to an iOS device. I guess there is no way to do that by Wifi so I'd like to simulate a bluetooth GPS device on my Windows 7 computer so that the iOS device would connect to it.
My question is, what kind of data should I sent ? Can I directly send NMEA frames or should I implement another Apple protocol ? Where can I find specification on those protocol in iOS ?
The idea is to make geolocation data to be available to the whole system. Maybe by "simulating" a bluetooth external GPS receiver using a software that I would develop on Windows. So what kind of data should my Windows software send by bluetooth to iOS ? And how can it be detected by iOS as an external GPS receiver ?
Thanks.
I recommend to use bonjour.
It's a auto-connecting protocol which finds other "player" in the same subnet (lets say same "WiFi".
Theres a windows sdk written in C:
https://developer.apple.com/opensource/
How you do submit the data is up to you. You might create a JSON payload out of your GPS Data. You can also create a binary format and compress it with libz (zip) before sending it to your iOS Device through bonjour.
You can also set up a web server and a web service on your PC and simple connect to it through local network (WiFi) from your device. I think this requires the least work from both server and client side. Which format do you use (JSON, fractions of NMEA, something else) is really up to you since you will have to code both server and client side. For JSON and XML however there are a lot of free frameworks and even some SDK support on both client (iOS) and server (php, asp, servlets, etc) side.

Resources