openmiko / openmiko

Open source firmware for Ingenic T20 based devices such as WyzeCam V2, Xiaomi Xiaofang 1S, iSmartAlarm's Spot+ and others.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AES/CCMP vs. ap_scan vs. 8189fs scan_ch_ms

bill-mcgonigle opened this issue · comments

I decided to hunt down why my interactive ssh was so slow (remote echo like a 300-baud modem) and the camera would drop off of wifi for several seconds at a time.

It always happened after:

[   62.945823] RTL871X: set pairwise key camid:4, addr:0e:ec:da:aa:bb:66, kid:0, type:AES
[   62.968642] RTL871X: set group key camid:5, addr:0e:ec:da:aa:bb:66, kid:1, type:AES

from my wpa_supplicant.conf:

ap_scan=1
bgscan="simple:30:-45:300"

network={
...
        pairwise=CCMP
        group=CCMP

(TKIP not allowed on this network).

I modified S35wifi like:

         modprobe $WIFI_MODULE
+         echo '0 255 255' > /proc/net/rtl8189fs/wlan0/scan_param

based on a bug report from a similar rtl driver and the problem went away.

I'm not sure what the downsides would be of making this default so I'm mostly posting this here for others' feedback at this point. My network performance is back to the 21st century with this setting.

I have a similar wireless setup (CCMP, no TKIP). Under stock settings I basically don't have a connection to the camera. Frequent dropouts, high latency. Can't keep a SSH session going for more than a minute. On the same exact camera the dafang hacks firmware has zero trouble-- so I doubt it is a interference/signal problem.

This tweak has greatly improved (but not completely fixed) the stability issue. There's still a fair amount of dropouts and latency but the camera is at least somewhat usable. The video feeds still end up failing every few minutes.

As someone not having issues other than occasional drops, testing this to see if it has any deleterious effects on other setups.

I have similar issue on my variant of Openmiko (https://github.com/schneemaier/yacam). So far i resolved it with runing a simple ping command to the router, which basically eliminated the issue. I am going to test if this suggestion improves the situation so I can deprecate the ping script.

@bill-mcgonigle can you provide some reference where you found this suggestion?

@schneemaier I'm not seeing that I saved a note - it was probably this since I'm not finding it elsewhere:

tomaspinho/rtl8821ce#143 (comment)

If I'm reading this
https://github.com/RinCat/RTL88x2BU-Linux-Driver/blob/master/hal/hal_dm_acs.h#L101
right, scan_ch_ms being set to 0 disables automatic channel selection.

I think that's the wifi device spending some time searching for another ap on other channels with the valid ssid, which makes sense for roaming devices. It probably only helps a camera in the case where a new AP is added closer to the camera. But maybe just reboot the camera in that rare case? Defaults should be for the common scenario.

I can imagine that the radio might not be able to rx/tx while it's busy scanning. That's what it seems like is happening, anyway.

I am speculating here but if that's all true we'd want this to be the default setting. Perhaps WIFI_ALLOW_SCANNING=1 could revert to the current shipped behavior? Hey, an openmiko could be on top of a roaming robot or something!