On my device, with OpenWrt 23.05.2, and today updated feed, i have problem.
Computers connect, but new phones such as the samsung S24plus cannot connect.
It says unable to connect, or says nothing at all.
It did no good to put the fixed channel, the static ip in the phone, or to change other parameters.
Is there any known incompatibility problem?
brada4
July 28, 2024, 7:49am
2
Please connect to your OpenWrt device using ssh and copy the output of the following commands and post it here using the "Preformatted text </>
" button:
Remember to redact passwords, MAC addresses and any public IP addresses you may have:
ubus call system board
cat /etc/config/network
cat /etc/config/wireless
cat /etc/config/dhcp
cat /etc/config/firewall
2 Likes
this
BusyBox v1.36.1 (2023-12-03 22:43:19 UTC) built-in shell (ash)
_______ ________ __
| |.-----.-----.-----.| | | |.----.| |_
| - || _ | -__| || | | || _|| _|
|_______|| __|_____|__|__||________||__| |____|
|__| W I R E L E S S F R E E D O M
-----------------------------------------------------
OpenWrt 23.05.2 SNAPSHOT r24570-57d7382cb1
-----------------------------------------------------
GEVA BatteryPoE v5 December 06 2023
-----------------------------------------------------
Led & other scripts on /root/
started on HTML page -> System, Startup, Local Startup.root@GEVA_BatteryPoE_v5:~# ubus call system board
{
"kernel": "5.15.140",
"hostname": "GEVA_BatteryPoE_v5",
"system": "MediaTek MT7620A ver:2 eco:6",
"model": "GEVA Battery POE",
"board_name": "geva,batterypoe",
"rootfs_type": "squashfs",
"release": {
"distribution": "OpenWrt",
"version": "SNAPSHOT",
"revision": "r24570-57d7382cb1",
"target": "ramips/mt7620",
"description": "OpenWrt SNAPSHOT r24570-57d7382cb1"
}
}
root@GEVA_BatteryPoE_v5:~# cat /etc/config/network
config interface 'loopback'
option device 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fd89:25c3:b869::/48'
config device
option name 'br-lan'
option type 'bridge'
list ports 'eth0.1'
config interface 'lan'
option device 'br-lan'
option proto 'static'
option netmask '255.255.255.0'
option ip6assign '60'
option ipaddr '192.168.1.69'
option gateway '192.168.1.1'
list dns '192.168.1.1'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '1'
config switch_vlan
option device 'switch0'
option vlan '1'
option vid '1'
option ports '0 6t'
root@GEVA_BatteryPoE_v5:~# cat /etc/config/wireless
config wifi-device 'radio0'
option type 'mac80211'
option hwmode '11g'
option path 'platform/10180000.wmac'
option channel '6'
option txpower '10'
option cell_density '0'
option htmode 'HT20'
option legacy_rates '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option encryption 'none'
option ssid 'shop.gevaelettronica.it'
option disassoc_low_ack '0'
option short_preamble '0'
config wifi-device 'radio1'
option type 'mac80211'
option hwmode '11a'
option path 'platform/101c0000.ehci/usb1/1-1/1-1:1.0'
option htmode 'VHT80'
option noscan '1'
option channel 'auto'
option cell_density '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option encryption 'none'
option ssid 'GEVA_AC_5Ghz'
option disassoc_low_ack '0'
root@GEVA_BatteryPoE_v5:~# cat /etc/config/dhcp
config dnsmasq
option domainneeded '1'
option boguspriv '1'
option filterwin2k '0'
option localise_queries '1'
option rebind_protection '1'
option rebind_localhost '1'
option local '/lan/'
option domain 'lan'
option expandhosts '1'
option nonegcache '0'
option authoritative '1'
option readethers '1'
option leasefile '/tmp/dhcp.leases'
option resolvfile '/tmp/resolv.conf.d/resolv.conf.auto'
option nonwildcard '1'
option localservice '1'
option ednspacket_max '1232'
config dhcp 'lan'
option interface 'lan'
option start '100'
option limit '150'
option leasetime '12h'
option dhcpv4 'server'
option dhcpv6 'server'
option ra 'server'
list ra_flags 'managed-config'
list ra_flags 'other-config'
option ignore '1'
config odhcpd 'odhcpd'
option maindhcp '0'
option leasefile '/tmp/hosts/odhcpd'
option leasetrigger '/usr/sbin/odhcpd-update'
option loglevel '4'
root@GEVA_BatteryPoE_v5:~# cat /etc/config/firewall
config defaults
option input 'ACCEPT'
option output 'ACCEPT'
option forward 'REJECT'
option synflood_protect '1'
config include
option path '/etc/firewall.user'
root@GEVA_BatteryPoE_v5:~#
brada4
July 28, 2024, 7:09pm
4
It appears you are using firmware that is not from the official OpenWrt project.
When using forks/offshoots/vendor-specific builds that are "based on OpenWrt", there may be many differences compared to the official versions (hosted by OpenWrt.org ). Some of these customizations may fundamentally change the way that OpenWrt works. You might need help from people with specific/specialized knowledge about the firmware you are using, so it is possible that advice you get here may not be useful.
You may find that the best options are:
Install an official version of OpenWrt, if your device is supported (see https://firmware-selector.openwrt.org ).
Ask for help from the maintainer(s) or user community of the specific firmware that you are using.
Provide the source code for the firmware so that users on this forum can understand how your firmware works (OpenWrt forum users are volunteers, so somebody might look at the code if they have time and are interested in your issue).
If you believe that this specific issue is common to generic/official OpenWrt and/or the maintainers of your build have indicated as such, please feel free to clarify.
1 Like
brada4
July 28, 2024, 7:12pm
5
If it was generic OpenWRT - would be advisable to clear txpower restriction to take max of what radio supports and set country code for both radios in place of NOSCAN options.
Highly advisable to have both radios emit same access point and access credentials (none in your case) to have continuous coverage area.
It is a standard compilation of openwrt.
I just made a custom dts to handle leds and buttons, and ad vitriol settings.
The MT7620 only has a 2.5Ghz radio, the 5Ghz radio is a USB stick, normally not present.
The power has been reduced to reduce noise on the board.
However, this thing is used 1m away from the smartphone.
Even if I put the country, the problem is not solved.
I cannot use a pre-compilation.
I don't have a Samsung S24 ultra and I can't give a firmware without settings to the overseas customer.
brada4
July 28, 2024, 8:35pm
7
That makes you first and last support forum for the software, not us.
If you wish to make it official just submit https://openwrt.org/docs/guide-developer/add.new.device device support and all you have to do is to add uci-defaults script to set up "factory defaults" on reset.
I am sure the problem is the wifi driver.
How can I propose my dts to be added to managed models?
I produce two devices, with OpenWRT, with almost nothing custom.
Custom there is only the DTS, the configuration and some .sh scripts to control the LEDs.
I would like to include them in the official list.
I've been trying to find time for a year to study how github's pull/commit works, and I still haven't found it.
Is there an easier way?
brada4
July 30, 2024, 8:34am
9
Custom is xilinx sdk, looks like opensource mt76 driver. You need to build regdb signer key into kernel and sign regdb, or use default db from kernel.org with pre-builtin keys.
Try to explain better that I didn't understand.
The radio is inside the single chip MediaTek MT7620
I made:
git clone
add dts and other
make menuconfig
make
I add this file for mac:
\lib\wifi\mac80211.sh
maybe is old ?
#!/bin/sh
append DRIVERS "mac80211"
lookup_phy() {
[ -n "$phy" ] && {
[ -d /sys/class/ieee80211/$phy ] && return
}
local devpath
config_get devpath "$device" path
[ -n "$devpath" ] && {
for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
case "$(readlink -f /sys/class/ieee80211/$phy/device)" in
*$devpath) return;;
esac
done
}
local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
[ -n "$macaddr" ] && {
for _phy in /sys/class/ieee80211/*; do
[ -e "$_phy" ] || continue
[ "$macaddr" = "$(cat ${_phy}/macaddress)" ] || continue
phy="${_phy##*/}"
return
done
}
phy=
return
}
find_mac80211_phy() {
local device="$1"
config_get phy "$device" phy
lookup_phy
[ -n "$phy" -a -d "/sys/class/ieee80211/$phy" ] || {
echo "PHY for wifi device $1 not found"
return 1
}
config_set "$device" phy "$phy"
config_get macaddr "$device" macaddr
[ -z "$macaddr" ] && {
config_set "$device" macaddr "$(cat /sys/class/ieee80211/${phy}/macaddress)"
}
return 0
}
check_mac80211_device() {
config_get phy "$1" phy
[ -z "$phy" ] && {
find_mac80211_phy "$1" >/dev/null || return 0
config_get phy "$1" phy
}
[ "$phy" = "$dev" ] && found=1
}
detect_mac80211() {
devidx=0
config_load wireless
while :; do
config_get type "radio$devidx" type
[ -n "$type" ] || break
devidx=$(($devidx + 1))
done
for _dev in /sys/class/ieee80211/*; do
[ -e "$_dev" ] || continue
dev="${_dev##*/}"
found=0
config_foreach check_mac80211_device wifi-device
[ "$found" -gt 0 ] && continue
mode_band="g"
channel="11"
htmode=""
ht_capab=""
iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20
iw phy "$dev" info | grep -q '5180 MHz' && {
mode_band="a"
channel="36"
iw phy "$dev" info | grep -q 'VHT Capabilities' && htmode="VHT80"
}
[ -n "$htmode" ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode"
if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then
path="$(readlink -f /sys/class/ieee80211/${dev}/device)"
else
path=""
fi
if [ -n "$path" ]; then
path="${path##/sys/devices/}"
case "$path" in
platform*/pci*) path="${path##platform/}";;
esac
dev_id="set wireless.radio${devidx}.path='$path'"
else
dev_id="set wireless.radio${devidx}.macaddr=$(cat /sys/class/ieee80211/${dev}/macaddress)"
fi
uci -q batch <<-EOF
set wireless.radio${devidx}=wifi-device
set wireless.radio${devidx}.type=mac80211
set wireless.radio${devidx}.channel=${channel}
set wireless.radio${devidx}.hwmode=11${mode_band}
${dev_id}
${ht_capab}
set wireless.radio${devidx}.noscan=1
set wireless.default_radio${devidx}=wifi-iface
set wireless.default_radio${devidx}.device=radio${devidx}
set wireless.default_radio${devidx}.network=lan
set wireless.default_radio${devidx}.mode=ap
set wireless.default_radio${devidx}.ssid=OpenWrt
set wireless.default_radio${devidx}.encryption=none
EOF
uci -q commit wireless
devidx=$(($devidx + 1))
done
}
brada4
July 30, 2024, 9:19am
12
Ask xilinx to spoon-feed wifi basics. Wifi works on official openwrt.
brada4:
xilinx
There is nothing xilinx about this object.
I can't understand it.
There is only a mediatek CPU soldered on the PCB by me
brada4
July 30, 2024, 10:22am
14
I dont understand myself, i think i saw it somewhere else.
You need to add wireless regdb and set country code. It will start to work. Note rhe global domain by default has all world restrictions just to poc you can connect.
brada4:
regdb
If you mean this, it is already activated.
The customer tried setting the country code to Italy, and also the fixed channel to 6, but did not solve it.
This is my board, my design and my production.
Battery PoE and WiFi
gioreva
August 15, 2024, 10:46am
16
A customer solved the problem with this configuration.
Can you tell me which of these could be the resolution?
He had already tried setting the contry code to IT and it didn't solve it.
I also send it worldwide and find it difficult to set the country code.
Radio1 is a 5Ghz USB stick that had the same problem.
I also have a doubt about how I configure the mac, what is the correct way?
Original:
config wifi-device 'radio0'
option type 'mac80211'
option hwmode '11g'
option path 'platform/10180000.wmac'
option channel '6'
option txpower '10'
option cell_density '0'
option htmode 'HT20'
option legacy_rates '1'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option encryption 'none'
option ssid 'shop.gevaelettronica.it'
option disassoc_low_ack '0'
option short_preamble '0'
config wifi-device 'radio1'
option type 'mac80211'
option hwmode '11a'
option path 'platform/101c0000.ehci/usb1/1-1/1-1:1.0'
option htmode 'VHT80'
option noscan '1'
option channel 'auto'
option cell_density '0'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option encryption 'none'
option ssid 'GEVA_AC_5Ghz'
option disassoc_low_ack '0'
Solution:
config wifi-device 'radio0'
option type 'mac80211'
option hwmode '11g'
option path 'platform/10180000.wmac'
option channel '7'
option txpower '15'
option cell_density '1'
option htmode 'HT20'
option legacy_rates '1'
option country 'IT'
config wifi-iface 'default_radio0'
option device 'radio0'
option network 'lan'
option mode 'ap'
option encryption 'none'
option ssid 'shop.gevaelettronica.it'
option short_preamble '0'
option disassoc_low_ack '0'
config wifi-device 'radio1'
option type 'mac80211'
option hwmode '11a'
option path 'platform/101c0000.ehci/usb1/1-1/1-1:1.0'
option htmode 'VHT80'
option noscan '1'
option channel 'auto'
option cell_density '0'
option txpower '10'
config wifi-iface 'default_radio1'
option device 'radio1'
option network 'lan'
option mode 'ap'
option encryption 'none'
option ssid 'GEVA_AC_5Ghz'
option disassoc_low_ack '0'
option wmm '0'
list maclist 'BC:93:07:77:DA:A0'
Difference:
config wifi-device 'radio0'
option channel '7'
option txpower '15'
option cell_density '1'
option country 'IT'
config wifi-iface 'default_radio0'
config wifi-device 'radio1'
option txpower '10'
config wifi-iface 'default_radio1'
option wmm '0'
list maclist 'BC:93:07:77:DA:A0'
brada4
August 15, 2024, 11:08am
17
txpower is altered, wmm is disabled to return you back to wifi-G
What is the correct way to handle the MAC?
On the advice of a friend, I had added the file:
\lib\wifi\mac80211.sh
#!/bin/sh
append DRIVERS "mac80211"
lookup_phy() {
[ -n "$phy" ] && {
[ -d /sys/class/ieee80211/$phy ] && return
}
local devpath
config_get devpath "$device" path
[ -n "$devpath" ] && {
for phy in $(ls /sys/class/ieee80211 2>/dev/null); do
case "$(readlink -f /sys/class/ieee80211/$phy/device)" in
*$devpath) return;;
esac
done
}
local macaddr="$(config_get "$device" macaddr | tr 'A-Z' 'a-z')"
[ -n "$macaddr" ] && {
for _phy in /sys/class/ieee80211/*; do
[ -e "$_phy" ] || continue
[ "$macaddr" = "$(cat ${_phy}/macaddress)" ] || continue
phy="${_phy##*/}"
return
done
}
phy=
return
}
find_mac80211_phy() {
local device="$1"
config_get phy "$device" phy
lookup_phy
[ -n "$phy" -a -d "/sys/class/ieee80211/$phy" ] || {
echo "PHY for wifi device $1 not found"
return 1
}
config_set "$device" phy "$phy"
config_get macaddr "$device" macaddr
[ -z "$macaddr" ] && {
config_set "$device" macaddr "$(cat /sys/class/ieee80211/${phy}/macaddress)"
}
return 0
}
check_mac80211_device() {
config_get phy "$1" phy
[ -z "$phy" ] && {
find_mac80211_phy "$1" >/dev/null || return 0
config_get phy "$1" phy
}
[ "$phy" = "$dev" ] && found=1
}
detect_mac80211() {
devidx=0
config_load wireless
while :; do
config_get type "radio$devidx" type
[ -n "$type" ] || break
devidx=$(($devidx + 1))
done
for _dev in /sys/class/ieee80211/*; do
[ -e "$_dev" ] || continue
dev="${_dev##*/}"
found=0
config_foreach check_mac80211_device wifi-device
[ "$found" -gt 0 ] && continue
mode_band="g"
channel="11"
htmode=""
ht_capab=""
iw phy "$dev" info | grep -q 'Capabilities:' && htmode=HT20
iw phy "$dev" info | grep -q '5180 MHz' && {
mode_band="a"
channel="36"
iw phy "$dev" info | grep -q 'VHT Capabilities' && htmode="VHT80"
}
[ -n "$htmode" ] && ht_capab="set wireless.radio${devidx}.htmode=$htmode"
if [ -x /usr/bin/readlink -a -h /sys/class/ieee80211/${dev} ]; then
path="$(readlink -f /sys/class/ieee80211/${dev}/device)"
else
path=""
fi
if [ -n "$path" ]; then
path="${path##/sys/devices/}"
case "$path" in
platform*/pci*) path="${path##platform/}";;
esac
dev_id="set wireless.radio${devidx}.path='$path'"
else
dev_id="set wireless.radio${devidx}.macaddr=$(cat /sys/class/ieee80211/${dev}/macaddress)"
fi
uci -q batch <<-EOF
set wireless.radio${devidx}=wifi-device
set wireless.radio${devidx}.type=mac80211
set wireless.radio${devidx}.channel=${channel}
set wireless.radio${devidx}.hwmode=11${mode_band}
${dev_id}
${ht_capab}
set wireless.radio${devidx}.noscan=1
set wireless.default_radio${devidx}=wifi-iface
set wireless.default_radio${devidx}.device=radio${devidx}
set wireless.default_radio${devidx}.network=lan
set wireless.default_radio${devidx}.mode=ap
set wireless.default_radio${devidx}.ssid=OpenWrt
set wireless.default_radio${devidx}.encryption=none
EOF
uci -q commit wireless
devidx=$(($devidx + 1))
done
}
And DTS:
/dts-v1/;
#include "mt7620a.dtsi"
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
/ {
compatible = "geva,batterypoe", "ralink,mt7620a-soc";
model = "GEVA Battery POE";
chosen {
bootargs = "console=ttyS0,115200";
};
aliases {
label-mac-device = ðernet;
led-boot = &led_power;
led-failsafe = &led_power;
led-running = &led_power;
led-upgrade = &led_power;
};
leds {
compatible = "gpio-leds";
led_power: power {
label = "orange.power";
gpios = <&gpio0 9 GPIO_ACTIVE_LOW>;
};
eth {
label = "blue.eth";
gpios = <&gpio2 0 GPIO_ACTIVE_LOW>;
};
wifi {
label = "red.wifi";
gpios = <&gpio3 0 GPIO_ACTIVE_LOW>;
};
};
keys {
compatible = "gpio-keys-polled";
poll-interval = <20>;
reset {
label = "reset";
gpios = <&gpio0 1 GPIO_ACTIVE_LOW>;
linux,code = <KEY_RESTART>;
};
};
};
&gpio0 {
status = "okay";
};
&gpio2 {
status = "okay";
};
&gpio3 {
status = "okay";
};
//GPIO 9,14 are shared with UART Full, GPIO 72 - wlan LEDs (see datasheets)
//GPIO 1,2 are share with I2C
//so switch used gpio into gpio-mode:
&state_default {
gpio {
groups = "i2c", "wled", "uartf", "ephy";
function = "gpio";
};
};
//Your device use spi nor-flash 16MB, so enable spi-controller
//and describe your flash layout
&spi0 {
status = "okay";
flash@0 {
compatible = "jedec,spi-nor";
reg = <0>;
spi-max-frequency = <50000000>;
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
partition@0 {
label = "u-boot";
reg = <0x0 0x30000>;
read-only;
};
partition@30000 {
label = "u-boot-env";
reg = <0x30000 0x10000>;
read-only;
};
factory: partition@40000 {
label = "factory";
reg = <0x40000 0x10000>;
read-only;
};
partition@50000 {
compatible = "denx,uimage";
label = "firmware";
reg = <0x50000 0xfb0000>;
};
};
};
};
//We known that your board use USB 2.0, so enable it (USB 1.1 too)
&ehci {
status = "okay";
};
&ohci {
status = "okay";
};
//Enable eth and set MAC/switch defaults
ðernet {
nvmem-cells = <&macaddr_factory_28>;
nvmem-cell-names = "mac-address";
mediatek,portmap = "wllll";
};
//Enable build-in wifi
&wmac {
status = "okay";
//your factory is empty and data is incorrect
// ralink,mtd-eeprom = <&factory 0>;
};
&factory {
compatible = "nvmem-cells";
#address-cells = <1>;
#size-cells = <1>;
macaddr_factory_28: macaddr@28 {
reg = <0x28 0x6>;
};
};
I finally found a phone that does that problem.
I found that it was no configuration change that solved the problem.
I solved it by setting the gateway in the phone.
My device has no DHCP, to use it you set static IP in the phone.
Normally the phone associates, writing connected without internet.
On some recent phones, however, it doesn't stay associated, unless you set the IP of the device as gateway.
It seems that some versions of Android and perhaps IOS, if they can't find the gateway IP, refuse the connection.
Will there be a solution for this?
brada4
August 19, 2024, 9:17am
20
Ask google, most phones ask to stay connected, you need p2p aka wifi-direct to stay connected without prompt or int3rnet.