esp-hosted icon indicating copy to clipboard operation
esp-hosted copied to clipboard

wlan0 not brought up when running "bash rpi_init.sh spi"

Open markmusil opened this issue 1 year ago • 21 comments

Hardware

  • Raspberry pi 4B
  • Esp32-c6 development board

Problem I followed the instructions on this page and made it to step 2.1 and to the subsection titled "Setting up the environment and getting started". At this point I have run bash rpi_init.sh spi on my raspberry pi 4 which is wired up to the esp32-c6 (see attached photo). I am told that wlan0 will be brought up. This does not happen. There is, of course, the regular wifi radio station wlan0 that the raspberry pi provides. I figured this might cause a conflict (2 wlan0) so I ran sudo ifconfig wlan0 down before running bash rpi_init.sh spi but still no new wlan0 shows up.

Any ideas of where I could be going wrong? As you can see from the photo there is a 10k pull up resistor between SPI CE0 and 3.3V. Could this be my problem? thumbnail_IMG20240718130801

markmusil avatar Jul 18 '24 17:07 markmusil

Have tested on latest master?

mantriyogesh avatar Jul 18 '24 17:07 mantriyogesh

Yes, I pulled today. I am at commit number da21e36

markmusil avatar Jul 18 '24 17:07 markmusil

Which version of raspberry pi OS should I be using? Do you have a version number?

markmusil avatar Jul 18 '24 17:07 markmusil

Can you please attach full textual logs of:

  • host : Dmesg from system bootup
  • ESP log

mantriyogesh avatar Jul 18 '24 17:07 mantriyogesh

Which version of raspberry pi OS should I be using? Do you have a version number?

Just use master at both ESP and host side .

mantriyogesh avatar Jul 18 '24 17:07 mantriyogesh

Taken from the linux machine plugged into esp32-c6 via usb

complete-esp-log-jul18.txt

Taken from the host rpi4 connected to esp32-c6 via spi host_rpi4_dmesg_from_boot.log

markmusil avatar Jul 18 '24 17:07 markmusil

Need to get RPI log from start of the boot.

mantriyogesh avatar Jul 18 '24 17:07 mantriyogesh

Entire file is 81MB. Here is a onedrive link instead.

markmusil avatar Jul 18 '24 17:07 markmusil

Can you try FG master ESP and FG master kernel driver first?

mantriyogesh avatar Jul 18 '24 18:07 mantriyogesh

I am not sure, but something is really wrong even before using esp32 kernel module. Can you please attach :

  • /boot/config.txt or /boot/firmware/config.txt

Also, is this Raspberry Pi fresh installed? or any changes in kernel done? Is this Rpi flashed using default image or something else, for example?

mantriyogesh avatar Jul 19 '24 04:07 mantriyogesh

Can you try FG master ESP and FG master kernel driver first?

I will work on this.

Can you please attach /boot/config.txt

See attached

config.txt

is this Raspberry Pi fresh installed?

Yes I am using the latest raspberry pi 64 bit OS for Raspberry pi 4B with nothing else installed on the raspberry pi.

or any changes in kernel done?

No. I made sure to do what is shown on the guide here which is to say that I installed the raspberrypi-kernel-headers.

Is this Rpi flashed using default image or something else, for example?

Default Raspberry pi 4 OS

markmusil avatar Jul 19 '24 13:07 markmusil

When I try to run bash rpi_init.sh wifi=spi bt=spi from esp-hosted/esp-hosted-fg/linux/host_control/ I get the following error:

fatal error: protobuf-c/protobuf-c.h no such file or directory

I am going to build protobuf myself from scratch but I don't think this is what is supposed to happen.

markmusil avatar Jul 19 '24 13:07 markmusil

No no, you should not build it from scratch.

Just update the submodules recursively

mantriyogesh avatar Jul 19 '24 13:07 mantriyogesh

Screenshot_2024-07-19-21-35-10-065_com brave browser_beta

mantriyogesh avatar Jul 19 '24 13:07 mantriyogesh

What do you mean by

"Can you try FG master ESP and FG master kernel driver first?"

Are you suggesting that I switch to using FG? I want to use NG so that I can directly control the wifi interface using WPA_supplicant.

markmusil avatar Aug 08 '24 16:08 markmusil

