Showing posts with label headless. Show all posts
Showing posts with label headless. Show all posts

Monday, January 24, 2022

broken atomic modeset userspace detected, disabling atomic messages on raspberry pi

Occurs when running headless and no screen resolution set (never had a display attached). 

in  dmesg command log (from kernel)

 pi@pi1: $ sudo raspi-config 


 --30--

Tuesday, November 9, 2021

Raspberry pi Ubuntu headless setup

 
Setting up Pi for initial run on Ubuntu.


Same points as Raspbian

create 'ssh' in the boot partition.

copy and edit wpa_supplicant.conf into the boot partition.

in the rootfs /etc/hosts and /etc/hostname set the hostname

unmount and ready to go.

--30--

Tuesday, September 14, 2021

Odroid XU4 headless setup

This is for Odroid XU4 HC1, HC2 setup.


IP scan

Angry IP

Ping scan to update ARP table:
shell:~$ nmap -sn 192.168.100.0/24

full network scan info for nmap
shell:~$ nmap 172.20.20.0/24 
  (can have multiple subnets on command line)



--30--


Wednesday, August 29, 2018

mount Raspbian image and modify it


Notes on modifying a raspbian image to add ssh support and
preset for local wifi, so image can be dumped onto sd and be
ready to run.

https://ra...ypi.stackex.../how-can-i-mount-a-raspberry-pi-linux-distro-image

My settings:

fdisk partition info
Device                           Boot  Start      End Sectors  Size Id Type
2018-06-27-...stretch.img1       8192   96663   88472 43.2M  c W95 FAT32 (LBA)
2018-06-27-...stretch.img2      98304 9420799 9322496  4.5G 83 Linux
 
1st partition 512 * 8192 = 4194304
2nd partition 512 * 98204 = 50331648

boot:
mount -v -o offset=4194304 -t vfat 2018-06-27-raspbian-stretch.img /mnt
linux:
mount -v -o offset=50331648 -t ext4 2018-06-27-raspbian-stretch.img /mnt


You can't mount the image as a whole because it actually contains two partitions and a boot sector. However, you can mount the individual partitions in the image if you know their offset inside the file. To find them, examine the image as a block device with fdisk -l whatever.img. The output should include a table like this:
Device         Boot     Start       End  Blocks  Id System
whatever.img1            8192    122879   57344   c W95 FAT32 (LBA)
whatever.img2          122880   5785599 2831360  83 Linux
These are the two partitions. The first one is labelled "FAT32", and the other one "Linux". Above this table, there's some other information about the device as a whole, including:
Units: sectors of 1 * 512 = 512 bytes
We can find the offset in bytes by multiplying this unit size by the Start block of the partition:
  • 1st partition 512 * 8192 = 4194304
  • 2nd partition 512 * 122880 = 62914560
These can be used with the offset option of the mount command. We also have a clue about the type of each partition from fdisk. So, presuming we have directories /mnt/img/one and /mnt/img/two available as mount points:
mount -v -o offset=4194304 -t vfat whatever.img /mnt/img/one
mount -v -o offset=62914560 -t ext4 whatever.img /mnt/img/two
If you get an "overlapping loop" error here, your version of mount requires you to specify the size as well as the offset of the first partition. Unmount that, and use the number of blocks (57344) * 512 (= 29360128):
mount -v -o offset=4194304,sizelimit=29360128 \
    -t vfat whatever.img /mnt/img/one  
The second partition doesn't need a sizelimit since there's nothing after it in the image.
You can now access the two partitions. If you do not intend to change anything in them, use the -r (read-only) switch too. If you do change anything, those changes will be included in the .img file.
Note that the first partition is probably mounted on /boot in the second partition when the system is running.

-30-

Monday, March 12, 2018

Setting up motion camera software on raspbian


Raspbian has gotten the motion daemon integrated in, but all is not smooth yet.

you need to enable the raspberry pi camera with configuration changes to be sure that it is enabled.

0.0 create a boot media with latest raspbian, write on windows as needed

0.1 for newest stretch version of raspberry pi, enable wifi if necessary.
0.1a   with the media mounted on the creation host
0.1a.1   touch /boot/ssh to make sure ssh is enabled after boot
0.1a.2   put in wpa_supplicant.conf as needed

0.9 log in once booted up

1. sudo apt-get update

2. sudo apt-get -y install motion

3. in raspi-config
3a   set timezone
3b   set hostname
3c   enable camera
3d   resize media if using standard initial raspbian release image from 1.5mb

4.  change /etc/motion/motion.conf
4a.  change to allow non local control page access 8080
4b.  change to allow non local camera stream access 8081
4c.  change to run daemon if started manually

5. add  bcm2835-v4l2 to /etc/modules to get
5a. change /etc/default/motion to auto start
5b. set to get systemctl to start @ boot   sudo systemctl enable motion
5c. change permissions on /var/log/motion/motion so daemonized motion can access it
5d. change permissions on /var/lib/motion directory so daemonized motion can access it

6a. sudo systemctl enable motion
6b. sudo service motion start

7.  some reboots will be required.

00 optional

00.1  command;
          vcgencmd get_camera
       will show whether camera is supported and detected

Note for headless setup

on the boot volume (on system creating boot media)

Must be done before first boot.  Will not work subsequently (for the ssh enable)

touch /boot/ssh

Create wireless connection if need be.  This is the only way to start a pi zerow headless.
Contents of /etc/wpa_supplicant/wpa_supplicant.conf:
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="YOUR_SSID_HERE"
    psk="YOUR_SECRET_PASSPHRASE_HERE"
    id_str="SOME_DESCRIPTIVE_NAME"
}
 
 

Another page setup

 
https://www.instructables.com/id/How-to-Make-Raspberry-Pi-Webcam-Server-and-Stream-/ 
 
 
Maximum resolutions
 
V1  2592 × 1944 pixels
V2  3280 × 2464 pixels
 
 

--30--

Saturday, August 26, 2017

Raspberry pi zero headless setup

5/21/2019, another setup for headless.  Includes how to do multiple WIFI ssids

https://core-electronics.com.au/tutorials/raspberry-pi-zerow-headless-wifi-setup.html

Note:  at end of this, remember to change power save setting

https://www.gaggl.com/2017/08/set-up-a-raspberry-pi-zero-headless/

credit to leo gaggl

If you are using the GUI (Raspian full download) and want to connect your RPi Zero to a keyboard and monitor there are probably easier ways to do this. These notes are for people that want to use a headless (no monitor and GUI) setup ready to connect to your RPi after first boot via SSH from another terminal.

Download Raspbian Lite

wget -O raspbian-lite-latest.zip https://downloads.raspberrypi.org/raspbian_lite_latest
Download link: https://www.raspberrypi.org/downloads/raspbian/

Write Image to SD Card

dd bs=4M if=2017-08-16-raspbian-stretch-lite.img of=/dev/sdb
After this step there should be 2 additional mounts (if not mount the 2 SD card partitions manually).

Set up network interfaces

Create a new config file for the wireless interface.
cd etc/network/interfaces.d/
vim wlan0.conf

Add the following to the new file (if you want to use DHCP – change to static if you want to fix the IP):
auto wlan0
allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

Set up connection details for local wireless network

vim etc/wpa_supplicant/wpa_supplicant.conf
Check the file and ensure the network settings are as per the Wireless Network you are connecting to.

country=AU
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
network={
ssid="SSID"
psk=HASHED_PSK_VALUE
}

 
country=US
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1

network={
    ssid="your_real_wifi_ssid"
    scan_ssid=1
    psk="your_real_password"
    key_mgmt=WPA-PSK
}


You could use the clear-text PSK passphrase but I prefer not to do that in configuration files. Create a PSK hash using ‘wpa_passphrase‘ this older article
There could be other config values you might need depending on the network you are connecting to. More info: https://linux.die.net/man/5/wpa_supplicant.conf.

Ensure there are DNS Servers configured

sudo vim etc/resolv.conf
Add the following to the new file (or your own nameservers):
# Google's public DNS servers
nameserver 8.8.8.8
nameserver 8.8.4.4

Enable SSH Access

Create an ssh empty file in the mounted boot partition. This is necessary to enable SSH access as SSH is by default disabled on more recent versions of Raspbian.
cd boot/
sudo touch ssh

Boot RPi

Boot the Rpi by powering up and after ~30secs you should be able to connect to the IP assigned. Check your router or ise ‘nmap’ or similar to check the assigned IP:
sudo nmap -p22 -sV 10.1.1.0/24
Default login details are
UID: pi
PWD: rasbperry
My normal further setup steps for RPi 3 are here.
EDIT [2017-08-21]: One of the things necessary on later RPi’s is to turn off power saving mode on the WLAN interface.
sudo iw dev wlan0 set power_save off

Raspberry Pi forum entry link for headless setup

https://www.raspberrypi.org/forums/viewtopic.php?t=191252 

Another headless setup page


https://hackernoon.com/raspberry-pi-headless-install-462ccabd75d0

--30--