누군가가 http.post() 요청의 본문을 작성하여 ESP8266에 연결된 센서의 값을 읽는 방법을 알려주시겠습니까?NodeMCU HTTP 모듈 HTTP.POST() 요청 본문 인수
wifi.setmode(wifi.STATION);
wifi.sta.config("ssid","pwd")
local sensorPin = adc.read(0)
http.post('url',
'Content-Type: application/json\r\n',
'"humidity":sensorPin'
,function(code, data)
if (code < 0) then
print("HTTP request failed")
else
print(code, data)
end
end)
어떻게이 GPIO 핀에 부착 된 센서의 값을 읽고 넣을 수있다하여 "키"의 값으로 : POST 요청의 본문에 "값"쌍?
여기에 의견이 더 필요하십니까? –