The sample is for connecting to an existing access point. I believed someone has already raised a question on how to create an access point on the endpoint device.
I cannot get the sample to run, the loop waiting for the connection flag runs forever. I use the TL-WN725N. Are there any restrictions like “don’t use the space character inside the SSID” or “don’t use WPA3” ?
I also just tried the USB host example, but the method Usbhost_OnConnectionChangedEvent is not triggered while plugging in the USB wifi dongle. It works for a USB memory stick, and also for a USB camera. Any hints?
Speculating a bit here but again, if it’s not a supported chipset, then the USB id would not be recognized and no driver would be triggered, and thus no connection event raised.
Yup, fair enough. @Designer had success with one of those models. I have only been able to get RTL8188’s to work so far. What does dmesg (from an ssh command prompt) have to say? It should tell you what happened when it found that USB device attached.
for example:
[ 0.288954] usbcore: registered new interface driver rtl8187
[ 0.289062] usbcore: registered new interface driver rtl8192cu
[ 0.289135] usbcore: registered new interface driver rtl8xxxu
Thank you for your help. Unfortunately I cannot connect via SSH - connection refused. Apple Silicon… or me
Finally I connected…
[ 0.099622] usbcore: registered new interface driver usbfs
[ 0.099703] usbcore: registered new interface driver hub
[ 0.099781] usbcore: registered new device driver usb
[ 0.279914] usbcore: registered new interface driver rtl8187
[ 0.280022] usbcore: registered new interface driver rtl8192cu
[ 0.280093] usbcore: registered new interface driver rtl8xxxu
[ 0.293144] usbcore: registered new interface driver uas
[ 0.293248] usbcore: registered new interface driver usb-storage
[ 0.484798] usbcore: registered new interface driver usbhid
And yes, there are a lot of lines containing “failed”, “missing”, “invalid”…
But I am not familiar with this kind of output, so it’s hard for me to decide whether these messages are fatal or not.
And, no worries wrt Apple Silicon. That’s what I’m running here too, brother
So, those are all good messages (same as on my system).
Couple things to try:
What are the error messages?
What happens if you ssh in and type: /usr/sbin/init_wifi.sh [ssid] [passphrase]? Be sure to use quotes around the arguments, such as: /usr/sbin/init_wifi.sh "my wifi" "mypassword". What errors are shown? You only need to provide the ssid and password once. After that they are saved and you can leave them off. Mine shows:
Found WiFi config...
Startig WiFi...
ln: /dev/rfkill: File exists
Successfully initialized wpa_supplicant
dhcpcd-9.4.1 starting
DUID 00:01:00:01:00:00:00:23:48:8f:4c:f1:6c:f9
wlan0: waiting for carrier
wlan0: carrier acquired
wlan0: connected to Access Point: vodafoneBA1048
wlan0: IAID 4c:f1:6c:f9
wlan0: adding address fe80::bfc4:5a13:5320:8a14
wlan0: soliciting an IPv6 router
wlan0: rebinding lease of 192.168.0.19
wlan0: NAK: from 192.168.0.1
wlan0: soliciting a DHCP lease
wlan0: offered 192.168.0.18 from 192.168.0.1
wlan0: probing address 192.168.0.18/24
wlan0: leased 192.168.0.18 for 86400 seconds
wlan0: adding route to 192.168.0.0/24
wlan0: adding default route via 192.168.0.1
forked to background, child pid 443
If the previous step shows no errors, then what does ifconfig (again, from the # prompt) tell you? In addition to lo and usb0, it should show something like:
Of course, this all should work from dotnet code. The above is just some necessary debugging to figure out why it isn’t working from you. A good day is any day where you don’t have to drop down into a shell prompt.
No carrier means that wifi is working, but has not successfully associated with an AP. This can happen if your AP supports both 2.4 and 5GHz on the same SSID and auto-promotes connections to 5Ghz, or if you get the SSID or password wrong.
RTL8188 are 2.4Ghz-only radios, so if you have 2.4GHz and 5Ghz AP set up with the same ssid for both bands, then you either need to turn off 5Ghz promotion (how to do that varies by manufacturer), or disable 5Ghz (sad gamer face), or name the 2.4 and 5 Ghz with different SSIDs, or target a 2.4Ghz AP.
And, of course, make sure the SSID and password are correct.
Hi, could you take picture of your WiFi box? We have one here that doesn’t work with one of our routers but connect to different router it works. We use Phone WiFi hotspot it still doesn’t work. We though this WiFi is bad and ignore it. We would like to know if they are same exactly.
Also, could you try flash the image again with a diffierent SD card? The WiFi is controlled by multiple drivers and somehow one of them broken then WiFi drivers is not loaded fully, usually happened if the SD becomes bad. That is why the flashing image application usually has “check” feature after writing.
[ 7.961890] RTW: rtl8188eu v5.2.2.4_25483.20171222
[ 7.999318] RTW: hal_com_config_channel_plan chplan:0x22
[ 8.000375] RTW: rtw_regsty_chk_target_tx_power_valid return false for band:0, path:0, rs:0, t:-1
[ 8.001464] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001496] RTW: unsupported channel: 114 at 5G
[ 8.001511] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001527] RTW: unsupported channel: 114 at 5G
[ 8.001541] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001556] RTW: unsupported channel: 114 at 5G
[ 8.001671] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001687] RTW: unsupported channel: 114 at 5G
[ 8.001701] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001717] RTW: unsupported channel: 114 at 5G
[ 8.001730] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001746] RTW: unsupported channel: 114 at 5G
[ 8.001861] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001877] RTW: unsupported channel: 114 at 5G
[ 8.001891] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001906] RTW: unsupported channel: 114 at 5G
[ 8.001920] RTW: Invalid Channel 114 of Band 1 in phy_GetChannelIndexOfTxPowerLimit
[ 8.001936] RTW: unsupported channel: 114 at 5G
[ 8.008036] usbcore: registered new interface driver rtl8188eu
[ 9.457309] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.457663] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.457912] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.458162] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.458414] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.458662] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.458912] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.459162] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.459412] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.459662] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.459912] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.460162] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.460414] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.460662] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.460913] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.461162] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.461412] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.461662] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.461912] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 9.462162] RTW: Invalid Channel 0 of Band 0 in phy_GetChannelIndexOfTxPowerLimit
[ 12.225445] RTW: rtw_set_802_11_connect(wlan0) fw_state=0x00000000
[ 12.252109] RTW: start auth
[ 12.254817] RTW: auth success, start assoc
[ 12.362631] RTW: send eapol packet
[ 12.495647] RTW: send eapol packet
[ 12.496215] RTW: set pairwise key camid:4, addr:0c:0e:76:d4:b6:09, kid:0, type:AES
[ 12.496873] IPv6: ADDRCONF(NETDEV_CHANGE): wlan0: link becomes ready
[ 12.499433] RTW: set group key camid:5, addr:0c:0e:76:d4:b6:09, kid:1, type:TKIP
[ 12.558006] 8021q: 802.1Q VLAN Support v1.8