7 Replies Latest reply on Feb 18, 2016 2:36 PM by CMata_Intel

    Problem SSHing to Edison via Hostname after clone

    TheNextEdison

      So after cloning my first Edison (successfully :-)) I changed my hostname of the new Edison using the "configure_edison --setup" command. Everything was working great and I was able to SSH to both devices using their hostnames instead of their IP.

       

      But after having both devices on the same network at the same time I think something screwy happened to my /etc/hosts file.. On both Edison's (hostnames ClayEdison & ClayEdison2) some lines appear to have been removed from this file.

       

      All that the /etc/hosts file is now showing is:

      127.0.0.1          localhost.localdomain          localhost

       

      And I know there is supposed to be more here.. I have tried a number of different things trying to replicate how the file used to look with no success. Say my IP for hostname ClayEdison is 192.168.1.103 (not sure if this is even needed at this point..), what would this /etc/hosts file need to look like in Yocto linux? I have been unable to find any images of what this file initially looked like and my brain is starting to hurt from trying to remember

       

      I know this isnt a huge issue since I can still ssh via the IP, but frustrating none the less. Any help would be much appreciated!

       

      Thanks!

      Clay

        • 1. Re: Problem SSHing to Edison via Hostname after clone
          CMata_Intel

          Hi Clay,

           

          Let me help you out with this. I would like to know how you are cloning your Edison. Also, could you post the IP addresses you have on both of them? Are they different?

          The output you have on /etc/hosts is normal, this content is the default one and contains only the information for the localhost or home address; you can edit it with vi by using the format:

          <IP> <HOSTNAME>.<DOMAIN> <ALIAS>

           

          I have the same output you have on /etc/hosts on images versions 146 and 159.devkit and you shouldn’t be worried about this file and the current content it has, if you want to edit it, go ahead but it shouldn't give you problems

          hosts.JPG

          Regards,

          Charlie

          • 2. Re: Problem SSHing to Edison via Hostname after clone
            CMata_Intel

            Hi Clay,

             

            Have you tried to modify the file? I would like to know if this has worked for you or if you have problems with ssh and the services

             

            Regards,

            Charlie

            • 3. Re: Problem SSHing to Edison via Hostname after clone
              TheNextEdison

              Hi Charlie,

               

              Thanks for getting back with me so quickly. I apologize for not getting back with you sooner. I've been battling a malfunctioning hard drive on my personal computer the past couple weeks, and just got things back up and running.

               

              First of all, I cloned my edison using the dd command and a micro usb flash drive (I scored at walmart for $8). I followed a thread here on the intel communities taking bits and pieces from what others were commenting. I will have to dig up the exact thread as I have lost all my emails with the computer trouble. I'll comment on that later tonight if I can dig it up.

              Going into more detail on my setup/clone:

              Initially I had set up my first Edison with the latest Yocto image using the mini breakout board. The goal was a to make a small prototype that mimics what I had built using a RasPi a+. I needed  LED/Vibration to occur on command so I have two mraa/gpio pins blinking (so to speak) for a specified amount of time/iterations and a MP3 file playing simultaneously throughout the duration of the LED/vibrations.

              The edison did everything and more than I needed, and the Mini breakout board worked great for a starting block. I got my first prototype a plastic shell online and added a switch/battery/charger to the prototype and was satisfied. Looking to make the prototype even smaller I invested in another edison and a couple of the Sparkfun stackable blocks (the battery and Gpio blocks).

              Using the mini breakout board and a 9v battery I was able to provide enough power to the board to also power the micro usb drive. And I luckily didn't need a converter cable as I found the 16GB dual micro usb flash drive/regular flash drive at walmart.

              Using the dd command it took about 15 minutes to save a copy of the edison image on the flash drive. Then another 25 minutes for it to clone the new edison. I then rebooted and with only the new edison on the network I ran through the setup_edison --config and changed my hostname. I then popped the new edison onto the sparkfun block and got it soldered and set up. Now I am no longer able to SSH into either edison using their hostnames, but everything else seems to be working fine. If you would like me to go into more detail about anything please let me know. I will post more info on how I specifically did the clone tonight.

               

              My IP for ClayEdison is 192.168.2.15 and my IP for ClayEdison2 is 192.168.1.103. That is very interesting.. They are on the same network. Shouldn't they have they same octet all the way through 192.168.2? I think I need to take my edison (ClayEdison2) off of the Sparkfun block and back into the mini breakout for a serial connection to set it up again.. I can more easily resetup my first edison (ClayEdison) as it always resides in a mini breakout board.

               

              Ok so since my hostname is ClayEdison and my IP is 192.168.2.15 you're saying I should add that to my /etc/hosts file like this below??

              127.0.0.1   localhost.localdomain   localhost
              192.168.2.15ClayEdison.localClayEdison

              I am familiar editing using vi. I will try this and report if It fixes my problem and I am able to SSH into my edison using ClayEdison.local instead of the IP address..

               

              Thanks,

              Clay

              • 4. Re: Problem SSHing to Edison via Hostname after clone
                CMata_Intel

                Hi Clay,

                 

                Thank you very much for the detailed explanation about how you are cloning the Edison.

                I would like to know if you have been able to work on this and mount the Edison module on the breakout board again to debug this.

                 

                Are you sure that both devices are on the same network? Are you making changes in the mask where the device is set it?

                The behavior you are having with the boards could be due to the cloning process, this could be generating the same IP address in both boards, but then the board changes the IP to another mask due to a conflict with the IP address of the other board. 

                Could you also post the output of running ifconfig on both boards? Are the HWaddr different?

                 

                Regards,

                Charlie

                • 5. Re: Problem SSHing to Edison via Hostname after clone
                  CMata_Intel

                  Hi Clay,

                   

                  Have you been able to work on this? Let us know if you have been able to work with both boards on your network.

                   

                  Regards,

                  Charlie

                  • 6. Re: Problem SSHing to Edison via Hostname after clone
                    falak.desai@yahoo.com

                    Hi Charlie,

                     

                    I have edited my  /etc/hosts  file  with this format  as you suggested :  <IP> <HOSTNAME>.<DOMAIN> <ALIAS>

                     

                    _______________________________________

                    now it is something like:

                    127.0.0.1mydomain.localdomainmydomain

                    _______________________________________

                     

                    ______________________________________________________________

                    Now if I enter    "ping mydomain"  on my edison console,  it gives response.


                    PING mydomain (127.0.0.1): 56 data bytes

                    64 bytes from 127.0.0.1: seq=0 ttl=64 time=0.413 ms

                    64 bytes from 127.0.0.1: seq=1 ttl=64 time=0.291 ms

                    ^C

                    --- mydomain ping statistics ---

                    4 packets transmitted, 4 packets received, 0% packet loss

                    ______________________________________________________________

                     

                    ______________________________________________________________________________________

                    And when I enter "ping mydomain"  on ubuntu machine console (in the same network ),  it gives response.

                     

                    ping: unknown host mydomain

                    ______________________________________________________________________________________

                     

                     

                    I want  "ping mydomain" to work on other machines in the same  network.

                    Am I doing something wrong here ?  I'm not sure ..

                     

                     

                    Thanks.

                    Falak

                    • 7. Re: Problem SSHing to Edison via Hostname after clone
                      CMata_Intel

                      Hi Falak,

                       

                      On the Edison; you have mydomain with the IP 127.0.0.1, this the IP address of the device itself. On Ubuntu; did you check the /etc/hosts file?

                      Are you able to see the mydomain host? If you can’t see the mydomain host on the /etc/hosts file on Ubuntu you need to add it using the IP of the board.

                      Then you should be able to ping the board from Ubuntu.

                       

                      Another alternative is always using the IP address of the devices and not the hostnames

                       

                      Regards,

                      Charlie