gtxaspec / wz_mini_hacks

wz camera mods... make your camera better.
1.23k stars 103 forks source link

Wyze Cam FloodLight: Not controllable in Wyze Application. #172

Open skilau opened 1 year ago

skilau commented 1 year ago

I finally got around to putting wz_mini_hacks on my Wyze FloodLight.

Once I did this, wz_mini_hacks loads just fine, but the Floodlight Controls in the Wyze app (Android) no longer is shown. It appears that Wyze doesn't believe the Floodlight is available anymore.

This is alluded to by a couple posts in this discussion: https://github.com/gtxaspec/wz_mini_hacks/discussions/91

Checking dmesg, I see a couple interesting things:

[ 0.986061] usb 1-1: device v05e3 p0610 is not supported [ 0.992020] hub 1-1:1.0: USB hub found [ 0.996220] hub 1-1:1.0: 4 ports detected [ 1.275015] usb 1-1.1: new full-speed USB device number 3 using dwc2 [ 1.281578] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.287621] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.293643] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.375003] usb 1-1.1: device descriptor read/64, error -12

And:

[ 5.315028] usb 1-1.2: device not accepting address 10, error -12 [ 5.333537] hub 1-1:1.0: unable to enumerate USB device on port 2

Any thoughts?

PS: My floodlight is on my deck, so I have reasonable access to it if needed.

gtxaspec commented 1 year ago

@skilau thats interesting. Does the floodlight have an additional USB port? Are you using an external USB hub? usb to ethernet?

skilau commented 1 year ago

@gtxaspec, yes, it has an extra USB port on the outside. You apparently can use it to add another V3 cam if you want. I don't use it though, or have anything plugged into it.

I saved this camera to install wz_mini_hacks on last, because it doesn't have any really good way to install a USB Ethernet adapter on it, while still looking reasonable. So I am using this one as Wifi only.

I am using your current master branch, nothing special configured yet. I tried enabling and disabling REMOTE_SPOTLIGHT, didn't seem to matter.

