1
我的GET請求出現問題。帶有NodeMCU的ESP8266。我在Arduino的代碼:GET請求從Arduino到Lua(ESP8266)
String cmd = "conn:send(\"GET /json.htm?type=command¶m=udevice&idx=2&nvalue=0&svalue=11 HTTP/1.1\r\nHost: 192.168.0.101\r\nConnection: keep-alive\r\nAccept: */*\r\n\r\n\")";
wifi.println("conn=nil");
wifi.println("conn=net.createConnection(net.TCP, 0)");
wifi.println("conn:on(\"receive\", function(conn, payload) print(payload) end)");
wifi.println("conn:connect(8080, \"192.168.0.101\")");
wifi.println(cmd);
錯誤:
")stdin:1: unfinished string near '"GET /json.htm?type=command¶m=udevice&idx=2&nvalue=0&svalue=11 HTTP/1.1Host: 192'
不Lua中看到\r\n
在GET請求?
非常感謝! :) – Marcin
不客氣 - 與te Arduino玩得開心:) –