Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: Failure on multiple SendGet Functions #1390

Open
codekow opened this issue Oct 14, 2024 · 4 comments
Open

Error: Failure on multiple SendGet Functions #1390

codekow opened this issue Oct 14, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@codekow
Copy link

codekow commented Oct 14, 2024

Describe the bug

Command

Device fails to send multiple SendGet commands

alias scared_of_the_dark backlog sendGet http://10.0.40.51/cm?cmnd=Power0%20Toggle; sendGet http://10.0.40.52/cm?cmnd=Power0%20Toggle

addEventHandler OnDblClick 6 scared_of_the_dark

Error

Info:HTTP_CLIENT:HTTPClient_Async_SendGet for http://10.0.40.52/cm?cmnd=Power0%20Toggle, sizeof(httprequest_t) == 160!
Info:HTTP_CLIENT:Parse url http://10.0.40.51/cm?cmnd=Power0%20Toggle
Info:HTTP_CLIENT:Parse url http://10.0.40.52/cm?cmnd=Power0%20Toggle
Info:HTTP_CLIENT:host: '10.0.40.51', port: 80
Info:HTTP_CLIENT:host: '10.0.40.52', port: 80
Info:HTTP_CLIENT:HAL_TCP_Establish: created socket 2

Error:HTTP_CLIENT:getaddrinfo error
Error:HTTP_CLIENT:establish connection failed, error -1 
Error:HTTP_CLIENT:httpclient_connect is error,ret = -8

Firmware:

  • Version Built on Oct 11 2024 21:26:54 version 1.17.746
  • Device:
  • Chip/model: BK7231T
  • Device config:
{
  "vendor": "Tuya",
  "bDetailed": "0",
  "name": "Full Device Name Here",
  "model": "enter short model name here",
  "chip": "BK7231T",
  "board": "TODO",
  "flags": "1024",
  "keywords": [
    "TODO",
    "TODO",
    "TODO"
  ],
  "pins": {
    "6": "Btn;1",
    "8": "LED_n;2",
    "9": "LED_n;1",
    "24": "Rel;1",
    "26": "dInput;2"
  },
  "command": "",
  "image": "https://obrazki.elektroda.pl/YOUR_IMAGE.jpg",
  "wiki": "https://www.elektroda.com/rtvforum/topic_YOUR_TOPIC.html"
}

Additional context

I've tried multiple versions and get the same error

@openshwprojects
Copy link
Owner

So it fails when you try to send two GET at the same time? But it works with single GET?

@codekow
Copy link
Author

codekow commented Oct 15, 2024

@openshwprojects

I am having inconsistent results.

Usually one SendGet eventually completes - although the first time it may be a little delayed. But, I can never get both to complete.

Sometimes the first one works, sometimes the second, but never both.

@openshwprojects
Copy link
Owner

Maybe try adding a delay between them? In script, we dont have delay yet in backlog.

@openshwprojects openshwprojects added the bug Something isn't working label Oct 16, 2024
@codekow
Copy link
Author

codekow commented Oct 17, 2024

@openshwprojects

It seems like the second command is unable to resolve a network address until the first command completes.

I haven't looked at the code closely yet, but some function may be blocking in src/httpclient/utils_net.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants