How can i do headless setup?

I’m trying to install this ubuntu server 16.04 distro in headless mode using wifi and ssh:

m2 Zero doesnt connect to the WiFi

/etc/wpa_supplicant/wpa_supplicant.conf:

network={
    ssid="name"
    scan_ssid=1
    key_mgmt=WPA-PSK
    psk="12345678"
    proto=RSN
}

/etc/network/interfaces:

auto wlan0
allow-hotplug wlan0
no-auto-down wlan0
iface wlan0 inet dhcp

wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Hello, did you see here for wifi sta configuration?

http://wiki.banana-pi.org/Getting_Started_with_M2_Zero#WiFi_Client

if you still could not connect your ap, please check two things:

  1. did you connect antenna?

  2. did you update the ap6212 firmware?

    link: BananaPi BPI-M2Z & BPI-P2 Zero(H2+) New Images Reapbian9.4 & Ubuntu16.04 Release 2019-04-30

Here is my /etc/wpa_supplicant/wpa_supplicant.conf now:

network={    
ssid="myssid"    
psk="mypass"    
priority=1 
}
  1. I dont have antenna
  2. I updated it, still nothing

when you execute the command: “wpa_supplicant -iwlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf” , what’s the log?

and I think if you could connect antenna, it would be better.