How to control WIFI plug GWF-S171using Raspberry Pi
Asked Answered
U

2

5

I bought some See-Time GWF-S171 (wifi sockets) to work with my Raspberry Pi. I use my Raspberry Pi as a home automation platform and I managed to connect all kind of devices, smart meter, solar panels, Orvibo s20 (also Wifi socket).

Now I am not able to connect to the wifi socket. I monitored all the traffic between my iPhone using Wireshark and tcpdump (the socket is using an App – WeConn) and I managed to find the status using tcpdump, I also figured out that all traffic is going by UDP port 9957.

Easy way to check if the devices are on is running the code: sudo tcpdump -xn port 9957 |grep 0x0050

0100 means on 0000 means off. But making the connection switch on or off I did not manage. So any help in this would be really appreciated.

Unstuck answered 5/8, 2015 at 8:48 Comment(0)
B
5

I played around with a "OGEMRAY S171". Seems to be the same model.

You can send different TCP packets to port 9957 of the socket:

Set as Admin:

0101100148000000010000005c6c5c6c0000000000000000000000000000000000000000000000000000000000000000xxxxxxxxxxxx0000feff0000xxxxxxxxxxxx000000000100

Switch on:

0101010180000000010000005c6c5c6c0000000000000000000000000000000000000000000000000000000000000000xxxxxxxxxxxx0000000000000000000001000000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Switch off:

0101010180000000010000005c6c5c6c0000000000000000000000000000000000000000000000000000000000000000xxxxxxxxxxxx0000000000000000000001000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

Get Info:

0101030138000000010000005c6c5c6c0000000000000000000000000000000000000000000000000000000000000000xxxxxxxxxxxx0000

Where in the examples above xxxxxxxxxxxx is the MAC-address of the device sending the packets. I tried it using android app "TCP/UDP Terminal". Sending the packets from a windows notebook with "packet sender portable" was not successful.

There is also a "internet-mode" where the app (I use android app) sends TCP packets to an external server (in my case it seems to be 52.28.78.96) to port 9955. These packets are a bit different, but I think this mode is not interesting for your problem.

Bromide answered 10/8, 2015 at 21:42 Comment(3)
Wonderfull this does the trick! I got it working on my iPad using the App cmd. Now going to implement this on my Raspberry Pi.Unstuck
Great, it works. Do you know maybe how I can "decrypt" the answer from "Get Info" command? Thank you.Indicator
how did you capture these values? can you do it using fiddler or something?Containment
I
2

If anyone is intrested, i wrote a Homebridge plugin for devices such as S171. https://github.com/loki29pl/homebridge-weconn

Ingot answered 2/4, 2018 at 11:39 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.