0

I have been following 3 sources below where I could set up my Raspberry Pi zero with Wifi using ESP-01 (ESP8266) but am still struggling to get it working.

  1. Wifi configuration 1
  2. Wifi configuration 2
  3. Hardware connection

Eventually, I ended up using the approach shown in 2 where the wifi connection is defined (SSID, PSK etc) in wpa_supplicant.conf instead of defined in /etc/network/interfaces that has been proposed in 1. What I did as well was to move the wpa_supplicant.conf file in /boot directory instead of in the default directory SETTING and I don't think that would make any difference. Also, as per the hardware connection, I followed 3.

At the moment, I keep on getting the error message below:

ssh: Could not resolve hostname raspberrypi.local: Name or service not known

after executing the command below in order to access the Pi:

ssh pi@raspberrypi.local

Another concern is about dtbo file (one that resides in /boot/overlays directory) for ESP8266, do I need one? If so, is there I can find it?

EDITED:

  • Host OS: Ubuntu 16.04
  • OS on Raspi zero: Raspbian
  • ip address returns:
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
   valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
   valid_lft forever preferred_lft forever

4: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
link/ether 44:1c:a8:e3:c6:09 brd ff:ff:ff:ff:ff:ff
inet 192.168.1.160/24 brd 192.168.1.255 scope global dynamic wlp2s0
   valid_lft 42797sec preferred_lft 42797sec
inet6 fd7d:42cf:4a81::10e/128 scope global dynamic
   valid_lft 86001sec preferred_lft 86001sec
inet6 fd7d:42cf:4a81:0:6f11:f3c8:5fcd:69f3/64 scope global noprefixroute dynamic
   valid_lft 6800sec preferred_lft 1400sec
inet6 fe80::f13b:c028:5e97:d65b/64 scope link
   valid_lft forever preferred_lft forever
  • ip route returns:
default via 192.168.1.1 dev wlp2s0  proto static  metric 600
169.254.0.0/16 dev wlp2s0  scope link  metric 1000
192.168.1.0/24 dev wlp2s0  proto kernel  scope link  src 192.168.1.160  metric 600
  • iw wlan0 link returns usage info as wlan0 couldn't be found
  • ssh -v pi@192.168.1.160 returns:
OpenSSH_7.2p2 Ubuntu-4ubuntu2.8, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /home/alfa/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to 192.168.1.160 [192.168.1.160] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/alfa/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
debug1: Remote protocol version 2.0, remote software version OpenSSH_7.2p2 Ubuntu-4ubuntu2.8
debug1: match: OpenSSH_7.2p2 Ubuntu-4ubuntu2.8 pat OpenSSH* compat 0x04000000
debug1: Authenticating to 192.168.1.160:22 as 'pi'
debug1: SSH2_MSG_KEXINIT sent
debug1: SSH2_MSG_KEXINIT received
debug1: kex: algorithm: curve25519-sha256@libssh.org
debug1: kex: host key algorithm: ecdsa-sha2-nistp256
debug1: kex: server->client cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: kex: client->server cipher: chacha20-poly1305@openssh.com MAC: <implicit> compression: none
debug1: expecting SSH2_MSG_KEX_ECDH_REPLY
debug1: Server host key: ecdsa-sha2-nistp256 SHA256:FJdiiwb9zKALjlyyqX7bhdfdnGlmJU52FNDN9jjP1Eo
debug1: Host '192.168.1.160' is known and matches the ECDSA host key.
debug1: Found key in /home/alfa/.ssh/known_hosts:2
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_NEWKEYS sent
debug1: expecting SSH2_MSG_NEWKEYS
debug1: SSH2_MSG_NEWKEYS received
debug1: rekey after 134217728 blocks
debug1: SSH2_MSG_EXT_INFO received
debug1: kex_input_ext_info: server-sig-algs=<rsa-sha2-256,rsa-sha2-512>
debug1: SSH2_MSG_SERVICE_ACCEPT received
debug1: Authentications that can continue: publickey,password
debug1: Next authentication method: publickey
debug1: Trying private key: /home/alfa/.ssh/id_rsa
debug1: Trying private key: /home/alfa/.ssh/id_dsa
debug1: Trying private key: /home/alfa/.ssh/id_ecdsa
debug1: Trying private key: /home/alfa/.ssh/id_ed25519
debug1: Next authentication method: password
pi@192.168.1.160's password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
pi@192.168.1.160's password: 
debug1: Authentications that can continue: publickey,password
Permission denied, please try again.
pi@192.168.1.160's password: 
debug1: Authentications that can continue: publickey,password
debug1: No more authentication methods to try.
Permission denied (publickey,password).
  • 2
    You have 3 links but haven't explained what YOU did. No one should be expected to sit through youtube to guess. We don't even know what OS or what you are using to connect. – Milliways Oct 29 '19 at 4:38
  • 1
    @alfa_80, Ah, let me see. Your three tutorials are OK, and your final choice of (2) is good. And if you follow (2), then you don't need (1), which is a bit out of date. I sat through (2) and find the guy Macgyver as good as usual (I am his huge fan!) His stuff is 2019 feb, so should be more or less updated (though I prefer buster). You need (3) to talk to ESP8266. However, this (3) is 4 years old, so we need to check carefully if there are things outdated. / to continue, ... – tlfong01 Oct 29 '19 at 4:57
  • 1
    @alfa_80, Just now I skimmed the JeeLab pages that you will be following. I found the JeeLab guy seems retired, because his most recent blog post is 4 years old, and also his "JeeLab Esp8266 Link", also 4 years ago (though regularly updated, until 3 months ago.) Anyway, I will skim though it and see if they are OK. Lunch time. See you later! Cheers. (1) About JeeLabs - JeeLabs 2015 (most recent post) jeelabs.org/about (2) JeeLab Esp Link - jeeLab 2019july (last update) jeelabs/esp-link – tlfong01 Oct 29 '19 at 5:17
  • 1
    @alfa_80, Before I go, just to make sure, have you followed the tutorial and "grabed the JeeLab's esp8266-link firmware, and flashed it on your ESP8266"? Without the firmware, you won't do anything! :) – tlfong01 Oct 29 '19 at 5:27
  • 1
    Let us continue this discussion in chat. – tlfong01 Oct 29 '19 at 7:15
