基于internet的机器人和电子设备控制平台
ior-research的Python项目详细描述
物联网客户端-python
物联网正在席卷全球,许多电子设备通过网络连接在一起并相互通信。 我已经建立了一个应用程序,帮助你连接这些微控制器在一起。以下是客户的详细信息。
在进一步研究这个项目之前,您可以在Project Website
目前已在以下地点进行了测试: Arduino,乐高Mindstroms EV3砖和覆盆子皮3 其他的测试正在进行中。
这是python客户端的git存储库:
安装
运行以下命令
pip install --upgrade ior-research
用法
token = "paste your subscription key here"
code = int("current device code here")
to = int("Destiation device code here")
time_delay = 90 # Time delay for the heart beat (in seconds) default is 90 seconds
创建物联网客户端实例
from ior_research.IOTClient import IOTClient
iot = IOTClient(from = code,to=to,token=token) #Creating object for IOT Client
设置接收功能,以便在接收到响应时执行某些操作。
iot.set_on_receive(lambda x: print(x))
最后但并非最不重要的是启动物联网客户端
iot.start()
iot.join() #Since IOTClient inherites Thread Class you can also use .join() function depending on your use case