Below is the full dmesg dump: `

dmesg

[ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Initializing cgroup subsys cpuacct [ 0.000000] Linux version 3.10.14isvp_swan_1.0 (t31@mips-development) (gcc version 4.7.2 (Ingenic r2.3.3 2016.12) ) #56 PREEMPT Fri Jul 8 18:22:25 PDT 2022 [ 0.000000] bootconsole [early0] enabled [ 0.000000] CPU0 RESET ERROR PC:801D02C4 [ 0.000000] [<801d02c4>] delay+0x4/0x10 [ 0.000000] CPU0 revision is: 00d00100 (Ingenic Xburst) [ 0.000000] FPU revision is: 00b70000 [ 0.000000] cgu_get_rate, parent = 1392000000, rate = 0, m = 0, n = 0, reg val = 0x081000ff [ 0.000000] cgu_get_rate, parent = 1392000000, rate = 0, m = 0, n = 0, reg val = 0x081000ff [ 0.000000] CCLK:1392MHz L2CLK:696Mhz H0CLK:200MHz H2CLK:200Mhz PCLK:100Mhz [ 0.000000] Determined physical RAM map: [ 0.000000] memory: 004f8000 @ 00010000 (usable) [ 0.000000] memory: 00078000 @ 00508000 (usable after init) [ 0.000000] User-defined physical RAM map: [ 0.000000] memory: 06300000 @ 00000000 (usable) [ 0.000000] Initrd not found or empty - disabling initrd [ 0.000000] Zone ranges: [ 0.000000] Normal [mem 0x00000000-0x062fffff] [ 0.000000] Movable zone start for each node [ 0.000000] Early memory node ranges [ 0.000000] node 0: [mem 0x00000000-0x062fffff] [ 0.000000] On node 0 totalpages: 25344 [ 0.000000] free_area_init_node: node 0, pgdat 80505680, node_mem_map 81000000 [ 0.000000] Normal zone: 198 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 25344 pages, LIFO batch:7 [ 0.000000] Primary instruction cache 32kB, 8-way, VIPT, linesize 32 bytes. [ 0.000000] Primary data cache 32kB, 8-way, VIPT, no aliases, linesize 32 bytes [ 0.000000] pls check processor_id[0x00d00100],sc_jz not support! [ 0.000000] MIPS secondary cache 128kB, 8-way, linesize 32 bytes. [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping off. Total pages: 25146 [ 0.000000] Kernel command line: console=ttyS1,115200n8 mem=99M@0x0 rmem=29M@0x6300000 rdinit=/init mtdparts=jz_sfc:256K(boot),1984K(kernel),3904K(rootfs),3904K(app),1984K(kback),3904K(aback),384K(cfg),64K(para) [ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes) [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Memory: 93148k/101376k available (4106k kernel code, 8228k reserved, 980k data, 480k init, 0k highmem) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] Preemptible hierarchical RCU implementation. [ 0.000000] NR_IRQS:358 [ 0.000000] clockevents_config_and_register success. [ 0.000014] Calibrating delay loop... 1391.00 BogoMIPS (lpj=6955008) [ 0.087830] pid_max: default: 32768 minimum: 301 [ 0.092688] Mount-cache hash table entries: 512 [ 0.097609] Initializing cgroup subsys debug [ 0.101865] Initializing cgroup subsys freezer [ 0.107312] devtmpfs: initialized [ 0.111484] regulator-dummy: no parameters [ 0.115762] NET: Registered protocol family 16 [ 0.130498] bio: create slab at 0 [ 0.135992] jz-dma jz-dma: JZ SoC DMA initialized [ 0.140912] usbcore: registered new interface driver usbfs [ 0.146481] usbcore: registered new interface driver hub [ 0.151880] usbcore: registered new device driver usb [ 0.157078] (null): set:249 hold:250 dev=100000000 h=500 l=500 [ 0.163156] media: Linux media interface: v0.10 [ 0.167740] Linux video capture interface: v2.00 [ 0.172533] Advanced Linux Sound Architecture Driver Initialized. [ 0.179885] Switching to clocksource jz_clocksource [ 0.184950] cfg80211: Calling CRDA to update world regulatory domain [ 0.191884] dwc2 otg probe start [ 0.191916] jz-dwc2 jz-dwc2: cgu clk gate get error [ 0.196825] DWC IN OTG MODE [ 0.200233] dwc2 dwc2: Keep PHY ON [ 0.203596] dwc2 dwc2: Using Buffer DMA mode [ 0.207945] dwc2 dwc2: Core Release: 3.00a [ 0.212106] dwc2 dwc2: DesignWare USB2.0 High-Speed Host Controller [ 0.218453] dwc2 dwc2: new USB bus registered, assigned bus number 1 [ 0.225602] hub 1-0:1.0: USB hub found [ 0.229334] hub 1-0:1.0: 1 port detected [ 0.233376] dwc2 dwc2: DWC2 Host Initialized [ 0.237879] dwc2 dwc2: enter dwc2_gadget_plug_change:2589: plugin = 1 pullup_on = 0 suspend = 0 [ 0.246687] dwc2 otg probe success [ 0.246820] NET: Registered protocol family 2 [ 0.251556] TCP established hash table entries: 1024 (order: 1, 8192 bytes) [ 0.258627] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.265020] TCP: Hash tables configured (established 1024 bind 1024) [ 0.271481] TCP: reno registered [ 0.274711] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.280651] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.287175] NET: Registered protocol family 1 [ 0.291761] RPC: Registered named UNIX socket transport module. [ 0.297742] RPC: Registered udp transport module. [ 0.302455] RPC: Registered tcp transport module. [ 0.307232] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.313766] dwc2 dwc2: ID PIN CHANGED! [ 0.476940] freq_udelay_jiffys[0].max_num = 10 [ 0.481366] cpufreq udelay loops_per_jiffy [ 0.485854] 12000 59956 59956 [ 0.489048] 24000 119913 119913 [ 0.492491] 60000 299784 299784 [ 0.496018] 120000 599569 599569 [ 0.499468] 200000 999282 999282 [ 0.502999] 300000 1498924 1498924 [ 0.506744] 600000 2997848 2997848 [ 0.510416] 792000 3957159 3957159 [ 0.514124] 1008000 5036385 5036385 [ 0.517932] 1200000 5995696 5995696 [ 0.525381] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.531870] jffs2: version 2.2. © 2001-2006 Red Hat, Inc. [ 0.537685] msgmni has been set to 181 [ 0.542384] io scheduler noop registered [ 0.546418] io scheduler cfq registered (default) [ 0.552898] jz-uart.1: ttyS1 at MMIO 0x10031000 (irq = 58) is a uart1 [ 0.560498] console [ttyS1] enabled, bootconsole disabled [ 0.574746] brd: module loaded [ 0.579700] loop: module loaded [ 0.583436] zram: Created 2 device(s) ... [ 0.587789] logger: created 256K log 'log_main' [ 0.592896] jz TCU driver register completed [ 0.597693] the id code = 1c7018, the flash name is EN25QH128A [ 0.603715] JZ SFC Controller for SFC channel 0 driver register [ 0.609884] 8 cmdlinepart partitions found on MTD device jz_sfc [ 0.616006] Creating 8 MTD partitions on "jz_sfc": [ 0.620942] 0x000000000000-0x000000040000 : "boot" [ 0.626387] 0x000000040000-0x000000230000 : "kernel" [ 0.631958] 0x000000230000-0x000000600000 : "rootfs" [ 0.637564] 0x000000600000-0x0000009d0000 : "app" [ 0.642853] 0x0000009d0000-0x000000bc0000 : "kback" [ 0.648382] 0x000000bc0000-0x000000f90000 : "aback" [ 0.653880] 0x000000f90000-0x000000ff0000 : "cfg" [ 0.659305] 0x000000ff0000-0x000001000000 : "para" [ 0.664675] SPI NOR MTD LOAD OK [ 0.668002] tun: Universal TUN/TAP device driver, 1.6 [ 0.673210] tun: (C) 1999-2004 Max Krasnyansky maxk@qualcomm.com [ 0.679980] wait stable.[289][cgu_msc0] [ 0.683939] jzmmc_v1.2 jzmmc_v1.2.0: vmmc regulator missing [ 0.689971] jzmmc_v1.2 jzmmc_v1.2.0: register success! [ 0.695313] jzmmc_v1.2 jzmmc_v1.2.0: card inserted, state=0 [ 0.701171] jzmmc_v1.2 jzmmc_v1.2.1: vmmc regulator missing [ 0.707128] jzmmc_v1.2 jzmmc_v1.2.1: register success! [ 0.716425] TCP: cubic registered [ 0.720220] NET: Registered protocol family 10 [ 0.725519] NET: Registered protocol family 17 [ 0.730801] input: gpio-keys as /devices/platform/gpio-keys/input/input0 [ 0.738015] drivers/rtc/hctosys.c: unable to open rtc device (rtc0) [ 0.744540] ALSA device list: [ 0.747633] #0: Loopback 1 [ 0.750601] #2: Loopback 2 [ 0.755461] Freeing unused kernel memory: 480K (80508000 - 80580000) [ 0.774844] usb 1-1: new high-speed USB device number 2 using dwc2 [ 0.954785] mmc0: new high speed SDXC card at address 59b4 [ 0.960651] mmcblk0: mmc0:59b4 JD2S5 119 GiB [ 0.967037] mmcblk0: p1 [ 0.986067] usb 1-1: device v05e3 p0610 is not supported [ 0.992024] hub 1-1:1.0: USB hub found [ 0.996223] hub 1-1:1.0: 4 ports detected [ 1.275012] usb 1-1.1: new full-speed USB device number 3 using dwc2 [ 1.281578] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.287608] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.293637] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.375005] usb 1-1.1: device descriptor read/64, error -12 [ 1.484776] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.490800] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.496836] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.575007] usb 1-1.1: device descriptor read/64, error -12 [ 1.765004] usb 1-1.1: new full-speed USB device number 4 using dwc2 [ 1.773150] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.782513] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.788797] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.799135] FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck. [ 1.875088] usb 1-1.1: device descriptor read/64, error -12 [ 1.984837] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 1.994843] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 2.000872] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 2.085089] usb 1-1.1: device descriptor read/64, error -12 [ 2.275065] usb 1-1.1: new full-speed USB device number 5 using dwc2 [ 2.281831] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 2.494842] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 2.704791] usb 1-1.1: device not accepting address 5, error -12 [ 2.785054] usb 1-1.1: new full-speed USB device number 6 using dwc2 [ 2.791628] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 2.993305] Adding 131064k swap on /opt/wz_mini/swap. Priority:-1 extents:1 across:131064k SS [ 3.004816] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.053715] v4l2loopback driver version 0.12.5 loaded [ 3.214824] usb 1-1.1: device not accepting address 6, error -12 [ 3.225082] hub 1-1:1.0: unable to enumerate USB device on port 1 [ 3.308736] @@@@ tx-isp-probe ok(version H20211130a), compiler date=Nov 30 2021 @@@@@ [ 3.325130] usb 1-1.2: new full-speed USB device number 7 using dwc2 [ 3.335846] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.354877] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.360904] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.369415] exFAT: Version 1.2.9 [ 3.397120] jz_codec_register: probe() successful! [ 3.402863] cgu_set_rate, parent = 1392000000, rate = 2048000, n = 10875, reg val = 0x01002a7b [ 3.402876] cgu_enable,cgu_i2s_spk reg val = 0x21002a7b [ 3.402897] cgu_set_rate, parent = 1392000000, rate = 2048000, n = 10875, reg val = 0x01002a7b [ 3.402904] cgu_enable,cgu_i2s_mic reg val = 0x21002a7b [ 3.455020] usb 1-1.2: device descriptor read/64, error -12 [ 3.564781] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.570811] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.576855] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.655011] usb 1-1.2: device descriptor read/64, error -12 [ 3.805071] dma dma0chan24: Channel 24 have been requested.(phy id 7,type 0x06 desc a44cb000) [ 3.814175] dma dma0chan25: Channel 25 have been requested.(phy id 6,type 0x06 desc a474c000) [ 3.823365] dma dma0chan26: Channel 26 have been requested.(phy id 5,type 0x04 desc a2d24000) [ 3.839801] init [ 3.844336] jz_pwm_probe[255] d_name = tcu_chn0 [ 3.849369] usb 1-1.2: new full-speed USB device number 8 using dwc2 [ 3.856689] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.862721] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.869017] The version of PWM driver is H20180309a [ 3.880891] request pwm channel 0 successfully [ 3.886723] pwm-jz pwm-jz: jz_pwm_probe register ok ! [ 3.892830] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 3.906217] mmc1: new SDIO card at address 0001 [ 3.925277] usbcore: registered new interface driver usb_ch34x [ 3.931344] ch34x: USB to serial driver for USB to serial chip ch340, ch341, etc. [ 3.939857] ch34x: V1.16 On 2020.12.23 [ 3.975079] usb 1-1.2: device descriptor read/64, error -12 [ 4.084937] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 4.091704] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 4.098349] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 4.185030] usb 1-1.2: device descriptor read/64, error -12 [ 4.204775] [atbm_log]:rx timeout [ 4.375004] usb 1-1.2: new full-speed USB device number 9 using dwc2 [ 4.381574] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 4.475408] [atbm_log]:is registered as 'ALTOBEAM' [ 4.594789] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 4.804798] usb 1-1.2: device not accepting address 9, error -12 [ 4.885169] usb 1-1.2: new full-speed USB device number 10 using dwc2 [ 4.891825] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 5.114792] dwc2 dwc2: Sorry, SPLIT transfer is not supported! [ 5.324829] usb 1-1.2: device not accepting address 10, error -12 [ 5.347854] hub 1-1:1.0: unable to enumerate USB device on port 2 [ 7.463557] name : i2c0 nr : 0 [ 7.554982] i2c i2c-0: i2c_jz_irq 441, I2C transfer error, ABORT interrupt [ 7.562238] i2c i2c-0: --I2C txabrt: [ 7.565963] i2c i2c-0: --I2C TXABRT[0]=I2C_TXABRT_ABRT_7B_ADDR_NOACK [ 7.572535] error: sensor_read,285 ret = -5 [ 7.576880] sensor_read: addr=0x3107 value = 0x0 [ 7.581733] err sensor read addr = 0x3107, value = 0x0 [ 7.675313] sensor_read: addr=0xf0 value = 0x20 [ 7.680563] sensor_read: addr=0xf1 value = 0x53 [ 7.685345] info: success sensor find : gc2053 [ 7.689945] misc sinfo_release [ 7.782073] probe ok ------->gc2053 [ 7.855321] -----gc2053_detect: 1150 ret = 0, v = 0x20 [ 7.855815] -----gc2053_detect: 1156 ret = 0, v = 0x53 [ 7.855823] gc2053 chip found @ 0x37 (i2c0) version H20211111a [ 8.067229] gc2053 stream on [ 8.309500] cgu_set_rate, parent = 1392000000, rate = 4096000, n = 10875, reg val = 0x22002a7b [ 8.309512] codec_codec_ctl: set sample rate... [ 8.310076] codec_codec_ctl: set device... [ 8.724881] codec_set_device: set device: MIC... [ 8.777121] codec_codec_ctl: set repaly channel... [ 8.777168] cgu_set_rate, parent = 1392000000, rate = 4096000, n = 10875, reg val = 0x22002a7b [ 8.777176] codec_codec_ctl: set sample rate... [ 8.777496] codec_codec_ctl: set device... [ 9.014815] codec_set_device: set device: speaker... [ 9.022802] SPEAKER CTL MODE0 !

[ 25.058000] wz_user.sh done [root@WCV3:~]# `
gtxaspec commented 1 year ago

