OSError 16 when calling urequests.post

All ESP32 boards running MicroPython.
Target audience: MicroPython users with an ESP32 board.
Post Reply
User avatar
netomarin
Posts: 1
Joined: Thu Jun 10, 2021 9:34 pm
Location: Brazil
Contact:

OSError 16 when calling urequests.post

Post by netomarin » Thu Jun 10, 2021 9:36 pm

I'm trying to send data to a spreadsheet hosted on Google using the post function on urequests.py

my code:

Code: Select all

request_data = ujson.dumps({
    "parameter": {
        "Beer": "Test",
        "Temp": 65,
        "SG":1.050,
        "Color":"ORANGE",
        "Comment":"user@gmail.com, TiltESP32",
        "Timepoint":43486.6
    }
})

print("url: {} - data: {}".format(device['cloud_url'], request_data))
response = urequests.post(device['cloud_url'], headers = {'content-type': 'application/json'}, data = request_data)
result:

Code: Select all

url: https://script.google.com/macros/s/AKfycbwNXh6rEWoULd0vxWxDylG_PJwQwe0dn5hdtSkuC4k3D9AXBSA/exec - data: {"parameter": {"Comment": "user@gmail.com, TiltESP32", "Beer": "Test", "Temp": 65, "SG": 1.05, "Color": "ORANGE", "Timepoint": 43486.6}}
Traceback (most recent call last):
  File "main.py", line 108, in bt_irq
  File "main.py", line 46, in handle_ibeacon
  File "main.py", line 100, in log_data
  File "urequests.py", line 120, in post
  File "urequests.py", line 62, in request
OSError: 16
https://github.com/micropython/micropyt ... sts.py#L62

I'm using a standard ESP-WROOM-32 board with the imagem file `https://micropython.org/resources/firmw ... 3538a3.bin`

Post Reply