我尝试创建一个干舷仪表板。我有一个带有四个传感器的Arduino,它们通过mqtt发送信息。所以,我在Node-RED上生成了一个JSON来响应请求/ saida。
[{"id":"3f699b5.c91f064","type":"http response","z":"c7d4e8c8.509218","name":"","x":1184,"y":589,"wires":[]},{"id":"a3ed6250.1d64","type":"json","z":"c7d4e8c8.509218","name":"","x":1120.5,"y":540,"wires":[["3f699b5.c91f064"]]},{"id":"971f41c1.a1265","type":"function","z":"c7d4e8c8.509218","name":"","func":"msg.payload = {\"temperatura\":\"25\"}\nreturn msg;","outputs":1,"noerr":0,"x":1015.5,"y":584,"wires":[["a3ed6250.1d64"]]},{"id":"ed9f7a2a.604728","type":"http in","z":"c7d4e8c8.509218","name":"http in","url":"/saida","method":"get","swaggerDoc":"","x":850,"y":582,"wires":[["5b40d38c.5cc7ec","971f41c1.a1265"]]}]
在这一刻,我使用静态JSON进行测试。我有一个使用主机像:
my-public-host:1880/saida -> {"temperatura":"25"}
我通过代理访问它,JSON返回ok。在ping.eu端口检查,端口是打开的。我确保我的主人是公开的。
但是在我的干舷上,我将其添加为数据源,然后它说“从不”更新,我无法读取JSON信息。
我应该怎么做才能解决它?
答案 0 :(得分:2)
我解决了我的问题。
freeboard.io中存在错误。 thingproxy.freeboard.io不起作用。浏览器不允许freeboard.io对其他不是https的链接发出AJAX请求。此外,浏览器不允许为其他主机发出AJAX请求。
有两种解决方案:
再见!
答案 1 :(得分:0)