在线Demo:https://mqtt.phodal.com
吊兰diaonan是一个在线的物联网测试平台,你可以用他来测试你的物联网设备。网页上创建一个节点,然后你就可以用MQTT,REST,CoAP来测试你的硬件代码。REST示例如下所示:
安装1.安装redis
sudo apt-get install redis-serveror
sudo yum install redis-server2.安装依赖
sudo npm install3.Server
node diaonan.js简介REST示例如下所示:
$ curl -X PUT -d '{ "dream": 1 }' \-H "Content-Type: application/json" \https://mqtt.phodal.com/topics/lettuce$ curl https://mqtt.phodal.com/topics/lettuce{ "dream": 1 }Mosquitto示例
mosquitto_pub -h mqtt.phodal.com -d -t lettuce -m "Hello, MQTT. This is my first message."PythonMQTT示例:
import mosquittomqttc = mosquitto.Mosquitto("python_pub")mqttc.connect("mqtt.phodal.com", 1883, 60, True)mqttc.publish("lettuce", "Hello, World!")CoAPGET示例:
coap-client -m get coap://mqtt.phodal.com:5683/topics/zeroCoAPPOST示例
echo -n 'hello world' | coap post coap://mqtt.phodal.com/topics/zeroecho -n '{"lettuce": 123}' | coap post coap://mqtt.phodal.com/topics/zero让我们用MQTT,REST,CoAP做一些有趣的事!
Arduino示例见https://gist.github.com/phodal/fd1be9ea3cc13cd48ffa
协议支持MQTT
HTTPGET/POST
WebSocket
CoAP
支持设备Arduino
8051/51Family
RaspberryPi
PCduino
STM32
ARM
AndroidDevices
iOSDevices
WindowsPhoneDevices
...
评论