-
Notifications
You must be signed in to change notification settings - Fork 75
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
Request for USB Ethernet driver? #62
Comments
I was just thinking of this before bed last night, lol. Reading the source to dafang, you need to compile usb-net support for the kernel and probably an asix ethernet device driver, as modules. Can these be used from the dafang source? Hmm |
Download: https://github.com/EliasKotlyar/Xiaomi-Dafang-Hacks/blob/master/firmware_mod/driver/usbnet.ko copy these onto the camera somehow (you could have a custom script do this probably), then run the commands (example): cd /tmp then plug in your usb to ethernet adapter:
then configure eth0 using udhcpc or use ifconfig to set a static ip etc. report back if it works for you... now the real kicker is, lets do this for the v3 =D |
NO WAY! No way! I can't wait to try this. Thank you! |
remember, you'll need an ASIX based ethernet adapter; with a specific model ASIX chipset ref EliasKotlyar/Xiaomi-Dafang-Hacks#536 |
looks like the V3 cam has these modules built in to the kernel. using a pass through USB otg cable, it works. |
Wow, that's great! Sadly I don't have any of pass-thru cables but they are on the way now! I have several V2 on NYC roof tops with a great view. I'll get some swapped out to V3 with ethernet. I'll share the feed if you want it :) I'm still trying the above driver on my V2 & PAN but I've been unable to get telnet to accept. Probably hasn't installed WyzeHacks correctly. Still trying! |
FYI - the cheap white $3 dongles off eBay from China do not work. Will confirm where to buy when I get one that works. [root@v2_camera:ryan]# lsusb |
Great! on it's way. Thank you. |
My USB dongle arrived today, and you are correct. The V3 already has the drivers for it. I created a custom script to UP eth0 and start dhcp. This works, I get an IP and can telnet into the camera over ethernet. Unfortunately, when Wifi is dropped, I also lose ethernet (ping & telnet). This is probably because the route table has the same subnet for wlan0 and eth0. Maybe wlan0 hasn't dropped yet, and the packets are still going out wlan0. So I decided to keep Wifi off and reboot, it should bring up eth0 without wlan0 ever creating the duplicate subnet. Unfortunately, ping never starts for the ethernet IP, but I think this is due to the wait_wlan() function performed on startup. It's waiting for wifi, and thus, never runs my custom script. I tried to modify wait_wlan() in main.sh to exit early without actually checking for wifi, but because the V3 has a read only file system, my changes are not saved on reboot. CUSTOM_SCRIPT='/configs/eth0.sh' /configs/eth0.sh |
I was able to get the camera to ping over ethernet on bootup. I had to modify a little in main.sh. Telnet is still connection refused, so I guess WyzeHacks is not finishing. And the Camera doesn't come online until Wifi is connected. But, it's progress. I have created a 'fork'. It's my first fork, but it looks like I did it right. |
Can you disable WiFi and force all the traffic to go through Ethernet? Just a thought to try. I am going to try to implement this on the v2. |
How would you disable Wifi? Here is where I think the problem is, the boot log shows the camera waiting at this spot: [netService:1199]war: wpa_state=DISCONNECTED I did manage to get Video and telnet working over ethernet with Wifi disabled by doing "ifconfig wlan0 down", but this was only after it booted up with Wifi. |
Could you put it in the script to do ifdown on the wlan? |
I will try. I'm not sure it will satisfy the wpa_cli, but it's worth a shot. I'll try tomorrow. |
The ethernet adapter that your using uses the USB A port not the microUSB port? If so I'll purchase one to help, just want to make sure I get the right adapter. I bought one of these hoping I could get power and ethernet working through just the micro USB port. No luck. I'm hoping you get it working and I can pair the setup with one of these. |
use this with a v3: |
So my parts came in today and I'm having some success on the V2 camera. Here's my hardware: I'm attempting to get everything working manually before I try to script anything. Here's where I'm at: usbnet.ko and asix.ko are on my NAS in the emulated SD card folder. I have them there for testing until I figure out a better place to put them. I was thinking about eventually splicing them into the official RTSP firmware. I run the following: [root@WyzeCam]# insmod usbnet.ko
[root@WyzeCam]# insmod asix.ko
[root@WyzeCam]# ifconfig eth0 up As expected I'm able to see the device in ifconfig: [root@WyzeCam]# ifconfig
eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:1038 (1.0 KiB)
[root@WyzeCam]# udhcpc -i eth0 -p /var/run/udhcpc_eth0.pid -b
udhcpc (v1.22.1) started
Sending discover...
Sending discover...
Sending discover...
No lease, forking to background
[root@WyzeCam]# ifconfig eth0 192.168.0.28
[root@WyzeCam]# ifconfig
eth0 Link encap:Ethernet HWaddr XX:XX:XX:XX:XX:XX
inet addr:192.168.0.28 Bcast:192.168.0.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Scratch the DHCP issue above. The switch I was using had link aggregation enabled on the ports I was using. As soon as I disabled link aggregation DHCP worked. |
When I try that with a working ethernet connection everything works for a few minutes. After a minute or two the camera reboots. Seems like something is checking that the camera is connected to wireless and reboots the camera if it's not. |
The boot log shows that Wyze is waiting for wpa_cli to return "COMPLETED". Wyze does not finish booting until this. Until Wifi is available and connected, wpa_cli will return "SCANNING, ASSOCIATING or DISCONNECTED". Unfortunately, we can't modify the wpa_cli since the file system is read only (V3 at least). very depressing.
I'll keep trying. |
@ryny24 I've been messing around with making a custom firmware based on this video. I've been able to modify files on the firmware and flash it and then apply WyzeHacks on top with success. wpa_cli is on the JFFS2 block within the firmware. I've been able to unpack the JFFS2 system using sviehb/jefferson however I'm not sure how to repack the JFFS2 system after making changes. It's been fairly trivial to make changes to the squashfs systems. My thinkings is we may need to modify the stock firmware using the methods described in that video. Flash the modded firmware, then apply WyzeHacks on top. The mods to the firmware would include the kernel modules for USB ethernet and automatic detection of the USB ethernet adapter to choose and provision either Wifi or Ethernet. |
@MelonSmasher wow, he makes that look so simple lol. The only problem is, keeping wpa_cli functional when ETHERNET is not enabled in the config. Maybe we can create wpa_cli a link to another file system that we can modify. I will give it a try. |
Doing a binwalk on the Wyze firmware file shows the same as the video. Multiple volumes including Squashfs. However, the firmware.bin which WyzeHacks sends is only a tar file. I think it's only sending the hacked scripts needed and not the firmware itself. Good idea actually. But, that will make it a bit more complicated to fix wpa_cli.
|
I made a tool that unpacks and repacks the firmware. It mounts the JFFS2 image read/write so that changes can be made. I've only tried on the Cam V2 firmware. Here's a link if your interested: MelonSmasher/WyzeFirmwareTool |
@ryny24 I have been able to modify the JFFS2 file system with some success. What would you do to wpa_cli if you could modify it? I've tried renaming both |
While not ideal, I found that killing wpa_supplicant after the camera has been running for a while allows the camera to stay up and running with no wifi connection forcing all traffic over eth0. I generated some Wyze Cam v2 firmware images using my WyzeFirmwareTool. I've noticed that when wpa_supplicant is dead without the hacks in this repo the camera stays up and running. However when the hacks are enabled the camera reboots within a minute or two of wpa_supplicant being killed off. Below are 4 different firmware images I generated for the cam v2. Two are based off the latest firmware from Wyze and two are based off of the RTSP firmware from Wyze. Two of them will kill wpa_supplicant after boot to force the connection over eth0 and the other two leave wpa_supplicant alone but do enable the ethernet adapter. If I can't get the camera to stop rebooting, I may just work in the NFS mods from this repo into my firmware generator tool. |
didn't @HclX add a subroutine to reboot if wifi is lost? I forgot, I may be wrong, I'll check the source. |
Something else to note, here is that even with both wifi and eth0 enabled, traffic seems to be going over the ethernet adapter. While probably not the best way to measure this, but when I open the Wyze and look at the camera the ethernet adapter goes from a steady light to flashing continuously. I'm wondering if it's even worth killing the wifi connection. |
you're saying that the camera works even with no wifi to initially connect? I think some folks want to use this in areas with no wifi |
@satmandu Agree. But that's why the simple scripts mentioned above fools the rest of the system.
I am just trying to create a v3 firmware image with these substitute scripts replacing the aoriginal executables. |
Gentlemen: I'm desperate to get something like WyzeHacks working on the Eufy Indoor Cam 2K (model T8400), but I lack the sharpened Linux hacking skillz you all seem to have. I can tell you that the Eufy cam uses the exact-same SoC as the Wyze V3 — namely, the Ingenic T31 — and I've spent countless hours running operational experiments and examining log files from the cams. If you know of anyone who's working on a project like this — which I suppose one might call "EufyHacks" — or if you would be interested in working on it yourself, PLEASE message me!! ~ Apologies for the tangential comment. Thanks. |
I happen to have bought one eufy 2k camera for investigation. Unfortunately
I haven't made much progress. One probem with eufy camera is they don't
have SD card recovery mechanism also no firmware downloadable from their
website. That definitely adds some barrier to get the firmware out for
analysis. I think I will manage that by simply open the case and dump flash
directly. But I'm really busy nowadays and haven't got any chance to that
step yet...
…On Fri, Aug 20, 2021, 17:06 jdm0 ***@***.***> wrote:
Gentlemen: I'm desperate to get something like WyzeHacks working on the
Eufy Indoor Cam 2K (model T8400), but I lack the sharpened Linux hacking
skillz you all seem to have. I can tell you that the Eufy cam uses the
exact-same SoC as the Wyze V3 — namely, the Ingenic T31 — and I've spent
countless hours running operational experiments and examining log files
from the cams. If you know of anyone who's working on a project like this —
which I suppose one might call "EufyHacks" — or if you would be interested
in working on it yourself, *PLEASE* message me!! ~ Apologies for the
tangential comment. Thanks.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#62 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAZNWD2DCFTWAUYMCQ6BRG3T53UXRANCNFSM4UXTSUHQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
@HclX wrote:
Another possible approach might be to manually initiate the download of a firmware update to the cam, the next time one becomes available, after preparing to use Wireshark/Debookie and a MITM technique to intercept the firmware binary as it's passing thru your local router on its way to the cam. |
I hope there's a way to enable USB ethernet for the official Wyze Cam v3 RTP firmware! (Opened an issue for that here: #138 ) |
Is anyone using this Wyze ethernet method for constant RTSP streaming? Has it been more stable than wifi? |
I've been using the ethernet driver for constant rtsp streaming on the Cam v3, not using the official RTSP firmware. (I'm in a high density wifi area though, so any offloading from wifi is a good thing.) |
@satmandu I'd like to do the same, but can't even get logged into the Wyze apps. Multiple devices, and it always says "Login Error. Problem connecting to server, please try again." Is there a way to do this without ever connecting to wyze? Edit: Secondary question - regarding your official firmware issue - what is your reasoning for wanting the USB Ethernet on that firmware if you've got RSTP via ethernet already working? |
I am using this: https://github.com/FiveLeavesLeft/WyzeCameraLiveStream I don't think it requires you to login through the web interface at all. |
Did you get it to work on ver 3 camera? mine is crashing every 20s or so
when i install this ...
…On Mon, Sep 27, 2021 at 9:10 AM Satadru Pramanik ***@***.***> wrote:
I am using this: https://github.com/FiveLeavesLeft/WyzeCameraLiveStream
I don't think it requires you to login through the web interface at all.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#62 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABOQZBNJBF7IDC64K7HM3BDUEBUNJANCNFSM4UXTSUHQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
You might need an older firmware. Mine is stable.
Getting the newer Actual RTSP firmware working with Ethernet would be ideal
though.
…On Mon, Sep 27, 2021, 9:43 AM nadigo ***@***.***> wrote:
Did you get it to work on ver 3 camera? mine is crashing every 20s or so
when i install this ...
On Mon, Sep 27, 2021 at 9:10 AM Satadru Pramanik ***@***.***>
wrote:
> I am using this: https://github.com/FiveLeavesLeft/WyzeCameraLiveStream
>
> I don't think it requires you to login through the web interface at all.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#62 (comment)>, or
> unsubscribe
> <
https://github.com/notifications/unsubscribe-auth/ABOQZBNJBF7IDC64K7HM3BDUEBUNJANCNFSM4UXTSUHQ
>
> .
> Triage notifications on the go with GitHub Mobile for iOS
> <
https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675
>
> or Android
> <
https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub
>.
>
>
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#62 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAILX7PCNFRGNQ3HOIBOU2LUEBYJTANCNFSM4UXTSUHQ>
.
|
I use ethernet and constantly streaming/recording using frigate. It is completely stable. I can't comment on wifi comparision because I didn't try stability tests with wifi. |
Lo and behold, someone has recently posted the SDK for the Ingenic T31 SoC here on Github. If you haven't seen it before, I think you may find it extremely helpful in making progress with hacking the Wyze V3 (and also the Eufy Indoor 2K). Lots of juicy goodies there, including technical documentation of the Ingenic T31 chip. The section on the boot process (pp. 25–26) may be of particular interest. Enjoy! |
Could someone with a V3 and working ethernet based local network streaming comment with which firmware they're on, and which (if any) hacks they've applied? |
@satmandu Sir, would you be so kind and write a short few steps guide how to enable USB LAN on V3? Will try to place it on this WIKI repo for others. thank you |
I don't actually have Ethernet setup on my V3 at the moment, so you're best off following the steps mentioned above. I'm just using the RTSP firmware with wifi at the moment. |
Hello , would you commands to change SSID and password in V3 via telnet? |
i got this to work without needing a wifi network present... that was the issue right? you still needed wifi when the camera booted? |
hello @gtxaspec , what steps did you run to make the ethernet working on V3? |
code goes like this:
wpa_cli.sh:
EDIT: |
@gtxaspec Thanks for sharing this! I'll give this a try. What cable/adapter are you using to get ethernet connected? |
@evanheckert I'm using an AX88772B usb 2.0 ethernet adapter, an old macally one.
|
Not sure I follow on this. What's a busybox? Also I manually triggered
And both worked, so I made the grave mistake of adding them as export CUSTOM_SCRIPT lines. Then with a reboot, only wlan0_kill.sh worked, apparently, because it connects to wifi just long enough to see it at the router control panel, then disappears. If I can't telnet in and wifi is disabled, am I bricked? |
busybox is a utility that included in the wyze firmware. You can always flash back using the stock firmware. I will release a version of wz_mini_hacks soon that has the ethernet stuff built in. |
Awesome! Starred and followed. I'll give it a go when the ethernet stuff is added. RTSP enabled as well? |
you can use the RTSP firmware too! |
When will this be available? |
Does this work on V3? |
I just found this WyzeHacks and I can't wait to try it.
Would it be possible to add ethernet (USB) support to the WyzeCam? For locations that don't have Wifi. Just a thought!
Keep up the good work!
The text was updated successfully, but these errors were encountered: