The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,862 other subscribers

Archive for the ‘Raspberry Pi’ Category

UPS PIco HV3.0 documentation not on github: “03_0x38_W_UPS PIco HV3.0.pdf”

Posted by jpluimers on 2017/10/17

I ordered a UPS PIco HV3.0 A Stack 450 Plus and it arrived without any documentation on how to solder the parts together.

So I tried searching for them: https://www.google.com/search?q=UPS+PIco+HV3.0+A+Stack+450+Plus+installation+instructions which turned mostly github based URLs.

I learned there is a bit on github:

But despite code and documentation being there, no installation instructions on how to solder the stuff together.

Luckily, they responded quickly to my tweet So I got my “UPS PIco HV3.0 A Stack 450 Plus” @ModMyPi but no assembly instructions. Where do all the non-soldered parts go when using RPi3? and a quick respons thread revealing I needed 03_0x38_W_UPS PIco HV3.0.pdf which – TADAAAA – is on Google drive and on the forums at [WayBackUPS PIco Firmware Update & Troubleshooting : Technical Support

So despite github providing an excellent platform for discussion and storing documentation, something archaic like a forum is used to store data in a disorganised way.

Too bad, as the document itself is 100+ page of invaluable documentation.

So in case of future bit-rot, here are the links:

Read the rest of this entry »

Posted in Development, Hardware Development, Hardware Interfacing, Raspberry Pi | Leave a Comment »

Raspberry Pi brexit – changing your locale away from GB when you’ve a different keyboard

Posted by jpluimers on 2017/10/02

A while ago I wrote about -bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8) on fresh Raspbian on Raspberry

I thought my locale issues were solved and they sort of were. Until I had to logon locally and managed to get one or more of these characters in my password:

  • ~ (tilde)
  • @ (at)
  • # (hash)
  • \ (backslash)
  • | (pipe)
  • " (double-quote)

Then logon would fail locally but work via ssh. Go figure!

Lot’s of people outside the UK using their Raspberry Pi with keyboard and monitor will now say: you’ve the default GB keyboard layout and your keyboard is not GB.

Bingo!

This is how US keys look when using a GB keyboard layout:

Read the rest of this entry »

Posted in *nix, Debian, Development, Hardware Development, Linux, Power User, Raspberry Pi, Raspbian | Leave a Comment »

Oops: OF: /soc/usb at 7e980000: could not get #phy-cells for /phy

Posted by jpluimers on 2017/09/28

 

kvm [1]: Invalid trigger for IRQ4, assuming level low
OF: /soc/usb at 7e980000: could not get #phy-cells for /phy

Via [WayBack] Oops. – Jeroen Wiert Pluimers – Google+

This was after updating my Raspberry Pi 3 with Tumbleweed to 20170920.

Not sure what do do now. Some searches didn’t reveal much:

–jeroen

Posted in *nix, Development, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, SuSE Linux, Tumbleweed | Leave a Comment »

Some notes on making pi-hole work on a DHCP enabled network

Posted by jpluimers on 2017/08/24

Many networks have DHCP Manual allocation (commonly called static allocation) handing out static/fixed IP addresses over DHCP so you can centralise IP address handout based on MAC (or other attributes).

Here are some links that should me get going making my pi-hole Raspberry Pi using DHCP instead of static IP addresses.

Yucky way to set a static IP: How do I set a static IP address in Raspbian “Jessie” using /etc/dhcpcd.conf? – Pi-Hole: A Black Hole For Internet Advertisements [WayBack]

–jeroen

Posted in Development, Hardware Development, Power User, Raspberry Pi | Leave a Comment »

A start job is running for dev-disk-by\… – Google Photos – Jeroen Wiert Pluimers – Google+

Posted by jpluimers on 2017/08/17

Reproduction of A start job is running for dev-disk-by... – Google Photos / Oops. Let’s see if I can reproduce it, as I think this is related: https://…

Reproducible steps below.

Related:

