espressif / esp-hosted

Hosted Solution (Linux/MCU) with ESP32 (Wi-Fi + BT + BLE)
Other
706 stars 169 forks source link

When will esp_hosted_ng spi support AP mode #376

Open PercyHide opened 6 months ago

PercyHide commented 6 months ago

i need esp32 as a ap mode device,so i want to know When will esp_hosted_ng spi support AP mode,thank you.

mantriyogesh commented 6 months ago

We're working on adding softAP support for NG, but it'll take some time to merge it into the master branch. If you want to test it early, I've attached 2024.04.24_softap_patch.tgz for you to try. Please check the readme.txt for instructions.

PercyHide commented 6 months ago

We're working on adding softAP support for NG, but it'll take some time to merge it into the master branch. If you want to test it early, I've attached 2024.04.24_softap_patch.tgz for you to try. Please check the readme.txt for instructions.

Thank you very muck ,I will try it.

PercyHide commented 5 months ago

@mantriyogesh Hi , I download this patch,and try it ,but I get this log ,why esp32 init sta mode log in my linux host NUC980 image

log in esp32 image

mantriyogesh commented 5 months ago

@Shreyas0-7 , can you please check this?

Shreyas0-7 commented 5 months ago

Hey @kangpei1 default mode is sta mode you can start AP mode using hostapd

PercyHide commented 3 months ago

hi @Shreyas0-7 @mantriyogesh I have solved the linux host network init faild problem, I try start ap mode,but its not success.

1,my host.conf image 2,my linux log image

PercyHide commented 3 months ago

sorry for my mistake, I used mater so its not work, now I have creat a wifi ,but I cant connect it, this is my log in esp32 image

PercyHide commented 3 months ago

my linux log image

Shreyas0-7 commented 3 months ago

@PercyHide Is it possible for you to attach sniffer capture, also please post hostapd logs and dmesg logs

PercyHide commented 3 months ago

@Shreyas0-7 1,my linux log linux_log.txt 2,my host.conf image 3,my esp32 log image

PercyHide commented 3 months ago

i think i have the same problem with https://github.com/espressif/esp-hosted/issues/415. 1,when i used 2024.04.24_softap_patch.tgz ,i can have a wifi ,but i cant connect it. 2,when i used master , i can get wlan0, but i cant have a wifi. and i get the log image

mantriyogesh commented 3 months ago

Hello @PercyHide , I doubt your SPI porting has some issues. Porting is one time activity, which you would have already performed, but may still have done issues.

If you import selective code from https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_fg/esp/esp_driver/network_adapter/main/spi_slave_api.c#L637

does it help?

Please include this line and dependent code from FG file to ng file and reflash ESP and try again

mantriyogesh commented 3 months ago

What I meant, before evaluation of networking (be it sta or softap), I think it is worth to evaluate the underlying transport.

If above doesn't work, do you have logic analyser?

PercyHide commented 3 months ago

What I meant, before evaluation of networking (be it sta or softap), I think it is worth to evaluate the underlying transport.

If above doesn't work, do you have logic analyser?

i am sorry,i used esp_host_ng, and i dont have logic analyser.

PercyHide commented 3 months ago

the sta mode i used is ok ,and i want to confirm did the master have support soft ap mode?

PercyHide commented 3 months ago

@mantriyogesh I have a question

The v1.0.3 matser in esp_spi.c

funtion :static void esp_spi_work(struct work_struct *work)

hardware_type dont have be a value; its different in last version, so when i used v1.0.3 ,i cant get wlan0, my spi didt work normal because trans.cs_change didt be 1, when i Assign trans.cs_change value of 1, my spi work normal, i can get wlan0.

image

PercyHide commented 3 months ago

Hello @PercyHide , I doubt your SPI porting has some issues. Porting is one time activity, which you would have already performed, but may still have done issues.

If you import selective code from

https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_fg/esp/esp_driver/network_adapter/main/spi_slave_api.c#L637

does it help?

Please include this line and dependent code from FG file to ng file and reflash ESP and try again

i have try it , i also cant connect the ap

mantriyogesh commented 3 months ago

right, this message is not from transport, but from:

https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_ng/esp/esp_driver/network_adapter/main/cmd.c#L858

which is registered in slave only, https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_ng/esp/esp_driver/network_adapter/main/cmd.c#L926

I will leave @Shreyas0-7 to further check on this in the AP debug direction, as this frame is received from slave side Wi-Fi driver, as I can observe.

BTW, You can ignore https://github.com/espressif/esp-hosted/issues/376#issuecomment-2270264669

PercyHide commented 3 months ago

right, this message is not from transport, but from:

https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_ng/esp/esp_driver/network_adapter/main/cmd.c#L858

which is registered in slave only,

https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_ng/esp/esp_driver/network_adapter/main/cmd.c#L926

I will leave @Shreyas0-7 to further check on this in the AP debug direction, as this frame is received from slave side Wi-Fi driver, as I can observe.

BTW, You can ignore #376 (comment)

OK, Thank you , What can i do next?

mantriyogesh commented 3 months ago

@Shreyas0-7 PTAL..

Shreyas0-7 commented 3 months ago

@PercyHide Is it possible for you to capture sniffer?

PercyHide commented 3 months ago

@PercyHide Is it possible for you to capture sniffer?

Sorry , i cant

Shreyas0-7 commented 3 months ago

I suspect connection is not going through because RSN IE is not present in assoc req wlan0: STA 50:84:92:04:75:9f IEEE 802.11: authenticated wlan0: STA 50:84:92:04:75:9f IEEE 802.11: No WPA/RSN IE in association request To confirm this I might need sniffer capture

PercyHide commented 3 months ago

I suspect connection is not going through because RSN IE is not present in assoc req wlan0: STA 50:84:92:04:75:9f IEEE 802.11: authenticated wlan0: STA 50:84:92:04:75:9f IEEE 802.11: No WPA/RSN IE in association request To confirm this I might need sniffer capture

Maybe you can tell me ,what should i do.

Shreyas0-7 commented 3 months ago

Here are steps, can you please try this to capture sniffer If you are using a Windows machine, try: https://www.youtube.com/watch?v=As9BUoOMk_A If you are using an iOS machine, try: https://youtu.be/hxtgin0hgf8?si=nRvTdL24KiKHOPIs If you are using a Linux machine do iwconfig, and select interface which you are not using For example your interface is wlp0s20f3, try:

ifconfig wlp0s20f3 down iwconfig wlp0s20f3 mode monitor ifconfig wlp0s20f3 up iwconfig wlp0s20f3 channel 6 wireshark

Please note that a lot of WiFi cards (NIC) don't support putting them in monitor mode. So it is vital to check the compatibility of your laptop's NIC. Hope that helps.