如何将arduino传感器数据发送到SQL服务器? [英] How do I send arduino sensor data to SQL server ?

查看:421
本文介绍了如何将arduino传感器数据发送到SQL服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在研究基于Arduino的家庭自动化系统。我想将Arduino传感器数据发送到SQL服务器,但我不知道如何。



我问的是,如果有人读到这个有任何关于我如何的建议可以去做这件事。



我尝试了什么:



Youtube,Stack OverFlow和Arduino论坛。

Hi, I am currently working on a Arduino based home automation system. I want to send Arduino sensor data to a SQL server, but I do not know how.

All I ask is if anyone who reads this has any suggestions on how I can go about doing this.

What I have tried:

Youtube, Stack OverFlow and Arduino Forums.

推荐答案

引用:

我想要将Arduino传感器数据发送到SQL服务器,但我不知道如何。

I want to send Arduino sensor data to a SQL server, but I do not know how.



我猜你是初学者,因为你和每个初学者都犯了同样的错误。

建议:学会用小/更简单的部分来解决你的问题。

你没有一个复杂的问题,你有一些简单的问题。

你需要什么:

- 要学习如何读取数据传感器,原理是一样的,无论你用这些数据做什么。

- 学习如何连接到SQL服务器和trow订单,原则是一样的,无论数据来自何方。

- 如何编写一些胶水代码将所有内容放在一起。 胶水代码 - 维基百科 [ ^ ]



如果您确定Google的问题,那么您几乎没有答案。

但是如果你谷歌每个简单的问题,你会有很多答案,因为这些问题是通用的。


I guess you are a beginner because you do the same mistake as every beginner.
Advice: Learn to break your problems in small/simpler parts.
You don't have a single complicated problem, you have a few simple ones.
you need:
- to learn how to read data sensors, the principle is the same, whatever you do with that data.
- to learn how to connect to SQL server and trow orders, the principle is the same, whatever data come from.
- how to write some glue code to put everything together. Glue code - Wikipedia[^]

If you Google for your exact problem, you will have almost no answer.
But if you Google each simple problems, you will have heaps of answer because those problems are universal.


你最需要的是C ++的SQL客户端库。你使用哪一个主要取决于你将使用什么类型的数据库服务器。



一旦你得到它...你只需要连接到数据库并执行您想要的操作
What you most likely need will be a SQL client library for C++. Which one you use is going to depend mostly on what type of DB server you are going to be using.

Once you get that in... you just need to connect to the DB and do what you want


据我所知,没有库可以从Arduino连接到SQL Server。



您必须编写一个WebApi应用程序,在服务器上运行它,这是SQL Server和Arduino之间的网关。 Arduino可以拨打网络电话api。



Google以Arduino webapi为例。
As far as I know, there is no library to connect to an SQL Server from Arduino.

You would have to write a WebApi app, run that on a server, and that is your gateway between the SQL Server and the Arduino. The Arduino can make calls to a web api.

Google for "Arduino webapi" for examples.


这篇关于如何将arduino传感器数据发送到SQL服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