将 Android 手机连接到 WiFly 开发板
我和我的团队正在尝试将 Android 手机连接到 WiFly 板。我们无法连接此设备。是否某些手机不支持此功能或支持此功能?我们必须做什么才能执行此连接?
我们已经尝试了一些方法,但仍然不起作用。如果您需要更多信息,请告诉我。
My team and I are trying to connect an Android phone to the WiFly board. We are having trouble getting this to connect. Is it that certain phones that do not support this or do support this functionality and what must we do to be able to perform this connection?
We have tried a few things, and it is still not working. If you need further information let me know.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
我有一个基于 WiFly 模块的项目,并成功开发了一个应用程序,该应用程序通过 wifi 网络与模块建立 tcp 和 udp 连接。不,我不需要将手机创建为接入点。我可以使用无线路由器作为接入点,从手机与 WiFly 进行通信。我还可以让它进入命令模式,以便我可以编辑其配置。如果您仍在寻找可行的解决方案,我很乐意为您提供我的代码。
编辑:下面是我制作的应用程序的完整代码。它已用于在家庭自动化项目中连接到 WiFly。
MainActivity
这是创建一个 tcp 客户端与 WiFly 通信的类,
希望这对将来的人有帮助。该代码适用于所有 TCP 服务器,而不仅仅是 WiFly。
I've had a project based on WiFly module and have successfully developed an app that makes a tcp as well as udp connections with the module over the wifi network. No, i didn't need to create my phone as an access point. I can communicate from my phone to WiFly with a wireless router as access point. I could also make it enter command mode so that I can edit its configuration. If you are still searching for a viable solution, I would be happy to provide you with my code.
EDIT: Below is the entire code for the app i made. It has been used to connect to WiFly in a Home Automation project.
The MainActivity
And this is the class the creates a tcp client to communicate with WiFly
Hope this help somebody in future. The code is applicable to all tcp servers and not just WiFly in particular.
如果问题出在基础设施(接入点的客户端)与临时(点对点)无线网络模式之间,我不会感到惊讶。
最简单的方法是如果您有两个设备都可以连接的接入点。直接连接它们可能会有点困难,因为您必须让两者都在临时模式下工作,或者必须愿意使用接入点。
I wouldn't be surprised if the problem is with infrastructure (clients of an access point) vs. ad-hoc (peer-to-peer) wireless networking modes.
The easiest would be if you have an access point that both devices can connect to. Directly connecting them may be a bit harder, as you have to either get both working in ad-hoc mode or one has to be willing to play access point.
我们已经找到了这个问题的解决方案。我们让手机充当接入点,并将 WiFly 板连接到手机。我们通过将 WiFly 板连接到手机并将笔记本电脑连接到手机来对此进行测试。然后我们导航到 WiFly 板上的默认网页,我们能够看到该页面。这看起来效果很好,可以解决我们的问题。但是,这会更快地耗尽手机电池。
We have found a solution for this issue. We are making the phone act as an access point and having the WiFly board connect to the phone. We tested this by having the WiFly board connected to the phone and had a laptop connect to the phone. We then navigated to the default webpage that is on the WiFly board and we were able to see the page. This seems to be working well and will solve our problem. However, this will drain the phones battery quicker.
有关不需要 root 的替代解决方案,请参阅 这个。
For an alternate solution not requiring root, see this.