Imagine ... a MySql client lib for Arduino

In my personal book of desires, there is a Mysql client library for Arduino.
At this moment it seems too big to fit into the small memory space.
There are libs for processing but they requires more resources than are currently available for arduino.
Mysql Lib+Ethernet capabilities at a price around 50 usd.
Am I a dreamer ?

brunialti:
Am I a dreamer ?

Probably.

Lets step back. What is it you are trying to do? What part do you want to run on the Arduino and why? Is it where you are querying a remote database for a particular slice of the data? Or do you have some sort of physical sensors that you want to wake up every so often, record the current values, and ship them off to the database. Note that due to the speed of the Arduino and memory constraints, you will be limited to a small screen.

I suspect what you want to do is not do mysql on the Arduino itself, but instead talk to a custom client on the server (or a secondary pc) that you can send or receive the information you want on the Arduino, and the custom client does all of the interfacing to mysql.

If you just want a cheap system to do mysql, get a used PC and monitor from goodwill or similar recycling centers.

There are lots of way to communicate with a client on a unix system from Arduino (of course I'm not interested in "doing some Mysql" on Arduino). That is not the point. I would like to directly store data on a remote db from arduino, without any intermediate client on mysql server, nor php dispatcher or similar tricks.

What I would suggest then is writing your client in C/C++ on your development system to do what ever query/update you want, bypassing the MySql libraries, and instead going for doing the raw packet formation directly in C/C++ (which is what you are going to have to do on the Arduino), and display the output using text writes.

Once you have the program working, look at the code and data/bss size of the program (under Linux use the 'size' command). If the size is more than about 16K (kilobytes, not megabytes or gigabytes) of text, then you probably will not be able to use an Uno (figure that the different processors have different number of instructions, so I used 1/2 of the uno memory). Similarly if it is more than 128K of text, then it won't fit in a Mega. Likewise look at the data, and if it more than 1.5K for Uno, or 7K for Mega, it just won't fit.

I suspect you would better off with one of the Arm processors (mbed, beaglebone, rasperberry-pi), but it may be with a shoehorn and careful programming, you might be able to fit it in an Arduino.

I'm quite sure it is not possible to fit a client to arduino. I saw clients writen in processing language and they are quite bigger than the available memory in arduino. May be it could be possible to write a downsized library able only to write to a Mysql table. It would require only socket connection and some good knowledge of MySql protocol (that I at this moment have not). Should some one be interested to the challenge I would be glad to test it :slight_smile:

May be I need to wait for Due in order to get enough resources.

http://forge.mysql.com/wiki/MySQL_Internals_ClientServer_Protocol

brunialti:
May be I need to wait for Due in order to get enough resources.

The Due will only have 40k of RAM.

The INSERT command should not waste lot of it. In the command protocol the header are few bytes compared to the command payload.
p.s. I knew Due should have 50k. But this information is quite old.