AlexxIT / SonoffLAN

Control Sonoff Devices with eWeLink (original) firmware over LAN and/or Cloud from Home Assistant
https://github.com/AlexxIT/Blog
MIT License
2.58k stars 405 forks source link

I cant get de apikey from DualR3 #1371

Closed IngenieroGeomatico closed 1 month ago

IngenieroGeomatico commented 3 months ago

Hello, I am aware that this is not an incident, but I need help and I think this is the best place to ask for it :)

I have a few DualR3 and miniR4, I am currently connecting the DualR3 only by LAN to control them from a Raspberry Pi, but they do not have the DIY mode and I have to obtain the apikey manually by following these links:

https://github.com/AlexxIT/SonoffLAN/blob/ceafb289a029742c818116f398433a7979c34f9d/README.md?plain=1#L511

https://blog.ipsumdomus.com/sonoff-switch-complete-hack-without-firmware-upgrade-1b2d6632c01

So far, I have been able to program the following with python:

1./ I scan the entire network seeing the "itead" APs and connect to them by their SSID

2./ I do a GET to 192.168.1.1/device and I get something like this:

"data":"kF9eB9Cn......wHjDklinIs="

Which I assume is the coding for this:

{ "deviceid":"10000xxxxx", "apikey":"xxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", "accept":"post" }

the answer is... How can I decode the GET data?

Thank you very much in advance

AlexxIT commented 2 months ago

Haven't used this manual in five years

20bart commented 2 months ago

A bit late maybe, but it seems like it's base64 encoded. You can try to decode it here: https://www.base64decode.org/

IngenieroGeomatico commented 1 month ago

hi,

In the end, I had to make an ewelink account and get the apikey for each device.

I suppose that by reverse engineering it could be obtained without an ewelink account, but I also imagine that it would not be so ethical.

Once you have the apikey of each device, communication with them is done through http request and everything is fine :)