使用 Arduino GSM/GPRS 扩展板将数据发送到我的网络服务
我知道如何使用 GSM/GPRS shield 拨打电话和发送短信 Arduino Uno。但我在 http://mydomain.com/rest/receiveSensorData
位置有一个 Web 服务,并且我想使用 GSM/GPRS 屏蔽将传感器数据发送到此 URL,因为我不能指望操作地点有 Wi-Fi。 这是盾牌我有,我也有3G SIM 卡,并在 Arduino Uno 上运行。
我该怎么做?
I know how to make calls and send SMSes using a GSM/GPRS shield for Arduino Uno. But I have a web service at the location http://mydomain.com/rest/receiveSensorData
, and I want to send sensor data to this URL using a GSM/GPRS shield because I can not count on Wi-Fi being present at the operating locations. This is the shield I have, and I also have a 3G SIM card and am running on an Arduino Uno.
How do I do this?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可能已经开始工作,但以防万一:
在我的设置中,我使用的是使用 Sim900 模块的 Seeed Quad Band GPRS Shield。在查看了您的规格后,我相信此代码也适用于您的代码。
只需将“epc.tmobile.com”更改为您的运营商的 apn,将“YOUR.DOMAIN.COM”更改为您的服务器信息,并将“sensorval1=blah”更改为您的变量和传感器数据。
如果你能做到这一点,请告诉我。我可以帮你弄清楚,这并不难。
祝你好运。
You probably already got this working but just in case:
In my setup I'm using the Seeed Quad Band GPRS Shield that uses the Sim900 module. I believe this code will work with yours as well after looking at the specs for yours.
Just change "epc.tmobile.com" to the apn for your carrier and "YOUR.DOMAIN.COM" to your server info and change the "sensorval1=blah" to your variable and sensor data.
Let me know if you get this working or not. I can help you figure it out it's not too hard.
Good Luck.
如果数据很小并且您向 Web 应用程序添加了接收 SMS 信息的功能,那么实际上继续发送 SMS 可能会更容易。
请参阅以下问题的答案,特别是第一个建议的问题的答案: http://www.twilio.com/短信/:
在网络中接收 SMS 消息在美国托管服务器上的应用程序
使用 SMS 的一个优点是,它可以节省盾牌必须建立 GPRS 连接的时间,这通常会花费更长的时间,并且可能会消耗更多的电量。需要注意的一个缺点是 SMS 不是一种有保证的消息传递系统,尽管如果您愿意,您可以在 SMS 之上构建某种确认。
顺便说一句,拥有 3G SIM 卡将无法让您在 GPRS 调制解调器上使用 3G,除非调制解调器也支持 3G。
It might actually be easier to keep sending SMS if the data is small and you add the ability to receive SMS info to your web application.
See the answers to the following question in particular the first one which suggests: http://www.twilio.com/sms/:
Receive SMS messages in a web application in the US on a hosted server
One advantage of using SMS is that it will save the shield having to set up a GPRS connection which will generally take longer and may use more power. One disadvantage, to be aware of is that SMS is not a guaranteed messaging system, although you could build some sort of acknowledgment on top of SMS if you wanted.
As an aside, having a 3G SIM will not enable you to use 3G on a GPRS modem unless the modem also supports 3G.