1

From the information you have given so far it seems that the RasPi has a working WiFi interface wlp2s0. As shown by ip addr it has a dynamic ip address 192.168.1.160/24 that is usually given by a DHCP server on the network. So it must be connected to a remote access point and everything is good. The command iw wlp2s0 link would give us more details about the wifi connection. If you try from your host

host ~$ ssh pi@192.168.1.160

then it should do. From the debug output of ssh-v you have given in the question I can see that everything is working as expected. ssh tries Authentications that can continue: publickey,password. With publickey authentication you need the private key file on the ubuntu host but as shown there is no one (Trying private key: /home/alfa/.ssh/id_rsa, ../id_dsa, ../id_ecdsa, ../id_ed25519 but not found). Now Next authentication method: password. You tried to enter a wrong password three times, then ssh gives up.

Please use the right password to login. It is the same password that you use to login on the console. The default password from installation is raspberry. Have you tried that?

  • Thank you for your clarification. I didn't realize that OP's WiFi controller module ESP-01 is Domoticx's toy, with preflashed firmware to immediately talk to Ubantu host. I think now it is a RpiZW and ESP8266-01 communication problem. JeeLab Rpi ESP serial link firmware might might make the job very simple, except it cannot sit in ESP's flash together with the Domoticx stuff already there. I would suggest OP to forget JeeLab and chk out Domoticx (already talking with the host Ubantu) tools for RpiZW. Just brainstorming - me no experience with Domoticx! :) – tlfong01 Oct 31 '19 at 1:14
  • @Ingo: Thanks Ingo for the answer. Just I'm yet to get it connected. It is now keep failing the authentication ("pi@192.168.1.160's password:") by returning "Permission denied, please try again." when I entered the password of "raspberry". Anyidea that I can try? Thanks. – alfa_80 Oct 31 '19 at 2:18
  • Eventually, when after several attempts failed, it returns "Permission denied (publickey,password). " – alfa_80 Oct 31 '19 at 2:48
  • How do you login on the console with keyboard/monitor? Do you use pi/raspberry? Get more information from ssh with option -v: ssh -v pi@192.168.1.160. – Ingo Oct 31 '19 at 8:56
  • I login with keyboard only (headless). I'm using raspberry pi zero anyway..the output with -v will come very soon – alfa_80 Oct 31 '19 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.