如何在 iPhone 和 Arduino+Bluetooth Mate 之间创建蓝牙串行连接?
我有一个项目,需要我的 iPhone 与 Arduino 进行通信。蓝牙似乎是通信的最佳选择。我应该如何对我的 iPhone 进行编程(什么框架?)以与蓝牙伴侣进行通信,或者 Apple 的限制是否阻止了这种情况?越狱的 iPhone 可以吗?除了蓝牙还有更好的方式吗?示例代码会很有帮助。
提前致谢
I have a project where I need my iPhone to communicate with an Arduino. Bluetooth seems like the best option for the communication. How should I program my iPhone (what framework?) to communicate with the Bluetooth Mate or do Apple's restrictions prevent this? Is it possible with a jailbroken iPhone? Is there a better way other than Bluetooth? Sample code would be helpful.
Thanks in advance
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
实际上,您现在就可以实现这一目标,无需越狱或 MFi 注册。
查看较新 iOS 设备中的蓝牙 4.0 和 Arduino BT 4.0 扩展板。
这可能会有所帮助: http ://blog.makezine.com/2012/03/19/bluetooth-4-0-from-arduino-to-iphone-no-jailwriting-no-mfi/
Actually you can make it happen now without Jailbreaking or MFi enrollment.
Take a look ate Bluetooth 4.0 in newer iOS devices and Arduino BT 4.0 shield.
This might help: http://blog.makezine.com/2012/03/19/bluetooth-4-0-from-arduino-to-iphone-no-jailbreaking-no-mfi/
同时,Seeedstudio 提供了 Arduino 扩展板:蓝牙低功耗 遵循蓝牙 4.0 规范的Shield
设备可以由运行 iOS 6 且内置蓝牙 4.0 芯片的所有 iPhone/iPad 型号(目前为 iPhone 4S、5 和 iPad 3)访问。您不再需要成为MFI 对设备进行编程或越狱可用于大多数用途。使用也讨论过的核心蓝牙框架 WWDC 2012 视频核心蓝牙 101(核心操作系统) 和高级核心蓝牙(核心操作系统)。
Meanwhile there is an Arduino shield available from Seeedstudio: Bluetooth Low Energy Shield
Devices following the Bluetooth 4.0 specification can be accessed by all iPhone/iPad models with a Bluetooth 4.0 chip inside (currently iPhone 4S, 5 and iPad 3) running with iOS 6. You no longer need to be part of the MFI program or jailbreak the device for most purposes. Use the Core Bluetooth Framework that's also discussed in the WWDC 2012 videos Core Bluetooth 101 (Core OS) and Advanced Core Bluetooth (Core OS).
自从我接触嵌入式蓝牙转 iPhone 设备以来已经有一段时间了,但据我记得你必须从苹果购买身份验证芯片。
Apple MFi
但由于越狱是一种选择,这可能会起作用。但我从来没有尝试过,因为我曾经拥有过一些认证芯片。
我通过快速谷歌搜索找到了btstack,也许它有帮助。
It's been a while since I was in contact with embedded bluetooth-to-iphone devices, but as far as I remember you have to buy authentication chips from apple.
Apple MFi
But as jailbreak is an option this might work. But I never tried this, because I once was in possession of some authentication chips.
I found btstack with a quick googling, maybe it's helpful.
尝试安装蓝牙 iBlueNova,它将与每个设备进行通信。
Try instaling bluetoth iBlueNova, and it will comunicate with each device.
是的,最好的方法是使用 Blynk。注册一个帐户,复制示例代码,然后开始使用 Blynk 应用程序!
Yes, the best way to do this would be to use Blynk. Make an account, copy the example code, and get started with the Blynk app!
Apple 的操作系统应用程序沙箱会阻止普通(经典非 BLE)蓝牙串行数据通信在现有操作系统设备上进行,但在其 MFi 计划中注册的少数公司除外。
Apple's OS app sandbox prevents generic (Classic non-BLE) Bluetooth serial data comm on stock OS devices, except for a few companies registered in their MFi program.
最可靠并且可能是最简单的解决方案是使用 Arduino 以太网扩展板以及与 WiFi 路由器的物理网络连接。 Arduino 将托管网页或直接响应为您完成工作的 http。
无需越狱,无需 BT 编程,无需串行 com 端口。只是普通的旧网页。甜蜜的东西。
最简单的解决方案是使用网络上的任何浏览器(包括 iPhone)导航到 Arduino 并发出命令。
示例:
192.168.1.101 = 你的 Arduino 的 IP
?1 意味着 PIN13 拉高(即打开 LED)
你的代码将类似于:
该代码又快又脏,所以不要拿它来反对我!
让我知道您的决定以及结果如何。我需要去阅读
谢谢对于该链接 ygbr!
The most reliable and possibly the easiest solution is to the use the Arduino Ethernet shield with a physical network connection to your WiFi router. The Arduino would host web pages or respond directly to http that did your work for you.
No jailbreaking, no BT programming, no serial com port stuff. Just regular old web pages. Sweet stuff.
The simplest solution would be to navigate with any browser on your network, including your iPhone, to your Arduino and issues commands.
Example:
192.168.1.101 = the IP of your Arduino
?1 would mean PIN13 pulled high (i.e. turn on the LED)
Your code would be something like:
That code is quick and dirty so don't hold it against me!
Let me know what you decide and how it works out. I need to go read up on http://blog.makezine.com/2012/03/19/bluetooth-4-0-from-arduino-to-iphone-no-jailbreaking-no-mfi/
Thanks for that link ygbr!