Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to control WIFI plug GWF-S171using Raspberry Pi

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.

like image 684
case Avatar asked Aug 05 '15 08:08

case


1 Answers

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.

like image 143
Lexcis Avatar answered Sep 27 '22 18:09

Lexcis