espressif / esp-hosted

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

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

Open markmusil opened 4 months ago

markmusil commented 4 months ago

Hardware

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

mantriyogesh commented 4 months ago

Have tested on latest master?

markmusil commented 4 months ago

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

markmusil commented 4 months ago

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

mantriyogesh commented 4 months ago

Can you please attach full textual logs of:

mantriyogesh commented 4 months ago

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 .

markmusil commented 4 months ago

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

mantriyogesh commented 4 months ago

Need to get RPI log from start of the boot.

markmusil commented 4 months ago

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

mantriyogesh commented 4 months ago

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

mantriyogesh commented 4 months ago

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

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?

markmusil commented 4 months ago

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 commented 4 months ago

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.

mantriyogesh commented 4 months ago

No no, you should not build it from scratch.

Just update the submodules recursively

mantriyogesh commented 4 months ago

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

markmusil commented 3 months ago

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 commented 3 months ago

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

_./rpiinit.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?

mantriyogesh commented 3 months ago

Hello @markmusil ,

I regret the problem you faced.

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

markmusil commented 3 months ago

idfPYmonitor.txt

Aug9_dmesg_raspi.txt

mantriyogesh commented 3 months ago
  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._._ 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?

markmusil commented 3 months ago

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.. 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: @.***>

mantriyogesh commented 3 months ago

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

Correct use of documentation would avoid any such issues.