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

Postman failing to connect to device in DIY mode #132

Open
DeanRos opened this issue Jun 20, 2023 · 4 comments
Open

Postman failing to connect to device in DIY mode #132

DeanRos opened this issue Jun 20, 2023 · 4 comments

Comments

@DeanRos
Copy link

DeanRos commented Jun 20, 2023

Hi

I have setup my minir3 in DIY mode, it is running firmware version 1.4.0.
I am trying to send it a command using postman but get an "Error: socket hang up"
Please take a look at my code below and see if I am doing something incorrect.

image

POST http://192.168.0.188:8081/zeroconf/signal_strength Error: socket hang up Network Request Headers Content-Type: application/json User-Agent: PostmanRuntime/7.32.2 Accept: */* Cache-Control: no-cache Postman-Token: 7e0530ae-63f2-4e4c-9327-48dcbeb71f14 Host: 192.168.0.188:8081 Accept-Encoding: gzip, deflate, br Connection: keep-alive Request Body { "deviceid": "100174292d", "data": { } }

@IBims1NicerTobi
Copy link

Try removing the device id and send only {"data":{}}. That fixed it for me at least but it's not documented anywhere so far

@kszili
Copy link

kszili commented Sep 22, 2023

Try removing the device id and send only {"data":{}}. That fixed it for me at least but it's not documented anywhere so far

Wow. I spent hours today to figure out why I'm not able to communicate with my devices. Just found your answer, tried it and voila, it works.

So yes, removing the deviceid tag from the request solves the communication problems. While earlier they simply ignored the deviceid tag (so you could send anything there), now, in the latest firmware (3.7.6 for a Basic R3) they implemented a check on this tag. If deviceid is missing, it works. If deviceid contains the proper deviceid (which I can query first with a POST /zeroconf/info, but without the deviceid), it works. If deviceid contains an inproper deviceid, it does not respond. Which is a poor design.

@krumok
Copy link

krumok commented Dec 12, 2023

Try removing the device id and send only {"data":{}}. That fixed it for me at least but it's not documented anywhere so far

Wow. I spent hours today to figure out why I'm not able to communicate with my devices. Just found your answer, tried it and voila, it works.

So yes, removing the deviceid tag from the request solves the communication problems. While earlier they simply ignored the deviceid tag (so you could send anything there), now, in the latest firmware (3.7.6 for a Basic R3) they implemented a check on this tag. If deviceid is missing, it works. If deviceid contains the proper deviceid (which I can query first with a POST /zeroconf/info, but without the deviceid), it works. If deviceid contains an inproper deviceid, it does not respond. Which is a poor design.

Great, you save me!
Same behaviour with sonogg mini r2 firmware 3.7.6
It works, just removing "deviceid":""
Thank you

@kszili
Copy link

kszili commented Dec 13, 2023

Yes, it is the same with Sonoff Mini R3 running 3.7.6. So it is probably the recent firmware bringing in this new functionality.

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

4 participants