Go Down

Topic: Which arduino and parts should I buy?  (Read 417 times) previous topic - next topic

Titus_Song

I am a new user, if I want to use arduion to connect SQL database of my PC  by wireless,Which arduino and parts  should I buy?   

PaulRB

#1
Jan 13, 2018, 11:26 am Last Edit: Jan 13, 2018, 11:30 am by PaulRB
(I have requested the moderators move this thread to Project Guidance)

There are many kinds of SQL databases. Can you be more specific? Do you have LAMP or WAMP installed on the pc? What else will the Arduino be doing? What data will it send to the database?

My recommendation at this point would be Wemos Mini. They are small, inexpensive, easy to use and has WiFi built in.

Titus_Song

(I have requested the moderators move this thread to Project Guidance)

There are many kinds of SQL databases. Can you be more specific? Do you have LAMP or WAMP installed on the pc? What else will the Arduino be doing? What data will it send to the database?

My recommendation at this point would be Wemos Mini. They are small, inexpensive, easy to use and has WiFi built in.
Thanks for your reply,  I have not built any kind of SQL database now. Before I choose database,  I want to know whether Arduino can write data to any kind database directly, rather than I need to build a app in my PC to write data to database. I will choose database after choosing Arduino.
Arduino will get temperature data from sensor, I hope it can write temperature data to database of my PC directly by wireless, so I need not to build a PC app to write data to database after Arduino sends data to PC.
Best regards.

     

quamikazee

I am a new user, if I want to use arduion to connect SQL database of my PC  by wireless,Which arduino and parts  should I buy?   
You can use an Arduino UNO, an ESP8266-01 and I like the DHT-22 because it's just as inexpensive and a little more accurate (in theory)

Connecting to your database will be the challenge.

I only know how to do it via internet protocol (http) but there's ways to do it via Serial Im sure.
However, since you mentioned WiFi, you'll need a way for your PC to "serve" information to your WiFi module.

I set up a MySQL (because it's free) server on my PC and I use Coldfusion, but there are many other ways to do it.

You can also (Much more easily) connect to ThinkSpeak and send your data there where you can view it in graphs or download the RAW data for use on your PC etc.

quamikazee

Also, you don't HAVE to write data to a database unless you want to.

Because you can write data to a Data Logger that interfaces with the Arduino and can write the data to an SD card.   Then you could pop the SD card out and upload the data into a spreadsheet for example.

Robin2

I want to know whether Arduino can write data to any kind database directly, rather than I need to build a app in my PC to write data to database.
An Arduino cannot write directly to any file on a PC. There must be a program running on the PC to receive the data from the Arduino and save it to the file. Whether it is saving it to a file for an SQL database or any other sort of file, there still needs to be a PC program.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

PaulRB

#6
Jan 14, 2018, 07:43 pm Last Edit: Jan 14, 2018, 07:49 pm by PaulRB
If you install LAMP/WAMP on your PC, this includes the MySQL database. There is an Arduino library that can connect directly to a MySQL database and store data into the database (the "M" in LAMP stands for MySQL). Alternatively,  the Arduino can send an http GET or POST request to the PC. A short PHP script on the PC can receive these requests and perform the database update (the "P" in LAMP stands for PHP, which is a scripting language).

Robin2

There is an Arduino library that can connect directly to a MySQL database and store data into the database
Does it use WiFi or a serial connection, perhaps using Bluetooth?

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

PaulRB

#8
Jan 14, 2018, 10:32 pm Last Edit: Jan 14, 2018, 10:37 pm by PaulRB
Does it use WiFi or a serial connection, perhaps using Bluetooth?
WiFi, yes. Serial/bluetooth... perhaps, I don't know.

(Being pedantic, WiFi is also a type of serial connection. The bits are sent at high speed, but they are still sent one-at-a-time!)

Robin2

(Being pedantic, WiFi is also a type of serial connection. The bits are sent at high speed, but they are still sent one-at-a-time!)
I'm not sure that pedantry helps the OP.

To be honest, saying that it uses WiFi is not a lot of help either. How about giving the OP a link to the documentation for the system that you have in mind.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

wvmarle

For the processor: ESP8266. Look into the NodeMCU and WeMOS development boards, very convenient. Work great with the Arduino IDE.

That takes care of reading the DHT22 and the WiFi.

Then you install the MySQL connector library, and you can talk directly to a MySQL database on your PC over the Internet (that MySQL server can be anywhere; my systems at home talk to my external cloud server just fine).

(the "P" in LAMP stands for PHP, which is a scripting language).
Or Python, in my case (with the mod_python module to connect it to Apache). I don't speak PHP, and what I've seen of it, it makes web pages an intangible mess.
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Titus_Song

If you install LAMP/WAMP on your PC, this includes the MySQL database. There is an Arduino library that can connect directly to a MySQL database and store data into the database (the "M" in LAMP stands for MySQL).).
About the Arduino library that can connect directly to a MySQL database,   How can I get it?
In fact, i just got a old Arduino mega 2560 from my friend to study first step, I do not know what more should buy and download for my project .   

wvmarle

About the Arduino library that can connect directly to a MySQL database,   How can I get it?
I gave you the name already.... as your Google-fu (or reading) skills appear lacking, hereby the link. Just install this: https://github.com/ChuckBell/MySQL_Connector_Arduino
Quality of answers is related to the quality of questions. Good questions will get good answers. Useless answers are a sign of a poor question.

Robin2

Another option is to connect the Arduino to the PC using a serial link over Bluetooth and a Python program on the PC using the Python peewee library to access the SQL database. If you don't have any particular prefernces the SQLite database is very easy to implement.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Titus_Song

I gave you the name already.... as your Google-fu (or reading) skills appear lacking, hereby the link. Just install this: https://github.com/ChuckBell/MySQL_Connector_Arduino
Thank you for your shaing, I am going to study first step of my project!

Go Up