I´m currently using the Arduino Uno Wifi (not a Wifi Shield). I want to send sensor data to an existing MySQL database, but do not really know how to do it. I found quite a lot of tutorials, but all of them use Wifi- or Ethernet-Shields and libraries like Ethernet.h or Wifi.h, which I don't need.
Isn´t there a simple way to make an SQL connection, without using any libraries which require additional hardware?
Isn´t there a simple way to make an SQL connection, without using any libraries which require additional hardware?
I think you would have a much better chance of taking the existing MySQL Connector and adapting it to work with your ethernet library. The ethernet piece is just the transport and will be conceptually the same no matter which ethernet board you use. Somebody else has already worked out the protocols for talking to a MySQL server (it's not simple), so I would start with that.
It's on github, so you can fork the repo and make your changes and then contribute it back to the community when you have it working.
yari92:
Hello,
I have the same issue. Did you found a solution? I also need to do some select queries..
Thank you.
I am actually talking to the web-server (php-script) with GET request, php-script parse the data, validate it and send to mysql server. Is this suitable for you? Select also could be done on similar way.
It is kind of aged, I did many changes since that, but still should work for you.
All you need is in function senREQ() in .ino file, this is the function used to send GET request to web-server, and in SaveArduino2.php file, this is the file which process this request. Actually, if you can read russian :-), the more detailed description (but still aged) is here: Arduino DataLogger (web-server and client), project is online, so links are accesible, but i may shut it down at any time if i need to work with it.
Hi, the problem is that i have the "Arduino Uno WiFi", which have an integrated wireless adapter.
As i could see from your sketch, you have used an Ethernet shield, which i don't have..
I think that in your case you could use mysql connector library..
Am I wrong?
yari92:
Hi, the problem is that i have the "Arduino Uno WiFi", which have an integrated wireless adapter.
As i could see from your sketch, you have used an Ethernet shield, which i don't have..
I think that in your case you could use mysql connector library..
Am I wrong?
Yes, i am using arduino uno with ethernet shield and wired connection. I do not know about mysql connector library, i've never use it and i dont want to talk directly to mysql server because mysql server is not accessible from outside of my home network, but my web server is.
SergeS:
Yes, i am using arduino uno with ethernet shield and wired connection. I do not know about mysql connector library, i've never use it and i dont want to talk directly to mysql server because mysql server is not accessible from outside of my home network, but my web server is.
Got you. Thank you for your reply.
I think that I found a working solution for me, and I share it. Don't know how it is elegant or memory efficient.. but still.. it works.
I have combined a RestClient example with Arduino Uno Wi Fi and a ArduinoJsonParser adding a php page which implements a query and replies with a JSON data.
the factory firmware of Uno WiFi and the corresponding UnoWiFiDevEd library doesn't support general networking with standard Arduino networking API like the Ethernet or WiFi library.
you can change the firmware of the Uno WiFi to WiFi link and use the WiFi Link library which is easy to port to from Ethernet library.