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

Nedis SmartLife Smart Plug: Couldn't receive packets from the device #7

Open
janihy opened this issue Jan 4, 2023 · 6 comments
Open
Labels
bug Something isn't working

Comments

@janihy
Copy link

janihy commented Jan 4, 2023

The device is a Nedis Smart Plug WIFIP110FWT.
When connected to the Tuya app both main and MCU versions are reported as 1.0.0. Opening the device revealed the chip is a BK7231N, but the existing cloudcutter profiles for this combination did not seem to do the trick. So I thought I'd dump the firmware and create a profile for this particular device. After using the Tuya app, I disconnected and wiped the device in the app so it should be good to go. The CustomAP I'm using is a esp8266-based NodeMCU.

Dumping the flash with Lightleak fails and does not seem to receive any packets from the plug. I can get to the flash dump screen after selecting unconfigured device, all actions are successful. Device exits AP mode and the app connects successfully to it after reboot to AP mode. I used the BK7231N - Variant 1 (Standard) profile: other N-profiles did not seem to exploit correctly and froze the plug, so at least something is happening.

Let me know if you need more information. Disassembling the device enough to get a dump needs a bit more prying but I'll do that if needed.
log_lightleak.txt
log_exploit.txt

@kuba2k2
Copy link
Member

kuba2k2 commented Jan 4, 2023

Does the device exit AP mode about 3 minutes after getting to the flash reading screen?

Does it crash at any point when using the Standard profile? The fact that Standard doesn't freeze the plug is interesting, it can mean that the code doesn't find some functions it needs.

Also, what board is inside the plug? We've seen CB2S plugs with BK7231T before... see tuya-cloudcutter/tuya-cloudcutter#210 (comment)

@kuba2k2 kuba2k2 added the bug Something isn't working label Jan 4, 2023
@janihy
Copy link
Author

janihy commented Jan 4, 2023

Nope, does not seem to exit AP mode. Light is flashing slowly still after at least 10 minutes from entering the flash reading screen. It's still advertising its SmartLife_95AC SSID and responding to the button press. Does respond to the button press throughout the whole process actually.

This was a bit more embedded than the ones I've seen photos and the BK7231N is sitting directly on the main PCB. Here's an image inside with barely readable prints:
2023-01-04_16-24

@kuba2k2
Copy link
Member

kuba2k2 commented Jan 4, 2023

Okay, so that means the Standard profile is correct and that flash writing did succeed (otherwise it would exit AP mode after 3 minutes).

It would be easiest to have a dump of this device. It's possible that it uses some code that lightleak didn't expect, and it can't find the proper functions.

@janihy
Copy link
Author

janihy commented Jan 4, 2023

Thanks! I'll dig a bit deeper tonight and see if I can find the correct pins for a full dump.

@janihy
Copy link
Author

janihy commented Jan 4, 2023

Alright, found actual pins on the other side of the PCB. Dumped everything with bk7231tools, I'll attach the dump here. Hope this helps someone, the plug was kind of worn out during research :D
nedis_smart_plug.zip

@Cossid
Copy link
Member

Cossid commented Jan 8, 2023

A profile has been added to CloudCutter built from the dump in the meantime.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants