ckuehnel / NodeMCU-applications

This repository contains NodeMCU application programs for ESP8266 devices running NodeMCU firmware
75 stars 25 forks source link

Update code #2

Open morilm opened 7 years ago

morilm commented 7 years ago

Hi..

First of all thanks for the code. It has been really useful to start programing my own NodeMCU

I'd recomend to make two changes to ensure your code works 100%

  1. In the _GET nest, you need to use the request var and not vars

for k, v in string.gmatch(request, "(%w+)=(%w+)&*") do _GET[k] = v end

2.- To ensure the client receive and understand the server reply, it will be better to send some headers back. This can be done on the buf var init:

local buf = "HTTP/1.0 200 OK\r\nContent-Type: text/html\r\n\r\n";

Hope it helps Miguel

ckuehnel commented 7 years ago

Hi Miguel Thanks you for the hints. Is it possible to give a reference to the programs where I have to make the changes? Regards, Claus