@skilau Looks like there is an internal USB hub, so SPOTLIGHT SERIAL IC -> USB-to-SERIAL IC -> USB HUB -> CAMERA

unfortunately for us, the DWC2 (usb2 driver) is really old and buggy, so it doesn't support the SPLIT USB High Speed transfer mode, used sometimes when you have a hub. We may be able to have it work by forcing the usb2 interface to full-speed, dthe down side is you will be limited to 12mbps, usb1.1 speeds ... I can post a kernel for you if you want to try.

The actual solution would be to backport a newer dwc2 driver from a newer kernel to ours. This may or may not work, i'm fairly certain the implementation is jz (ingenic) specific.

skilau commented 1 year ago

@gtxaspec Is the USB 1.1 speed just the connection to the Floodlight only? Or is it also the Cam -> Wifi also?

If it is just the Floodlight, 1.1 speed shouldn't really matter much, as there isn't much data going between them anyway. But if the 1.1 also would affect the Cam -> Wifi connection, yeah, that would not be good...

I can definitely give the new kernel a try, if it isn't too much of a hassle, at least we would know for sure if that fixes the problem or not.

Thanks!

gtxaspec commented 1 year ago

@skilau It will be all USB devices to the camera, we have to force the camera's USB 2.0 host controller to 1.1 speed.

