getting the wifi to work on Lichee Pi Nano


#1

Hi,
What are the steps to get the wifi working on Lichee Pi Nano? i have the wifi extension plugged in the micro SD socket. The board is loaded with the default flash image it was shipped with, at boot it display a logo on LCD (but tty is not redirected to LCD) and there is a prompt on uart. I can log-in with root / licheepi. The boot log is short (3.8 second), so apparently not much is loaded.
I just want to get wifi working so i can go ahead and install littlevGL which is the goal here.

I have found a “wifi” .bin image, i tried to install it on an SD card with DD ( sudo dd if=/Nano_flash_800480.bin of=/dev/disk0s1 && sync ) after formatting the card as FAT with MBR in the OSX disk utility, the DD command worked fine however when i try to boot on SD card it never loads, stuck on :

U-Boot SPL 2018.01-05677-gd1f02066e3-dirty (Aug 25 2018 - 10:40:35)
DRAM: 32 MiB
Trying to boot from MMC1 

anyway, even if it booted with SD card it would not be a solution to get the wifi because when the SD card is installed obviously the wifi extension cannot be connected. So i wonder how to proceed.

Since there is no ethernet port i cannot use TFTP and u-boot menu to load the “wifi” image into flash, as i do with other platoforms (MT7628 for example), so i really wonder how it should be done, any help will be much appreciated.

EDIT: i loaded the “wifi” image into a blank flash (externally) and replaced the onboard flash with it, so now the lichee pi nano is running the “wifi” image, i also loaded the esp8089 driver, i can see the wlan0 interface, and access the wpa_supplicant.conf in /etc/. At this point i am not clear on what should be written in this file and more important, the ifup wlan0 command doesnt work apparently:

# ip a
1: lo: <LOOPBACK> mtu 65536 qdisc noop qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
# modprobe esp8089
[  498.375433] esp8089: module is from the staging directory, the quality is unknown, you have been warned.
[  498.391214] 
[  498.391214] ***** EAGLE DRIVER VER:bdf5087c3deb*****
[  498.391214] 
[  498.399440] show_esp_init_table: esp_init_table[0] attr[crystal_26M_en] offset[48] value[1]
[  498.407858] show_esp_init_table: esp_init_table[1] attr[test_xtal] offset[49] value[0]
[  498.415755] show_esp_init_table: esp_init_table[2] attr[sdio_configure] offset[50] value[2]
[  498.424128] show_esp_init_table: esp_init_table[3] attr[bt_configure] offset[51] value[0]
[  498.432323] show_esp_init_table: esp_init_table[4] attr[bt_protocol] offset[52] value[0]
[  498.440428] show_esp_init_table: esp_init_table[5] attr[dual_ant_configure] offset[53] value[0]
[  498.449137] show_esp_init_table: esp_init_table[6] attr[test_uart_configure] offset[54] value[2]
[  498.457927] show_esp_init_table: esp_init_table[7] attr[share_xtal] offset[55] value[0]
[  498.465908] show_esp_init_table: esp_init_table[8] attr[gpio_wake] offset[56] value[0]
[  498.473836] show_esp_init_table: esp_init_table[9] attr[no_auto_sleep] offset[57] value[0]
[  498.482110] show_esp_init_table: esp_init_table[10] attr[speed_suspend] offset[58] value[0]
[  498.495469] esp_sdio_dummy_probe enter
[  498.717895] esp_sdio_init power up OK
[  499.170796] esp_host:bdf5087c3deb
[  499.170796] esp_target: e826c2b3c9fd 57 18202
[  499.170796] 
[  499.180274] first normal exit
[  499.183566] esp_sdio_remove enter
[  499.187253] sif_disable_irq release irq failed
[  499.308265] eagle_sdio: probe of mmc0:0001:1 failed with error -110
# [  499.368414] mmc0: card 0001 removed
[  499.423746] mmc0: queuing unknown CIS tuple 0x01 (3 bytes)
[  499.436582] mmc0: queuing unknown CIS tuple 0x1a (5 bytes)
[  499.446320] mmc0: queuing unknown CIS tuple 0x1b (8 bytes)
[  499.454255] mmc0: queuing unknown CIS tuple 0x80 (1 bytes)
[  499.461111] mmc0: queuing unknown CIS tuple 0x81 (1 bytes)
[  499.466711] mmc0: queuing unknown CIS tuple 0x82 (1 bytes)
[  499.473465] mmc0: new high speed SDIO card at address 0001
[  499.852771] esp_host:bdf5087c3deb
[  499.852771] esp_target: e826c2b3c9fd 57 18202
[  499.852771] 

# ip a
1: lo: <LOOPBACK> mtu 65536 qdisc noop qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: wlan0: <BROADCAST,MULTICAST> mtu 1500 qdisc noop qlen 1000
    link/ether ac:d0:74:07:dc:97 brd ff:ff:ff:ff:ff:ff
# wpa_cli
-sh: wpa_cli: not found
# iwlist scan | grep ESSID
lo        Interface doesn't support scanning.

wlan0     Interface doesn't support scanning : Network is down

# ifup wlan0
ifup: can't open '/etc/network/interfaces': No such file or directory
#

What should i do from here? i want to enter the SSID, password and enable the wifi.


#2

hi, please use wpa_supplicant to use wifi
and you can use sunxi-fel to update flash, not sloder it…


#3

HI,
Thank you for the reply, right i saw sunxi-fel but i failed to use it because i dont know what is the trigger key for it, can you describe the procedure to launch sunxi-fel on the lichee pi nano?
i mean, what is the procedure to start the lichee pi nano in DFU mode, so that the sunxi-fel utility can recognize it. I tried to boot with each of the 4 tact switch pressed but it never went into DFU mode.
thank you.

EDIT:
Right, apparently there is no trigger key and we have to short manually the CS pin of the flash to GND(?) that is, short pin 1 to 4, well… I did that and indeed the DFU mode was triggered. Then i refered to this paper : http://nano.lichee.pro/step_by_step/two_sunxi-tools.html
Warning : the commands shown in this paper are wrong, i had to dig into the source of sunxi-fel tool to find that write and read commands are actually spiflash-read and spiflash-write. It would be a good idea to correct this paper, provided that the documentation is already loose and sparse, if it is also wrong then it become quite difficult to achieve anything.