Figured how to do it on boot, add this script to
/etc/network/if-up.d/
And don´t forget to set exec permissions:
chmod +x /etc/network/if-up.d/powersave_off (or whatever name you put to it)
set -e
# Don't bother for loopback
if [ "$IFACE" = lo ]; then
exit 0
fi
# Only run from ifup.
if [ "$MODE" != start ]; then
exit 0
fi
# Only do it once (skip for inet6).
if [ "$ADDRFAM" != inet ]; then
exit 0
fi
/sbin/iw dev wlan0 set power_save off
exit 0
I found the solution here: GitHub - fordsfords/wlan_pwr: Improve CHIP wireless perf and reliability by turning off power mgt