The wifi runs off the SDIO bus, so it's unaffected.

kernel attached, rename it to the factory name.

kernel-t31.bin.gz

skilau commented 1 year ago

@gtxaspec Thanks!

I am now running with the new kernel, the dmesg logs look a whole lot cleaner, and indeed, the Floodlight is now seen properly. After running some quick tests turning it on and off, it looks good.

So that was definitely the issue and fix, thank you!

Of course, I am not sure of the way to ultimately resolve this, as most people would probably want High Speed USB.

gtxaspec commented 1 year ago

thanks for the feedback. I will look into the newer dwc2 drivers, and test to see if they compile on our kernel.

gtxaspec commented 1 year ago

@skilau can you share some logs? trying to figure out how the camera feeds audio to the floodlight speaker... lsusb if you can

skilau commented 1 year ago

@gtxaspec Sure! Sorry I missed this request earlier!

lsusb

Bus 001 Device 002: ID 05e3:0610 Bus 001 Device 001: ID 1d6b:0002 Bus 001 Device 003: ID 1b3f:2008 Bus 001 Device 004: ID 1a86:7523

gtxaspec commented 1 year ago

@skilau is this with no devices plugged into the camera?

can you also do logread | grep sound

skilau commented 1 year ago

@gtxaspec : Correct. I just have the Floodlight with the Cam only. No other devices plugged into the external USB port.

