Archive for the ‘Raspberry Pi’ Category
Posted by jpluimers on 2017/04/07
Coming from an OpenSuSE background, I was a bit surprised to find 127.0.1.1 in the /etc/hosts file to point to the hostname in Raspbian distributions.
It means you have to change at least these files when altering the hostname:
/etc/hosts
/etc/hostname
In addition to those, I also changed these:
/etc/ssh/ssh_host_rsa_key.pub
/etc/ssh/ssh_host_ecdsa_key.pub
/etc/ssh/ssh_host_dsa_key.pub
/etc/ssh/ssh_host_ed25519_key.pub
/etc/.git/description
After altering these files, you want to run this (via: Pi Town: Change a Raspberry Pi’s Hostname without Rebooting [WayBack])
sudo /etc/init.d/hostname.sh start
This prevents In order to prevent messages like sudo: unable to resolve host raspberrypi without rebooting.
The 127.0.0.1 seems to be a Debian thing: Chapter 5. Network setup – 5.1.1. The hostname resolution [WayBack] has
The IP address 127.0.1.1 in the second line of this example may not be found on some other Unix-like systems. The Debian Installer creates this entry for a system without a permanent IP address as a workaround for some software (e.g., GNOME) as documented in the bug #719621.
The <host_name> matches the hostname defined in the “/etc/hostname“.
For a system with a permanent IP address, that permanent IP address should be used here instead of 127.0.1.1.
For a system with a permanent IP address and a fully qualified domain name (FQDN) provided by the Domain Name System (DNS), that canonical <host_name>.<domain_name> should be used instead of just <host_name>.
via: linux – Why does my hostname appear with the address 127.0.1.1 rather than 127.0.0.1 in /etc/hosts? – Server Fault [WayBack]
There isn’t a great deal of difference between the two; 127/8 (eg: 127.0.0.0 => 127.255.255.255) are all bound to the loopback interface.
The reason why is documented in the Debian manual here:http://www.debian.org/doc/manuals/debian-reference/ch05.en.html#_the_hostname_resolution
Ultimately, it is a bug workaround; the original report is here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=316099
–jeroen
Posted in *nix, Development, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2017/04/05
When you search for raspberry pi firmware version check
Installing and running rpi-update will – besides updating the GPU firmware – also install vcgencmd, I got this result:
statler:~ # LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/vc/lib/
statler:~ # export LD_LIBRARY_PATH
statler:~ # /opt/vc/bin/vcgencmd version
Jul 15 2016 17:50:10
Copyright (c) 2012 Broadcom
version efa728fef77ea14ceb1500caf0146395fa282a0f (clean) (release)
But I wanted to be able to run vcgencmd before installing updates.
openmamba indicates it’s part of their raspberrypi-utils package with sources in the raspberrypi-userland package tracing back to git://github.com/raspberrypi/userland.git which is at https://github.com/raspberrypi/userland.
So I had two choices: compile https://github.com/raspberrypi/userland or find the binaries that rpi-update installs and are already runnable. I went for the second first by digging in https://github.com/Hexxeh/rpi-update/blob/master/rpi-update which on one of the first lines points to https://github.com/Hexxeh/rpi-firmware where the binaries are stored under https://github.com/Hexxeh/rpi-firmware/tree/master/vc/softfp/opt/vc.
The logic for copying the files is in the update_vc_libs function. The calling do_update function updates a lot more, including the firmware. So I wrote a quick pull request to just download the userland binaries:
Feature SKIP_FIRMWARE for #220: forces SKIP_KERNEL=1 and also skip the kernel.img files and the kernel modules: This effectively only installs the userland and SDK.
Source: #220 feature `SKIP_FIRMWARE` by jpluimers · Pull Request #221 · Hexxeh/rpi-update
Hopefully it gets merged in. When not, then you can always take a look at the commit: #220 feature SKIP_FIRMWARE · jpluimers/rpi-update@5a2ec0b
Run these commands to get going:
cd /root/bin
wget https://raw.githubusercontent.com/jpluimers/rpi-update/5a2ec0bc552436d58127cc20e3791cb5b90fd5ba/rpi-update
chmod +x rpi-update
SKIP_FIRMWARE=1 UPDATE_SELF=0 ./rpi-update
You should see this when updating:
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** We're running for the first time
*** Backing up files (this will take a few minutes)
*** Remove old firmware backup
*** As requested, not updating firmware and kernel modules
This update bumps to rpi-4.4.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=144087
##############################################################
*** Downloading specific firmware revision (this will take a few minutes)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 168 0 168 0 0 361 0 --:--:-- --:--:-- --:--:-- 362
100 51.2M 100 51.2M 0 0 1246k 0 0:00:42 0:00:42 --:--:-- 1446k
*** As requested, not updating firmware and kernel
*** As requested, not updating firmware and kernel modules
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to 818a860cf690d64c62d3227ad9c36d5867a671c2
*** A reboot is needed to activate the new firmware
And the final goal of checking the firmware version now works:
# LD_LIBRARY_PATH=/opt/vc/lib /opt/vc/bin/vcgencmd version
Jul 15 2016 17:50:10
Copyright (c) 2012 Broadcom
version efa728fef77ea14ceb1500caf0146395fa282a0f (clean) (release)
–jeroen
Posted in Development, Hardware Development, Linux, openSuSE, Raspberry Pi, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2017/04/04
https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update && sudo chmod +x /usr/bin/rpi-update
The above is suggested by Hexxeh/rpi-update: An easier way to update the firmware of your Raspberry Pi
This is what I did on my OpenSuSE Tumbleweed powered Raspberry Pi devices:
statler:~ # cd bin
statler:~/bin # wget https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update
--2016-08-30 13:04:38-- https://raw.githubusercontent.com/Hexxeh/rpi-update/master/rpi-update
Resolving raw.githubusercontent.com (raw.githubusercontent.com)... 151.101.36.133
Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|151.101.36.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 12022 (12K) [text/plain]
Saving to: ‘rpi-update’
rpi-update 100%[===================>] 11.74K --.-KB/s in 0.002s
2016-08-30 13:04:39 (6.36 MB/s) - ‘rpi-update’ saved [12022/12022]
statler:~/bin # ls -al
total 20
drwxr-xr-x 2 root root 4096 Aug 30 13:04 .
drwx------ 4 root root 4096 Aug 30 13:04 ..
-rw-r--r-- 1 root root 12022 Aug 30 13:04 rpi-update
statler:~/bin # chmod 755 rpi-update
statler:~/bin # ./rpi-update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** Performing self-update
*** Relaunching after update
*** Raspberry Pi firmware updater by Hexxeh, enhanced by AndrewS and Dom
*** We're running for the first time
*** Backing up files (this will take a few minutes)
*** Backing up firmware
*** Backing up modules 4.1.19-1-rpi2
This update bumps to rpi-4.4.y linux tree
Be aware there could be compatibility issues with some drivers
Discussion here:
https://www.raspberrypi.org/forums/viewtopic.php?f=29&t=144087
##############################################################
*** Downloading specific firmware revision (this will take a few minutes)
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 168 0 168 0 0 382 0 --:--:-- --:--:-- --:--:-- 382
100 51.2M 100 51.2M 0 0 1511k 0 0:00:34 0:00:34 --:--:-- 1298k
*** Updating firmware
*** Updating kernel modules
*** depmod 4.4.19+
*** depmod 4.4.19-v7+
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to 818a860cf690d64c62d3227ad9c36d5867a671c2
*** A reboot is needed to activate the new firmware
statler:~/bin # reboot
Then on the console:
U-Boot 2016.07 (Aug 12 2016 - 14:07:49 +0000)
DRAM: 880 MiB
RPI 2 Model B (0xa21041)
MMC: bcm2835_sdhci: 0
reading uboot.env
** Unable to read "uboot.env" from mmc0:1 **
Using default environment
In: serial
Out: lcd
Err: lcd
Net: Net Initialization Skipped
No ethernet found.
starting USB...
USB0: Core Release: 2.80a
scanning bus 0 for devices... 4 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found
scanning usb for ethernet devices... 1 Ethernet Device(s) found
Hit any key to stop autoboot: 0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Scanning mmc 0:2...
Found U-Boot script /boot.scr
2781 bytes read in 50 ms (53.7 KiB/s)
## Executing script at 02000000
switch to partitions #0, OK
mmc0 is current device
5352616 bytes read in 1003 ms (5.1 MiB/s)
6088968 bytes read in 1010 ms (5.7 MiB/s)
14226 bytes read in 138 ms (100.6 KiB/s)
Kernel image @ 0x1000000 [ 0x000000 - 0x51aca8 ]
## Flattened Device Tree blob at 00000100
Booting using the fdt blob at 0x000100
Using Device Tree in place at 00000100, end 00006891
Starting kernel ...
Uncompressing Linux... done, booting the kernel.
Welcome to openSUSE Tumbleweed 20160828 - Kernel 4.1.19-1-rpi2 (ttyAMA0).
statler login:
...
statler:~ # /opt/vc/bin/vcgencmd version
/opt/vc/bin/vcgencmd: error while loading shared libraries: libvchiq_arm.so: cannot open shared object file: No such file or directory
statler:~ # locate libvchiq_arm.so
-bash: locate: command not found
statler:~ # zypper install findutils-locate
....
statler:~ # locate libvchiq_arm.so
locate: can not stat () `/var/lib/mlocate/mlocate.db': No such file or directory
statler:~ # /usr/bin/updatedb
statler:~ # locate libvchiq_arm.so
/opt/vc/lib/libvchiq_arm.so
–jeroen
Posted in Development, Hardware Development, Raspberry Pi | Leave a Comment »
Posted by jpluimers on 2017/03/30
I tried to power both Raspberry B+ and Raspberry 2 B devices via the USB ports of both a Fritz!Box 7490 and Fritz!Box 7360.
At first this works, but the Raspberry B+ devices over time would become unstable: not being able to ping and/or boot.
So below are some links on power requirements and powering Raspberry Pi A, B, A+, B+, 2B and zero.
Fazit/TL;DR: use an external power supply when available.
Read the rest of this entry »
Posted in *nix, Development, Fritz!, Fritz!Box, Hardware Development, Internet, Linux, openSuSE, Power User, Raspberry Pi, SuSE Linux | Leave a Comment »
Posted by jpluimers on 2017/03/30
Some links that helped me getting FTDI USB serial communication to Raspberry Pi systems going:
–jeroen
Posted in Apple, Communications Development, Development, Hardware Development, Hardware Interfacing, iMac, Legacy Ports: COM, Mac, Mac OS X / OS X / MacOS, MacBook, MacBook Retina, MacBook-Air, MacBook-Pro, MacMini, OS X 10.10 Yosemite, OS X 10.9 Mavericks, Power User, Raspberry Pi, USB | Leave a Comment »
Posted by jpluimers on 2017/03/24
Every time I logged onto a freshly installed Rasbian system (Debian Jessie), I had this message:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Aug 27 19:52:33 2016 from 192.168.171.24
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Asking for the locale settings would give this:
jeroenp@raspberrypi:~ $ locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
Searching for raspbian jessie “-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)” I found fix locale issue #15 · scaleway/image-debian@543e9b4 [WayBack] that fixes Locale issue on Debian Jessie · Issue #15 · scaleway/image-debian · GitHub [WayBack]:
When logging into to a freshly booted debian jessie image:
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)
Source: Locale issue on Debian Jessie · Issue #15 · scaleway/image-debian
I changed the crux of that solution to this one:
echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen
When running, it showed this:
# echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen && locale-gen
Generating locales (this might take a while)...
en_GB.UTF-8... done
en_US.UTF-8... done
Generation complete.
And logging this:
The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.
Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Sat Aug 27 20:26:34 2016 from 192.168.171.24
Problem solved: 1 line of code!
–jeroen
Posted in *nix, Arduino, Debian, Development, Hardware Development, Linux, Power User, Raspberry Pi, Raspbian | 1 Comment »
Posted by jpluimers on 2017/02/27
Finding the right image
There are many single-board computers on the OpenSuSE hardware-compatibility list (HCL), including:
A lot of them have ready to go images, often for Tumbleweed, however none of the pages explain the below image differences hence the one-line for each:
Since I wanted a headless system, JeOS was what I needed.
As it wasn’t available for my ODroid C1+ but was for my Raspberry Pi 2 and as my main machine is a 15″ Retina MacBook Pro Late 2013 [WayBack] below are the steps I used to get the image working.
Installing the Raspberry Pi 2 image using OS X
The below Raspberry Pi2 link will redirect to the correct image in the generic download directory http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/RaspberryPi2/images/
http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/RaspberryPi2/images/openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l.raw.xz
For other Raspberry Pi versions, you can find them here:
http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/RaspberryPi3/images/openSUSE-Tumbleweed-ARM-JeOS-raspberrypi3.aarch64.raw.xz
http://download.opensuse.org/ports/armv6hl/tumbleweed/images/openSUSE-Tumbleweed-ARM-JeOS-raspberrypi.armv6l-Current.raw.xz
I installed on a 8 gigabyte SD card that revealed itself as /dev/disk1 using this diskutil command (via osx – List all devices connected, lsblk for Mac OS X – Ask Different [WayBack])
diskutil list
So this wrote the image to SD card in a sudo su - prompt:
targetDevice="disk2"
unxz --keep openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l-2016.08.20-Build2.1.raw.xz; \
diskutil umount "/dev/${targetDevice}s1"; \
dd bs=1m of="/dev/r${targetDevice}" if=openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l-2016.08.20-Build2.1.raw; \
sync; \
diskutil list; \
diskutil eject "/dev/${targetDevice}"
or if you want to select which image to “burn”:
targetDevice="disk2"
imageName="openSUSE-Tumbleweed-ARM-JeOS-raspberrypi2.armv7l-2016.08.20-Build2.1.raw"
imageName="openSUSE-Tumbleweed-ARM-JeOS-raspberrypi.armv6l-2016.11.23-Build2.22.raw"
imageName="openSUSE-Tumbleweed-ARM-JeOS-raspberrypi3.aarch64-2017.01.12-Build3.2.raw"
unxz --keep ${imageName}.xz; \
diskutil umount "/dev/${targetDevice}s1"; \
dd bs=1m of="/dev/r${targetDevice}" if=${imageName}; \
sync; \
diskutil list; \
diskutil eject "/dev/${targetDevice}"
A few notes:
Read the rest of this entry »
Posted in *nix, Development, Hardware, Hardware Development, Linux, Odroid, openSuSE, Power User, Raspberry Pi, Single-Board Computers, SuSE Linux, Tumbleweed | 1 Comment »
Posted by jpluimers on 2016/12/13
Reminder to self: Fix #220 feature SKIP_FIRMWARE by jpluimers · Pull Request #221 · Hexxeh/rpi-update
It’s bash. How hard can it be.
(no that was a rhetorical question).
–jeroen
Posted in *nix, *nix-tools, Debian, Development, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, Raspbian, SuSE Linux, Tumbleweed | Leave a Comment »
Posted by jpluimers on 2016/11/23
Too bad Ars Technica redirects https to http while preaching anyone should use https.
Anyway: OS device driver install and network configuration should probably be less automatic than it is now.
All the more reason to go fully https (hello LetsEncrypt, goodbye Embarcadero).
A video showing how it works is below.
The clever device emulates a USB ethernet adapter (that virtually every operating system has default drivers for) then fakes being 1.0.0.1 handing out DHCP address 1.0.0.10 with a netmask of 128.0.0.1 thereby routing almost all network traffic over it.
It makes a tiny peace of the internet unreachable (like 1.0.0.1 itself in Brisbane Australia).
More details on how it works at [WayBack] Samy Kamkar: PoisonTap – exploiting locked computers over USB.
Lets not leave this out:
Securing Against PoisonTap
Server-Side Security
If you are running a web server, securing against PoisonTap is simple:
- Use HTTPS exclusively, at the very least for authentication and authenticated content
- Honestly, you should use HTTPS exclusively and always redirect HTTP content to HTTPS, preventing a user being tricked into providing credentials or other PII over HTTP
- Ensure Secure flag is enabled on cookies, preventing HTTPS cookies from leaking over HTTP
- When loading remote Javascript resources, use the Subresource Integrity script tag attribute
- Use HSTS to prevent HTTPS downgrade attacks
Desktop Security
- Adding cement to your USB and Thunderbolt ports can be effective
- Closing your browser every time you walk away from your machine can work, but is entirely impractical
- Disabling USB ports is also effective, though also impractical
- Locking your computer has no effect as the network and USB stacks operate while the machine is locked, however, going into an encrypted sleep mode where a key is required to decrypt memory (e.g., FileVault2 + deep sleep) solves most of the issues as your browser will no longer make requests, even if woken up
–jeroen
via Joe C. Hecht – Google+
Read the rest of this entry »
Posted in Development, Hardware Development, Raspberry Pi | Leave a Comment »
Posted by jpluimers on 2016/09/01
Raspberry Pi voordeel bundels. Raspberry Pi supersnel en gratis bij u thuisbezorgd! Want bij ons geldt; voor 16:00 besteld? Morgen in huis!
Source: Raspberry Pi voordeel set | SosSolutions.nl
Posted in Development, Hardware Development, Raspberry Pi | Leave a Comment »