13

I want to build a minimal system for raspberry pi (B+) to improve the performance of my face detection algorithm ... I have found BuildRoot : for the configuration i found that it's not necessary to do the configuration myself and instead i have used the provided one :

make raspberrypi_defconfig
make

Now i don't have a HDMI Cable to connect the pi ... when connecting it to my laptop the red led is on and the green led start flashing : that mean that the pi is reading the SD card correctly It's the first time i'm using buildroot , and i don't know how to enable ssh for the pi or how to display the pi adress. Note this is not a duplicate of Prepare for ssh without a screen because in the solution they provided

To enable ssh at startup, backup boot.rc on the boot partition on the SD image and replace it with boot_enable_ssh.rc

Well i don't have a file called boot.rc

I am able to access the sd card using ubuntu 14.04 , running ls from boot folder show this:

bootcode.bin  cmdline.txt  config.txt  fixup.dat  start.elf  zImage

i have also tried to use a static ip by adding 10.42.0.5 to cmdline.txt but after that i can't connect to the pi with this adress. So i have two issue :

  1. How to connect to the pi adress when using buildroot : Link to Solution
  2. How to set up and connect to the pi using ssh using buildroot and witout HDMI.

Btw i'm using a ethernet cable to connect to the pi

Thanks :)

UPDATE : i have added the link to solution for the first issue Now the pi address appear after scanning the ethernet network :

nmap -sP 10.42.0.0/24
Nmap scan report for 10.42.0.5
Host is up (0.00076s latency).

Now the issue i have is how to enable ssh to be able t connect to the pi witout HDMI (using Buildroot)

When trying to ssh the pi (buildroot is the system hostname used ) :

ssh buildroot@10.42.0.5
ssh: connect to host 10.42.0.5 port 22: Connection refused

I think it because ssh it's not enabled !!!

The Beast
  • 373
  • 1
  • 7
  • 20
  • AFAIK is SSH enabled by default… BTW are you using the ethernet port or some USB WiFi adapter? – wb9688 Jan 24 '16 at 17:12
  • what AFAIK mean ? No i'm using an ethernet cable – The Beast Jan 24 '16 at 17:51
  • As Far As I Know...! On the PC running Ubuntu try sudo nmap -sP 192.168.0.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}' you may need to tweak the network address specified by 192.168.x.0/24 where X is somewhere between 0-255 inclusive which would cover you for the private Class C address range reserved for LANs. This filters the results for the unique MAC address that the Ethernet Interface on the Pi will have... – SlySven Jan 24 '16 at 19:04
  • 1
    @SlySven i have used instead sudo nmap -sP 10.42.0/24 give me 1 host is up (it's my laptop) but no other devices detected !!! Note : my ethernet adress is 10.42.0.1 and the command sudo nmap -sP 10.42.0/24 | awk '/^Nmap/{ip=$NF}/B8:27:EB/{print ip}' give an empty output – The Beast Jan 24 '16 at 20:21
  • @Frankenstein Are you sure the ethernet cable is connected good? Does the ethernet cable works on another computer (eg. your laptop)? If yes, try finding your Pi with Adafruit's Pi Finder... – wb9688 Jan 24 '16 at 20:37
  • Perhaps we had better find out what your modem/router is using for the range it uses for DHCP? I guess it is 10.42.0.1-254 but I could easily be wrong... – SlySven Jan 24 '16 at 20:43
  • 1
    @wb9688 yes i have used it when installing raspbian , and connect easily with ssh@10.42.0.5 after choosing that static ip – The Beast Jan 24 '16 at 20:49
  • @SlySven yes that right .... now i have solved the first issue :) and updated the post .. i'm dealing now on how to enable ssh for the raspberry witout hdmi cable – The Beast Jan 24 '16 at 21:21
  • this is a link that will help you , I couldn't comment so i am posting it as an answer link – Amrith Oct 02 '19 at 04:30

6 Answers6

4

If all you did was make raspberrypi_defconfig && make, then you still have a lot of work to do in order to get a useful running system.

The default configuration of BuildRoot is for everything to be turned off except for BusyBox. The ssh server isn't responding because you didn't tell BuildRoot that you wanted to compile it!

Start off by running make menuconfig in your BuildRoot directory. Openssh can be enabled by navigating to Target packages, Networking applications, openssh.

It is probably going to be very hard to get this working without a monitor on the Pi. You don't need to use it in the final version, once you get ssh working, but it's going to be really hard to diagnose startup issues without a monitor. Buy yourself an HDMI cable or a HDMI -> DVI converter, and use the local console.

David Yaw
  • 181
  • 3
3

Preface: I'm using buildroot-2017.02.3 for a Raspberry PI 2 and enabled openssh from make menuconfig. Without further changes, the ssh login doesn't work, because the generated default /etc/ssh/sshd_config does not permit root login.

Option A: Add a User

You can add users via buildroot. The following manual entries might help:

Essentially, you create a textfile that defines your user in a special syntax like so:

foo -1 foo -1 =bar /home/foo /bin/sh - no_comment

and tell buildroot in make menuconfig > System Configuration > user tables where to find your user table file. The above sample content would create an additional user foo with password bar (login is activated). This user can login via ssh right away, since he's not root.

Option B: Permit Root Login

When you use a SD card for the system (e.g. on a raspberry), you can simply mount the card on your PC, edit /media/<pathToYourSD>/etc/ssh/sshd_config (sudo required), and locate the line

#PermitRootLogin prohibit-password

and change to

PermitRootLogin yes

This allows root to login via ssh. Note that I've set a password for root. Not sure if this works without password. If you are not able to mount your sd card, you would have to write post build scripts that do the same modification as described, but on the build host (before the rootfs is packed).

1

No router + regular Ethernet cable + RPI 2 + Buildroot 2016.05 + Ubuntu 16.04 host

Got it working after I've split this problem into two parts:

  1. get ethernet SSH working with Raspbian and a direct cable connection (which already has a properly setup sshd daemon running) https://raspberrypi.stackexchange.com/a/54394/33424

  2. learn how to do a proper sshd configuration on QEMU + buildroot: https://stackoverflow.com/a/39301480/895245

    On the real board, you don't have a QEMU window to modify /etc/ssh/sshd_config of course, so you will need to either:

    • modify it on host before flashing (either BR2_ROOTFS_OVERLAY, mount output/images/sdcard.img with https://askubuntu.com/a/496576/52975 , or play with output/target)
    • connect via UART serial. You will want to get this working sooner or later, as it is the best way to debug your buildroot distro on the board.

.config is simply raspberrypi2_defconfig + openssh enabled with make menuconfig.

Then just:

ssh "root@$(cat /var/lib/misc/dnsmasq.leases | cut -d ' ' -f 3)"

TTL on image only used for power.

0

I know this is quiet old but I had excactly the same issue. I had to edit the sshd config file in /etc/ssh. I edited that file by mounting the sd-card on another system. You will have to allow root to login using ssh (something like PermitRootLogin yes).

Jacobm001
  • 11,898
  • 7
  • 46
  • 56
-1

SSH is enabled by default - try pi@10.42.0.5 (or root@10.42.0.5 if you're really desperate!). Plain ssh 10.42.0.5 might be worthwhile too.

Are you using passwords or ssh to connect?

Greenonline
  • 2,740
  • 4
  • 23
  • 36
-1

This is how i did a headless pi setup:

  1. downloaded etcher and latest raspbian software from raspberrypi.org

  2. Used etcher to burn the file to my sd card

  3. etcher automatically ejects the sd card, place it back into your conputer again

  4. made a file with with nothing in it, called it ssh (make sure no extension is enabled when saved)

  5. popped it into my raspberry pi, connected ethernet from RPi to router and artached the micro usb ti the RPi.

  6. Fired the RPi up, waited 1-2mins.

  7. went to my router page (type in your routers ip, should be on your router itself

  8. Looked for connected devices, found my raspberry pi ip address.

  9. write down the ip address and opened terminal

  10. in terminal write: ssh pi@YOURRPIiphere!

  11. replace YOURRPIiphere with rpis ip address

  12. press enter and type in the default password, raspberry

  13. to configure the RPi do sudo raspi-config ,edit your settings, reboot!

Hoped this help!

Darkest N2O
  • 368
  • 1
  • 6
  • 15