`

logread | grep sound

May 13 15:22:37 audiocardprocess: [soundcard_watchdog_init] ok TimerId:0 May 13 15:22:42 iCamera: soundcard_module_init Successfully May 13 15:22:45 audiocardprocess: [watchdog]dbg: soundcard_watchdog_snd_msg_feed [time:1652473365] May 13 15:22:46 iCamera: sound card feed watchdog success(feedWatchdogCount is 1) Jul 11 22:04:13 iCamera: automode:12 envDark:1 montionDark:2 soundDark:2 pir1 masterB:0 Jul 11 22:04:13 iCamera: {"mac":"77DD1D0E","softver":"1.0.0.55","realSwitch":"2","brightness":"255","mode":"3","PIR":"1","envDark":"1","montionDark":"2","soundDark":"2","durations":"15","PIRSensitivity":"255","PIRSilentTime":"1","PIRChoose":"224","ala Jul 11 22:04:23 audiocardprocess: [watchdog]dbg: soundcard_watchdog_snd_msg_feed [time:1657595063] Jul 11 22:04:23 iCamera: sound card feed watchdog success(feedWatchdogCount is 2) `

gtxaspec commented 1 year ago

@skilau interesting. We had an issue with the kernel and the new version of libcallback, iCamera was breaking sound because we were using the same pcm device for one of the alsa_loopback devices which was assigned to a "soundcard".