Tried tips from last link: fails as well

These are the modifications of the steps further on based on the last link above.

  1. After first boot, verify the WiFi drivers are there:

# rpm -qa | grep bcm43xx
bcm43xx-firmware-20170410-2.1.noarch

  1. After editing /etc/dracut.conf.d/raspberrypi_modules.conf, perform sudo mkinitrd without any -f
  2. After reboot, same error

Error result

At boot time:

A start job is running for dev-disk-by\…

After waiting:

Reproducible steps

  1. download (or a more recent one) from http://download.opensuse.org/repositories/devel:/ARM:/Factory:/Contrib:/RaspberryPi3/images/ :
  2. Install them on a MicroSD card
  3. Put in Raspberry Pi 3 and boot
  4. Get the IP address of the machine, then SSH into it (ssh root@ip-address, password linux)
  5. Follow the steps from [WayBackopenSUSE on Raspberry Pi 3: From Zero to Functional System in a Few Easy Steps – SUSE Blog | SUSE Communities to get WiFi working:
    1. Edit /etc/dracut.conf.d/raspberrypi_modules.conf and remove the sdhci-iproc from the first and # on the last line:From :
      add_drivers+=" sdhci-iproc bcm2835-sdhost bcm2835_dma mmc_block dwc2 "
      # Workaround for Wifi
      #omit_drivers+=" sdhci-iproc"

      To :

      add_drivers+=" bcm2835-sdhost bcm2835_dma mmc_block dwc2 "
      # Workaround for Wifi
      omit_drivers+=" sdhci-iproc"
    2. Run these commands:
      mkinitrd -f
      reboot
    3. Check in Yast if wlan0 exists in System -> Network Settings, then assign an SSIS plus credentials to it
      1. Verify the list contains BCM43430 WLAN card
      2. Select it
      3. Click the Edit button
      4. Put the check mark next to Dynamic Address then select DHCP and the kind of DHCP (in my caseboth version 4 and 6)
      5. Click the Next button
      6. Keep Operating Mode as Managed
      7. Click the Scan Network button
      8. Select Network Name (ESSID) from the list
      9. Select Authentication Mode from the list
      10. Put the check mark for Key Input Type as Passphrase
      11. Enter the Encryption Key
      12. Click the Next button
      13. Click the OK button
      14. Quit Yast
      15. Wait a few moments, then very with ip a that wlan0 got an IP address
  6. Update the system:
    zypper refresh
    zypper dist-upgrade
  7. Reboot
  8. Wait for the error to occur on the HDMI screen (USB keyboard does not work there, so I cannot copy logs)

Gist log until 7. is below.

IRC chat transcript opensuse-factory

10:40am<wiertIs there anyone of the dev team here with a RPi3 that can see if my steps at https://wiert.me/2017/08/17/a-start-job-is-running-for-dev-disk-by-google-photos-jeroen-wiert-pluimers-google/ reproduce?
10:40amwiertTL;DR: Tumbleweed on Rpi3; enable WiFi according to site and forum instructions; zypper dist-upgrade; boot failure.
10:41amwiertwithout enabling WiFi everything is fine.
10:41amwiertspare RPi3s get in next week, so I’ll configure this one for my brother without WiFi for now.
10:43amfvogtHm, that guide can’t actually work that way (unless something changed significantly)
10:43amwiertit worked in the sense that it got WiFi working. it failed in the sense that you cannot upgrade any more (:
10:43amfvogtThe omit_drivers line removed the driver for the sd card controller, so it’s no surprise that it doesn’t boot anymore. It needs a different device tree
10:44amfvogtI guess you upgraded the kernel + DT? You must not do that
10:44amwiertfunny as after the mkinitrd, a reboot went fine.
10:44amwiertit’s only that after a zypper dup it fails.
10:44ammnowak__DimStar, I wan’t $$ only on Windows, I should not have to re-define $prompt_sign. I guess I need to move the second $prompt_sign to the if-clause below
10:45amfvogtwiert: Ah, so it ships with a WiFi enabled DT + Kernel with the TW image
10:45amfvogtIf you zypper dup then, it’ll switch to the DT + Kernel from plain TW, breaking everything
10:46amwiertWhat’s DT?
10:46amwiertdriver-tree?
10:46amfvogtClose, device-tree
10:46amwiert(that gist has all the steps I performed)
10:46amfvogtIt contains the assignment of memory and other HW resources to each other and drivers
10:47amfvogtwiert: “dtb-broadcom  obs://build.opensuse.org/devel:ARM -> openSUSE”
10:47amfvogtThat’s most likely the issue
10:48amfvogtYou can recover from that by downloading the right .dtb file and putting it on the sd card manually
10:48amfvogtAlternatively, the u-boot embedded one should still work, so you can delete the DT on the SD and it should boot again (with some missing peripherals though)
10:51amwiertI’ve already put a fresh disk image on it and I’m in the midst of configuring it for my brother (he’s mentally retarded and I’m putting it behind his TV so he can view his agenda electronically to see if that gives him more stability in organising his life; I need to be at his place in 2 hours)
11:27amwiert@fvogt: I will add this part of the IRC chat to that blog post and try to get your suggestions done when the spare RPI3s get in.

–jeroen

Read the rest of this entry »

Posted in *nix, Development, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, SuSE Linux, Tumbleweed | Leave a Comment »

NeonHorizon/lipopi: Guide to setting up LiPo batteries on the Raspberry Pi

Posted by jpluimers on 2017/04/12

Interesting hardware project: NeonHorizon/lipopi: Guide to setting up LiPo batteries on the Raspberry Pi

Pictures: Daniel Bull – Google+

Basically it’s a mini-UPS that works for any Raspberry Pi, but for a model 3 you have to add a tiny capacitor.

From the readme:

  • Description: LiPoPi is a guide to setting up the Raspberry Pi with a LiPo battery including both running and charging it
  • Project Website: GitHub
  • Requirements: A Raspberry Pi (any model – see notes about the Raspbery Pi 3) and an Adafruit PowerBoost 500 Charger or 1000C Charger
  • Skillset: Requires soldering skills and a basic knowledge of the command line
  • License: GPL Version 3

–jeroen

Read the rest of this entry »

Posted in Development, Hardware Development, Raspberry Pi | Leave a Comment »

Having one Raspberry Pi reset another Raspberry Pi through relay or transistor

Posted by jpluimers on 2017/04/11

I’m going to build this later, but as the follow up on shortening the RUN pins of a Raspberry Pi to reset it in The woods and trees of OpenSuSE on single-board computers – image abbreviations – and getting it installed using OS X, I want to see if the below will work for me to have a pair (maybe trio?) of Raspberry Pi devices watch each other and reset any hung one.

The need comes because sometimes a Raspberry Pi either hangs or just won’t finish a reboot sequence:

Basically a Raspberry Pi has GPIO pins that can drive electromechanic (like mechanical relay) or electronic (like transistor+resistors or SSR solid-state relay). Examples:

So basic steps:

  1. Get switching gear (relay+diode, transistor+resistors or solid-state-relay)
  2. On each Pi modify the RUN holes so it has a header
  3. Connect header to switching gear
  4. Write watch-dog code to monitor other Pi and flip GPIO pin
  5. Test, test, test

And since I’m relatively new at electronics:

–jeroen

Read the rest of this entry »

Posted in *nix, Development, Hardware Development, Linux, openSuSE, Power User, Raspberry Pi, SuSE Linux | Leave a Comment »

127.0.1.1 in /etc/hosts for your hostname?

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 »

OpenSuSE Tumbleweed on Raspberry Pi: getting `vcgencmd version` to work to see which GPU firmware you have

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 »

OpenSuSE Tumbleweed on Raspberry Pi: using Hexxeh/rpi-update to update the firmware

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 »