So, even esp-hosted-fg isn't working. I ran the following command

./rpi_init.sh wifi=spi bt=spi

And got an error in line 165 of rpi_init.sh "5090 segmentation fault sudo rmod esp32_spi &> /dev/null"

Is there a possibility of doing a video call to address this directly? Or would you prefer to just continue with this ticket?

markmusil avatar Aug 08 '24 17:08 markmusil

Hello @markmusil ,

I regret the problem you faced.

Can you please send the full textual logs when you face this issue?

  • Host: dmesg from system bootup
  • Slave: idf.py monitor or uart/minicom logs ?

mantriyogesh avatar Aug 09 '24 06:08 mantriyogesh

  1. Logs related The Aug9_dmesg_raspi.txt log is not from start of the loading of Linux, so it is hard to understand where the issue started.

The log starts at [562.370665] time, I think your log is getting huge (due to crashes) and resulting in losing the log. Easy way, create a new terminal, and run on system bootup:

$ sudo dmesg -c
$ sudo dmesg -w # tail and follow the dmesg

before loading the esp32 kernel module

  1. Wrong firmware? Screenshot 2024-08-12 at 10 23 05 AM the firmware flashed seems to be SDIO, but you intend to use SPI. You can refer documentation to flash spi firmware.

  2. spidev was not removed: From your log, I see module linked in doesn't have esp32_spi. Also, there is entry of spidev Screenshot 2024-08-12 at 10 20 02 AM

The spidev was expected to be unloaded/removed for your /dev/spidev.<bus_instance>.<cs_instance> in the setup step at : https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_ng/host/rpi_init.sh#L168-L173

Can you please check why spidev was not removed?

mantriyogesh avatar Aug 12 '24 02:08 mantriyogesh

Would you recommend using a different raspberry pi?

Mark Musil | Embedded Systems Engineer

P (740) 703-2110

@.***

[cid:4d5847c6-8e33-47aa-a4f7-675bdcdfcba7]


From: Yogesh @.> Sent: Sunday, August 11, 2024 10:28 PM To: espressif/esp-hosted @.> Cc: Mark Musil @.>; Mention @.> Subject: Re: [espressif/esp-hosted] wlan0 not brought up when running "bash rpi_init.sh spi" (Issue #433)

  1. Logs related The Aug9_dmesg_raspi.txt log is not from start of the loading of Linux, so it is hard to understand where the issue started.

The log starts at [562.370665] time, I think your log is getting huge (due to crashes) and resulting in losing the log. Easy way, create a new terminal, and run on system bootup:

$ sudo dmesg -c $ sudo dmesg -w # tail and follow the dmesg

before loading the esp32 kernel module

  1. Wrong firmware? Screenshot.2024-08-12.at.10.23.05.AM.jpg (view on web)https://github.com/user-attachments/assets/cfcbb14a-9244-4188-9965-7a490608071b the firmware flashed seems to be SDIO, but you intend to use SPI. You can refer documentation to flash spi firmware.

  2. spidev was not removed: From your log, I see module linked in doesn't have esp32_spi. Also, there is entry of spidev Screenshot.2024-08-12.at.10.20.02.AM.jpg (view on web)https://github.com/user-attachments/assets/2636ebe6-34f4-4186-b628-44f8e7949925

The spidev was expected to be unloaded/removed for your /dev/spidev.<bus_instance>.<cs_instance> in the setup step at : https://github.com/espressif/esp-hosted/blob/6ddb670edcf15108be92d7e8e4fc6f32542ef5e4/esp_hosted_ng/host/rpi_init.sh#L168-L173

Can you please check why spidev was not removed?

— Reply to this email directly, view it on GitHubhttps://github.com/espressif/esp-hosted/issues/433#issuecomment-2283017477, or unsubscribehttps://github.com/notifications/unsubscribe-auth/BH26DUXUXGNGL4N74STURZ3ZRAMUZAVCNFSM6AAAAABLDCIWBSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDEOBTGAYTONBXG4. You are receiving this because you were mentioned.Message ID: @.***>

markmusil avatar Aug 12 '24 13:08 markmusil

Firmware here, I meant ESP chipset firmware you had used to flash in step (2).

Correct use of documentation would avoid any such issues.

mantriyogesh avatar Aug 12 '24 13:08 mantriyogesh