ChuckBell / MySQL_Connector_Arduino

Database connector library for using MySQL with your Arduino projects.
331 stars 132 forks source link

MySQL Connector Serial #119

Closed ivaring closed 2 years ago

ivaring commented 4 years ago

Hi everybody,

would it be possible to get data from Arduino to a MySQL Server installed on a Raspberry, through serial wire instead of having an Ethernet Shield on Arduino?, thanks.

ChuckBell commented 4 years ago

Yes, it can be done but not using the library. Google for examples. I’ve seen and written some in Python but in those cases I used Connector/Python on the Raspberry Pi.

In short, you will pass the data in raw form to the process running on the Pi then use C/Python to insert it into MySQL. That’s just one example.

On Tue, Jan 14, 2020 at 15:11 ivaring notifications@github.com wrote:

Hi everybody,

would it be possible to get data from Arduino to a MySQL Server on a Raspberry, through serial wire instead of having an Ethernet Shield on Arduino?, thanks.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ChuckBell/MySQL_Connector_Arduino/issues/119?email_source=notifications&email_token=AB6SHYHVXEAHKSLU5D5224DQ5YL67A5CNFSM4KGY3OJ2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IGFE3RA, or unsubscribe https://github.com/notifications/unsubscribe-auth/AB6SHYC3ZRZDIOOPREGLFJTQ5YL67ANCNFSM4KGY3OJQ .

ivaring commented 4 years ago

Thank you very much Dr. Bell, I've seen Python Connector indeed. I'll try googling more, kind regards.

ivaring commented 4 years ago

raspberry Good afternoon, I stop trying connecting by serial wanting to avoid other connectors, however, I tried always using Ethernet connection to a Raspberry Pi3 connected also to an Ethernet port, same sketch on Arduino is working for a Windows based phpmyadmin mysql server. In the other hand, Raspberry mysql server isn't working, I always get "connection failed", the only difference I believ I found regards server type on both machines, Windows based server 127.0.0.1 via TCP/IP instead in Raspberry based server localhost via UNIX socket, can be this the problem?, thanks in advance.

ivaring commented 4 years ago

I've just tried again with all devices conneced by Ethernet, but the problem is still the same, connection failed, I'm able to access to webserver from other PC on the same network, but using sketch basic_insert with some updates I still get connection failed. The same sketch is working with same configuration mysql (but installed on Windows with XAMMP). I think the problem may be on Connection type Localhost via UNIX socket

ivaring commented 4 years ago

Update. Problem solved, it was a question of IP address not UNIX socket or else. MariaDB is using by default only bind-address 127.0.0.1 in its configuration file, in my case 50-server.cnf so changing IP address by 0.0.0.0 allows connection from every host in the net (for example), thanks for your valuable help.

Pra3t0r5 commented 4 years ago

Update. Problem solved, it was a question of IP address not UNIX socket or else. MariaDB is using by default only bind-address 127.0.0.1 in its configuration file, in my case 50-server.cnf so changing IP address by 0.0.0.0 allows connection from every host in the net (for example), thanks for your valuable help.

I'm having the exact same issue, where did you changed the IP?