The ingenic device's use a custom OSS sound implementation, so there should be no concept of a soundcard in these devices...

Originally we thought to disable the whole soundcard_module_init function, which was a temporary solution, since the function is pretty big. Now we know why, the camera's support an external usb sound card, which the floodlight uses internally.

thanks for the info!

skilau commented 1 year ago

@gtxaspec Ah, I hadn't considered that. Now I had to go look up that USB id: "Generalplus Technology USB Audio Device"

I suppose that might make sense. I think the Audio is better on this compared to the regular Camera. And the Alarm on it is VERY loud. It is meant to scare people off, and it sure would once they hear it! :)

gtxaspec commented 1 year ago

you should try piping an mp3 radio station to it using cmd aplay...i wonder what speaker it will play from? lol

skilau commented 1 year ago

Ha, that is an interesting idea! PS: You should have heard it when I first set it up on Wyze! It screamed "READY TO CONNECT", and I swear the whole neighborhood could hear it!

gtxaspec commented 1 year ago

@skilau need some more logs when you get a chance:

--nevermind, still testing stuff--

gtxaspec commented 1 year ago

I see how this works on the stock kernel, all usb devices are limited to full-speed (12mbps) by default. This is how they have it working.

gtxaspec commented 1 year ago

@skilau just to test, does the floodlight's speaker work when you talk through the app? or use the siren?

skilau commented 1 year ago

@gtxaspec : I had honestly never triggered the alarm before, so I just tried it now! It does work, it does like a pretty loud Beep-Beep-Beep noise, and flashes the LED floodlights off and on.

dmesg shows: [82886.015402] SPEAKER CTL MODE3 ! [82888.196972] SPEAKER CTL MODE0 ! When I trigger the alarm (and turn it off)

gtxaspec commented 1 year ago

@skilau voice too? edit - i think it shouldn't, because we don't include sound card drivers in the kernel at the moment. I can't get it working with my USB sound card with our kernel, even with the right drivers, only with the stock kernel. If you can confirm that using the speak function in the app is working, with the audio coming out of the big speaker on the floodlight, that would just cause more confusion lol

I have ordered one but shipping is slow

skilau commented 1 year ago

@gtxaspec : Interestingly enough, it does! I hadn't tried it before, (I usually keep voice/speak off), but after turning it on, and speaking through my phone, I can hear it through the speakers on the Floodlight. Also went in into the recordings, and did a play back. My test speaking was recorded as well.

