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

No response in CURL #128

Open
skyppye opened this issue Dec 19, 2022 · 3 comments
Open

No response in CURL #128

skyppye opened this issue Dec 19, 2022 · 3 comments

Comments

@skyppye
Copy link

skyppye commented Dec 19, 2022

Hi, I've been trying to power on a smart plug via a LAN curl command.
I get no response whatsoever, any ideas please?? Thanks!
Capture 1

@tosiara
Copy link

tosiara commented Dec 21, 2022

Same for me:

$ curl -vv http://192.168.2.144:8081/zeroconf/info -H "Content-Type: application/json" --data '{ "deviceid": "","data": { }}'
*   Trying 192.168.2.144:8081...
* TCP_NODELAY set
* Connected to 192.168.2.144 (192.168.2.144) port 8081 (#0)
> POST /zeroconf/info HTTP/1.1
> Host: 192.168.2.144:8081
> User-Agent: curl/7.68.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 29
> 
* upload completely sent off: 29 out of 29 bytes
* Recv failure: Connection reset by peer
* Closing connection 0
curl: (56) Recv failure: Connection reset by peer

@vl9invocations
Copy link

vl9invocations commented Jan 13, 2023

Hello there, anyone resolved this question?
What seems to work is using json data saved in txt file, then just use -d @json.txt
But I don't really understand why it's not working directly from cli (text formatting have no effect on outcome).

Same issue with C# HttpClient, it hangs or not responding. Checked with external api and it seems to send correct post content.. But with R3 in diy, R3 hangs or drops connection.

edit:
Turns out, json data sent to device was somehow malformed and was not read as JavaScript Object Notation (JSON). Used NewtonSoft.Json instead to serialize an object and posted with httpclient PostAsync..

@tosiara
Copy link

tosiara commented Jan 16, 2023

I've got an answer from support that not every device supports DIY mode. Specifically S26R2 does not support. I returned that back to the shop. Not planning to buy Sonoff anymore

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants