Arduino Yun - Uploading Sensor Data to Mysql on External Server - mysql

Can Arduino Yun connect to MYSQL on External Server and store sensor data on it. If yes how?.

Technically you can.
You could write or port a mysql driver to the Arduino, but the small amount of memory and process power will make that no very easy.
With the Yún you could also install some libraries and program an app running on the linux side that forwards incoming data from the serial to your mysql database.
An other option:
Use an intermediary app to save incoming data to your database. The interface could be a typical HTTP API or via a publish/subscribe broker.
For simplicity I would recommend to go for option three.

Related

Delphi existing application connect to cloud

I have my application in Delphi with MySQL as a database. This is a Desktop application with local Database connected using ADO components.
I have another web application done in PHP and MYSQL.
I want to merge both databases and connect the Delphi application to the cloud MySQL database.
Do I need to put all my logic in PHP scripts and access them from Delphi?
How Delphi to cloud connection can be established?
You can use FireDAC to connect to a database located in the cloud, as soon as your provider allows that connectivity.
But exposing you database to the internet is not the best secure architecture. As you suggest yourself with naming it, a much better architecture is REST. The idea is to write server side software - could be PHP - to accept REST requests from a client, execute it (access the database) and send a reply to the client.
Today's, the REST requests are frequently using JSON to pass requests and receive replies. JSON is supported by Delphi. In short, this is an ASCII representation for object properties.
If accessing the database directly is what you really want, look at this video by Stephen Ball showing how to access an MS-SQL database on Azure cloud. This would be pretty well the same with mySQL.

Database synchronization?

I have a small problem, I am working on a project where I need to synchronize the databases to maintain the same data at diff locations, all have their own database the structure of all the database,tables,stored procedures,etc are the same. i.e. they are the copy of a single database but data is entered from different locations and I need to have data to be synchronized so that we can see the data from anywhere, will creating a windows service work?
C# code will be a nice help.
You can do this by two ways .....
1st way using combination of services
i) W CF Service with windows service Or Web service with Windows Service.
you will need a windows service which is installed on every client machince which will check the new data in local db and send that data to web or wcf service which will be installed on Server Machine for LAN.
but if client is on network then web service or w cf service should be on Static IP Address where Server Database is installed
and if client is offline in some case then u should use MSMQ or Rabbit MQ or any queuing mechanism for that ...to handle such case..
2nd way is using Replication in in sq l server 2008 go through this links:
http://www.codeproject.com/Articles/215093/Replication-in-MS-SQL-Server
http://www.informit.com/guides/content.aspx?g=sqlserver&seqNum=313) Database syncronization
Replication is what you need I guess, let SQL manage where you dont have write any code and is easy to configure.
have a look at http://www.codeproject.com/Articles/215093/Replication-in-MS-SQL-Server , or type SQL replication and there are loads of material available.

phonegap external storage

I am using phonegap to make iphone and android apps. I need to be able to store data on a mysql database on my server as well as use my websocket server.
How can I go about doing this as the app will be running on local html and javascript files which cant run ajax/websocket requests on external servers?
So let me convert my comments into an answer.
You need a client-server architecture, where the clients will be all your end devices. The server in this case needs to be a globally reachable host somewhere (Amazon cloud, perhaps?).
Your device will send updates to the backend server that has a connection to your database, using ajax calls. These updates will be stored on the server.
All your other clients need to periodically poll the same backend server using ajax, and will get the updates sent from your primary device.

Networked CUDA GPU

Is it possible for multiple low-end computers to each make CUDA calls to a GPU located on a central server in a request/response over the cloud scenario? To make it as if these low-end computers possess a "virtual" GPU.
I had a similiar problem to solve.
The database was living in the low end machine and I had a cluster of GPUs in my disposal on the local network.
I made a small client (on the low end machine) to parse the database, serialize the data with google protocol buffers and send them to the server with zmq sockets. For data distribution you can have asynchrouns publisher/subscriber sockets.
On the server side you deserialize the data and you have the CUDA program to run the calculations (it can also be a daemonized application so you dont have to fire it up yourself every time).
Once the data is ready on the server you can issue a synchronous message (request/reply socket) from the client and when the server receives the message it calls a function wrapper to the CUDA kernel.
If you need to process the results back on the client you can follow the reverse route to send the data back to the client.
If the data is already in the server, its even easier. You only need the request/reply socket to send a message and call the function.
Check the zmq manual, they have a lot of examples in many programming languages.

how to connect mysql server on external server in j2me application

I have a hosting account at godaddy ruinning Linux. Is has MySQL. I am creating a J2ME application that runs on android and I was wondering if there is any simpler way to connect from j2me application to my MySQL server?
Is it required to install anything at my server? which I cannot do because of the shared account. Any way to just open the connection, update some data in the MySQL from j2me application?
It is quite simple. You just need to do HTTP application/x-url-form-encoded request on the midlet and set request property to HTTP.POST. Then stream form data as bytes. Receive those post variable using a server side language (i used PHP) like $_POST['var'] and in that server script write MySQL query like insert into .. VALUES.. etc.
I don't know if any DB drivers exist for J2ME. If you can't find them just make layer on the server and implement your own protocol for retrieving data via http or sockets