gtxaspec commented 1 year ago

@skilau really interesting. Can't wait to get mine to take it apart. I really have no use for the floodlight, but in pieces I do lol

gtxaspec commented 1 year ago

got my floodlight. It appears the serial adapter is a full-speed device, and the soundcard is a high-speed device, which is why audio works, but the floodlight control does not, unless we force the camera to full-speed.

gtxaspec commented 1 year ago

the solution I think is to patch the dwc2 driver, if there a low speed device somewhere on the bus detected, we must force the host controller to full-speed. if the device is removed, switch it back to full speed.

skilau commented 1 year ago

Ah, thanks for the info! I hadn't dug in deep enough to figure that out! Hopefully that patch isn't too difficult.

gtxaspec commented 1 year ago

no go so far. We are able to compile dwc2 as module, but it doesn't recognize the controller when you try to load it.

vic4news commented 1 year ago

Thanks for the status update.

sim4dim commented 1 year ago

Just wondering if there is any update? Got Floodlight and under 4.36.9.139 and latest wz_mini it is not working ...

charlesmkelley commented 1 year ago

@skilau It will be all USB devices to the camera, we have to force the camera's USB 2.0 host controller to 1.1 speed.

The wifi runs off the SDIO bus, so it's unaffected.

kernel attached, rename it to the factory name.

kernel-t31.bin.gz

Insanely stupid question, but what file in the directory am I replacing with this? Would love ot test out to see if this works. @skilau too, as it seems like you have it working?

sheilnaik commented 1 year ago

@skilau Can you confirm how you got the kernel updated with the file @gtxaspec attached? I am having the same issue. The slower USB speed with the patched kernel isn't a big deal as I just need to be able to turn the light on and off.

endertable commented 1 year ago

You should be able to extract the bin from kernel-t31.bin.gz, then replace the 'factory_t31_ZMC6tiIDQN' on the root of the SD card with it.

unibeck commented 1 year ago

we have to force the camera's USB 2.0 host controller to 1.1 speed

Is this something that can be added as config variable?

bberg115 commented 1 year ago

Weirdly I had access to flood light / PIR via WZ (not in wyze app) but it's no longer showing. Unsure what changed.

juichi commented 1 year ago

can confirm that with the attached kernel binary in this thread that the flood light works via the app now. I would like to investigate being able to command the light in the future.

xblackedemonx commented 1 year ago

@gtxaspec I also have the same issue with the floodlight. Is there any way you can include this fix in the official release? Thanks a lot.

bjmckay01 commented 11 months ago

@gtxaspec Just wanted to chime in and say I would also benefit from floodlight support. I put one up this weekend with plans for another soon.

GovSat1 commented 10 months ago

Any updates on this using the newer firmware?

loopy321 commented 9 months ago

I have installed the kernel from the above post and the floodlight turns on in the app, but turns off as soon as I navigate away. This is on firmware 4.36.8.15 and floodlight fw 1.0.0.52.

Am I missing something about how to get this working? Or can I help troubleshoot the kernel?

See the gist logfile below with the turn on and navigate away events annotated: https://gist.github.com/loopy321/b115a510421e48eb63fa180c206b0fb5

Thanks.

loopy321 commented 9 months ago

I have installed the kernel from the above post on a and the floodlight turns on in the app, but turns off as soon as I navigate away. This is on firmware 4.36.8.15 and floodlight fw 1.0.0.52.

It is possible that it works fine, but the light sensor was keeping it off. I'll test more and update.

bberg115 commented 9 months ago

Looks like the kernel posted above is working here. I copied over to the root and still have access to flood light in the app.

I will report back if I have any issues. Thanks for the awesome project.

loopy321 commented 9 months ago

I have installed the kernel from the above post on a and the floodlight turns on in the app, but turns off as soon as I navigate away. This is on firmware 4.36.8.15 and floodlight fw 1.0.0.52.

It is possible that it works fine, but the light sensor was keeping it off. I'll test more and update.

Got it working perfect now! Thanks for the excellent work here!!

matthew798 commented 8 months ago

