Broyd Posted June 5, 2022 Posted June 5, 2022 I have an ESP32 device running micro-python to which I send a network resource as shown below. http://192.168.1.150/qry The IP address of the ESP32 is '192.168.1.150' and the command is 'qry'. The resource is sent correctly by the ISY and received correctly by the ESP32. The ESP32 process the 'qry' command just the way it is supposed to. However, I get the following response from the ISY when I test this network resource: "TCP client read response failed. Net Module Rule: 68" MY question is: Does anyone know what is required to be sent back to the ISY such that it will form a valid response to receiving the network resource? I'd just like to get a 'clean' response. What I am currently sending back as a response to the ISY, using Python in the ESP32 is as follows: conn.send('HTTP/1.1 200 OK\n') conn.send('Content-Type: text/html\n') conn.send('Connection: close\n\n') conn.send('<html><head>') conn.send('<link rel="icon" href="data:,">') # prevent browser from requesting favicon.ico conn.send('</head>\n\n') conn.close() I have tried removing the three lines about favicon, but I am getting the same error message: conn.send('<html><head>') conn.send('<link rel="icon" href="data:,">') # prevent browser from requesting favicon.ico conn.send('</head>\n\n') This response works fine when I send the network resource from a browser (Firefox). Thanks for any insight on this :). (I'm not sure resolving this is actually required because the ESP32 processes the command fine.)
MrBill Posted June 5, 2022 Posted June 5, 2022 Pretty sure it's just looking for an Http 200 OK response. The "Net Module Rule: 68" portion of the error message just indicates that it was Network Resource number 68 that caused the error.
Broyd Posted June 5, 2022 Author Posted June 5, 2022 Thanks MrBill, is there a list of the network module rules anywhere?
Broyd Posted June 5, 2022 Author Posted June 5, 2022 I've tried all variations of sending an 200 OK status and there has been no change. I am still getting the exact same message. Incidentally I send network resources to other Python scripts and also get a similar message, only Rule: 65 ... It would be satisfying to be able to send an accepted response, but it actually doesn't seem to matter because the receiving device handles the content of the network resource exactly the way I intended, in all cases.
Recommended Posts