Moderator: Mmiscool
Found this project and might be able to use its library but would require some research. Not to familiar with mySQL at the moment. I do believe it would be a valuable addition and if some one who is familiar with how to do this from the esp arduino side of the world wanted to contribute any code I would be happy to integrate it.
I believe it would require at least 3 or 4 commands. 1 for set up such as server address, port number, user name and password. 1 for writing. 1 for reading. and one for doing a query to search for a particular piece of information. If any one has been doing this I would be keen to see how and to attempt to integrate some code in.
https://github.com/MD4N1/Wiz550io-Tutor ... ster/mysql
http://esp8266basic.com
A BASIC interpreter for your ESP
Working now on Autodrop3d. A 3d printer with automatic part ejection system. https://autodrop3d.com
What they are would be possibly file lists and such...
I'm not 100% a mysql guru either but while this may be a VERY BAD assumption I would assume that you could control a remote database somehow with PHP at current or possibly a local one say on an oragnepi or a raspberry pi maybe on your LAN.
This would likely be the best option with mysql as it is resource intense...
However, I am curious there are other things available..
For instance java I believe has its own database system... And you can use xml to store data to I would assume also I wonder if somehow we could use csv files or other files...
There is likely a lightweight option that already works but I agree it would be nice to see someones implementation of storing data in a database or list or structure that resembles a database with the esp this could be rather useful. I don't exactly suggest trying to run a full blown database on the nodemcu while it may be possible I dunno how well it would actually work heck it may work just fine but I suspect for some odd reason we may just be asking for problems maybe but then again this is just a guess never know until you try I suppose.
I still would indeed love to see someones implementation of storing values to a file and later accessing those values to preform work it would be a great example to have and a real door opener for the community I believe.
Where I buy my ESP8266 boards from... (Banggood)
You'll need an own (hosted) server where php & MySQL is running plus a database & zable. For examples just google for "php & MySQL". There are ton's...
On the ESP-side just use
wget(yourdomain.com/examples/myscript.php?name=Peter&age=25)
which calls this example:
<?
$host = "MyDBServer.com";
$db = "dbname";
$user = "user";
$pw = "password";
$con = mysql_connect($host,$user,$pw) or die(mysql_error());
mysql_select_db($db) or die(mysql_error());
mysql_query("SET CHARACTER SET utf8");
mysql_query("SET NAMES 'utf8'");
$name = $_GET["name"];
$age = $_GET["age"];
$res = mysql_query("Insert into Persons (name, age) VALUES ('$name', $age)");
print ("I have inserted $name and $age in my table");
?>
Note: Change mysql to mysqli in the script (servers which use MariaDB have slightly other sql-commands