@skilau It will be all USB devices to the camera, we have to force the camera's USB 2.0 host controller to 1.1 speed.

The wifi runs off the SDIO bus, so it's unaffected.

kernel attached, rename it to the factory name.

kernel-t31.bin.gz

I tried this kernel and though it worked, the camera was extremely slow. The go2rtc web interface took upwards of 15 seconds to load each page, and the official wyze app would show 1 or 2 frames before buffering for 30 seconds and repeating. This is the only issue preventing me from using the camera as I intended.

Can I help out by trying something else?

loopy321 commented 8 months ago

Anyone able to update the firmware on the PIR sensor? The PIR randomly turns the lights on without motion even when settings are all of minimum. I'm at 1.0.0.52 and have tried to update to 1.0.0.55 several times and it always fails.

loopy321 commented 8 months ago

@skilau It will be all USB devices to the camera, we have to force the camera's USB 2.0 host controller to 1.1 speed. The wifi runs off the SDIO bus, so it's unaffected. kernel attached, rename it to the factory name. kernel-t31.bin.gz

I tried this kernel and though it worked, the camera was extremely slow. The go2rtc web interface took upwards of 15 seconds to load each page, and the official wyze app would show 1 or 2 frames before buffering for 30 seconds and repeating. This is the only issue preventing me from using the camera as I intended.

Can I help out by trying something else?

My camera works very well with this firmware and is not slow at all. Do you maybe have a wifi issue?

xblackedemonx commented 8 months ago

You have to reduce the sensitivity of the PIR sensor by A LOT. Mine is set at 13%

On Wed, 8 Nov 2023 at 18:20, loopy321 @.***> wrote:

Anyone able to update the firmware on the PIR sensor? The PIR randomly turns the lights on without motion even when settings are all of minimum. I'm at 1.0.0.52 and have tried to update to 1.0.0.55 several times and it always fails.

— Reply to this email directly, view it on GitHub https://github.com/gtxaspec/wz_mini_hacks/issues/172#issuecomment-1802884051, or unsubscribe https://github.com/notifications/unsubscribe-auth/ARZVGAPHB3YDIWTDDPJW23LYDQHSJAVCNFSM53FZ45Z2U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCOBQGI4DQNBQGUYQ . You are receiving this because you commented.Message ID: @.***>

loopy321 commented 8 months ago

You have to reduce the sensitivity of the PIR sensor by A LOT. Mine is set at 13%

I have mine at 1% and it still triggers on nothing. If yours is working well, can you please tell me the firmware version of the Floodlight and your Camera?

xconverge commented 8 months ago

I wrote a little python app/docker container that exposes control of the floodlight over MQTT and utilizes https://github.com/SecKatie/ha-wyzeapi and fully disabled the PIR because it was so flaky. I now handle floodlight on/off with either frigate/camera detection or other door sensors/automations. I do keep an eye on this issue to see if I can easily move it to local control using hooks in the wz_mini_hacks firmware instead but haven't attempted to make that switch yet. Or if something related to the referenced kernel becomes more "official"

I am running the kernel above with no issues.

I did have issues with the camera stability and restarting (even on stock firmware) when it did not have a solid wifi signal, so I would look into improving the wifi signal if it is anything less than ideal and you are having issues.

here it is if anyone is interested, I am very happy with it vs stock, no support provided 😆 https://github.com/xconverge/wyze-python

Scags104 commented 7 months ago

thanks for the work here!

uploaded modified kernel to two floodlights. it works! but its definitely slower. any updates on potential improvements?

radredgreen commented 4 months ago

Hi @gtxaspec,

I'm working on adding USB to wyrecam and running into this same issue. What changes did you make to the kernel to force the camera's USB 2.0 host controller to 1.1 speed?

Thanks!

radredgreen commented 4 months ago

Answering my own question for posterity.

In my case br-ext-chip-ingenic/board/t31/kernel/t31.wyzec3.config needed this line added CONFIG_USB_DWC2_FULLSPEED_HOST=y

I also needed CONFIG_USB_ACM=m in the same file to compile cdc-acm.ko.