0

I have a micropython-running Wemos D1 mini project board.

I am trying to send a simple HTTP request on another Wemos D1 mini running Easyesp, that has a relay attached to it on pin 5. The request works like this

http://192.168.1.102/control?cmd=GPIO,5,1 # turns relay on
http://192.168.1.102/control?cmd=GPIO,5,1 # turns relay off

I have had the wemos that controls the relay working with 0 trouble for past 6 months and i can use it with my smartphone/pc browser with no trouble.

When i run my micropython script, it freezes after 3rd button press to <Response object at 3fff3580> or i get a ERRCONNRESET error.

https://pastebin.com/uHQHpj1Z

I think i need to give some time for the wifi modem to do it's job?

1 Answers1

1

<Response object at 3fff3580> is the response object send back from the other Wemos. change urequests.get("http://192.168.1.102/control?cmd=GPIO,5,1") and urequests.get("http://192.168.1.102/control?cmd=GPIO,5,0") to

res = urequests.get("http://192.168.1.102/control?cmd=GPIO,5,1")

res = urequests.get("http://192.168.1.102/control?cmd=GPIO,5,0")

You can also check whether the request was success full or not by checking the status code.

You can find details about ERRCONNRESET from here

B45i
  • 2,368
  • 2
  • 23
  • 33