post

Raspberrry Pi 400, first steps

First steps with the Raspberry Pi 400, first impressions
November 2, 2020. My birthday!
Early, checking twitter. Eben Upton says good morning. The Pihut responds and some tweets about children follow.
I recognize the pattern: if Eben is up this early online, it must be an announcement. And yes, there it is: the new Pi 400!
A Pi 4 in a keyboard, a homage to the home computers of the 80ties, a relief for those who worry about a naked PCB with untidy cabling in a school class, and all that value and performance for a low price!

So I gave myself a present, and ordered the Pi 400 immediately at The Pi Hut. After a week (quite fast this time for UK mail!) it arrives, a small rectangular package. Inside the Pi 400 and a power supply. I ordered the Pi 400 itself, not the package. I have enough cables, mouse etc.. And I do not want to use a SD card.

After installation and configuration, covered below, the fun starts. What a nice little machine! Reminds me of the home computers in the 80ties of previous century, which I tested and wrote so much about then. But in an modern format, with a modern and capable operating system, hardware fast enough for the most tasks, easy to integrate in my home network and systems.
Cool, compact, well protected, a mature operating system, Linux Debian nicely adapted to the Pi 400 and satisfies the needs of a regular user like me, with a Windows 10, Synology NAS and Pi’s network. You can see a lot of thought and work has gone into the design of the Pi 400 and it pays off!

Will it be my main PC? No, not really. That will be the Intel with Windows 10 power for photo and video editing, large software development, ergonomic and excellent Microsoft keyboard and mouse with three large displays,  large fast disks, lots of memory and CPU power.

Will it be my second PC? Yes, there is enough I/O and enough performance for web browsing, mail, media center, software and hardware development for the Pi with e.g.  Lazarus, for the other Pi’s here. With some cheap simple USB and SSD devices it keeps affordable and good enough.

All in all, it has found a place on my desk and in my network, it will be of real value to me!

What I cover here is:
Configuration
Installation to SSD
Audio: USB Audio and fight with Bluetooth
Camera, USB webcam
Overclocking
File Manager, access my Windows and Synology network shares
GPIO connector


Configuration
I opted for the Pi 400, US keyboard, and not the package. I have enough cables and mouses, and plan to skip the SD card completely.

Nicely packaged, online documentation only. Here is the (hard to find!)  Beginner’s Guide, 4th edition pdf download. Well written, recommended for new users. After many years working with Pi’s (since 2012) and keeping up to date with the blog and the forum, I found configuring and setting up the PI 400 quite easy.
As you can see in the photo I added to the Pi 400:
– USB hub into the USB 2 port, four USB ports for the next USB devices
– mouse (any USB mouse will do, I use the Raspberry Pi Mouse)
– USB audio adapter (a cheap one)
– USB webcam (an older simple one)
– HDMI mini to HDMI female  adapter cable to a DVI adapter to  (no HDMI on this Displayport/DVI/VGA)  IIyama monitor!.
– CAT5 Ethernet cable to the GHz network
– USB C power adapter, the official one
– USB-3 Eluteng adapter to SATA 120GB SSD disk (this Eluteng, has ASM IC, works fine)


Installation to SSD, no SD required!
I am not that fond of the SD card as system disk for a computer. Though in the real world it does work fine for most of us, it not designed for heavy computer use, wears out and is not that fast. For embedded usage it is ok, for a desktop a real larger computer hard disk is better. So for the Pi 400 I choose a SSD with an Eluteng USB 3 adapter. USB booting is now working well on the Pi 4 out of the box.

So I took the SSD to my WIndows PC, started the Raspberry PI Imager, choose the “Raspberry Pi OS (32-bit) with desktop” as OS and the SSD as “SD card” (yes, that is supported!).
Writing the image was very fast compared to imaging an SD card!

The SSD was then attached to a USB-3 port of the Pi 400, and power switched on. It took some time, be patient, not too much status messages shown, file system expanded, reboot and then the Raspberry PI OS screen appeared and the usual questions asked. Which HDMI port? It seems not to matter!
The automatic updating/upgrading took quite some time, but after another reboot, the Pi 400 was up and running. Subsequent boots are very fast compared to SD booting!
The SD card reader? Not required for the OS, free to use, with automatic mounting.


Audio, USB Audio and fight with Bluetooth
A desktop PC without audio is not done. The Pi 400 has standard audio via HDMI. Now HDMI monitors may have a loudspeaker, but not high quality.
HDMI to DVI does not support audio. Other PI’s have analog audio out, the PI 400 does not have this, and it is not a real loss, it is of mediocre quality).

 

 

So what options for audio do I have?
– a cheap and good quality USB Audio adapter. That works well, good stereo analog audio to the soundbar on my desk.
– Bluetooth audio. Connecting and pairing to my soundbar Bluetooth succeeded, VLC plays audio fine.

But Chromium refuses to play. Known bug it seems with the current version of Chromium, I read more complaints on the forum. Note that I did not install any additional Bluetooth component, PulseAudio seems to break any chance of audio. Builti-n Bluetooth support is enough (but not pleasant to work with, as on all OS’es it seems). Chromium will hopefully be repaired soon.

Update: Fixed in New Raspberry Pi OS release — December 2020

Bluetooth sound now works for all web sites I tried, youtube, radio stations.
Do the update as https://www.raspberrypi.org/blog/new-ra … mber-2020/ describes.

Camera, USB webcam

A desktop PC without a webcam is not done, So I searched in my drawers and found an older USB Webcam. Not the best quality, but it shows a normal USB webcam works fine on the Pi 400.

 

 

 

 

 

This requires an additional software install, in a terminal type:

sudo apt install fswebcam.

A simple test with a webcam testpage showed it functions fine. as shown in the photo.


Overclocking
The Pi 400 runs un 1.8GHz and stays cool with that large metal cooling plate.
Overclocking is not really necessary, but some extra is always welcome. And the Pi stays just as cool!
Stay with recommended values not violating warranty:, perform the following in a terminal

sudo nano /boot/config.txt

Change the line with arm_freq to:

arm_freq=2000

Add the line

over_voltage=6

and reboot.


File Manager, access my Windows and Synology network shares
My network is made up of many systems. My main workstation is a power Windows 10 notebook with more screens. Further I ahev many Raspberry Pi’s, ESP8266, ESP32 nodes around. Arduino and propriety media servers, Chromecast. Several security camera’s served by Synology . My main storage is made up of two Synology NAS servers

So I took a look at what the Raspberry Pi OS Filemanager offers, And I was pleasantly surprised with the current state and posiibilities!

First I unleashed the ‘hidden’ things:


Uncheck:
Display simplified user interface and menus
Check
– Filesystem root
– Devices
– Networks
– Volume and Mounts


Now when I click on Networks in the left folderview, I see part of my network, the two Synology NAS systems.

Clicking on the Synology NAS (File Sharing) gives a list of shares on this NAS server (SMB network)

Now the file manager asks for username and password (and workgroup name). It offers to remember those, but most of the time it forgets anyway.
If you make a mistake in name or password, the fields are just cleared, no error appears.

Now you see the folders in the share and can work with the files. Depending on share and user also writing, determined by the NAS admin.


When you choose the Windows Network, nothing is shown but an empty panel and in the top field the text ‘smb:///’. Change smb:/// to smb://<computername>, where <computername> is the name of a Windows PC.
In my case it is smb://asusho


The shares of the Windows PC are now shown, select one and the usual username password form is shown. Fill in a LOCAL user on the Windows PC, which has access to the share you want. The usual Windows username, an email address, does not work. Create if needed a local Windows user and grant access to the share.


If all checks out, you have now access to the share, in this case the data disk of my Windows PC asusho.


GPIO connector
The well known 40 pin GPIO connector is available, on the backside. Now that is not too handy for the many HATs available.

I expect to see some aftermarket solutions for that with cables and cases!

A short 40 pin flatcable female-female, e,g, as supplied with a T-Cobbler makes it easy to connect to a breadboard as seen in the photo.

Note that these 40pin connecters have notches on the top, which fit nicely in the Pi 400 and the T-Cobbler connector. So no mistakes in orientation may be made, as with the other Pi’s.

post

HQ camera and Canon lenses

This is a summary of my tests of the RPi HQ Camera and some Canon EF-S lenses.
(all photos made with the HQ camera are untouched and full size, click to view).

The results are not bad, the Canon lenses are usable, easy to change, focus is manually, they enhance the quality. The 6mm RPi is no match to any Canon, the 16mm is not bad at all.

Much has already been written about the new (spring  2020) HQ camera available for the Raspberry Pi.
Now one can argue if this is a HQ camera (12M pixels, no focus facilities), it certainly got the interest of the Pi community, the cameras and lenses seem to sell well.
Not to be positioned as a Pi Camera V2 replacement (much more expensive, larger in dimensions), it can be a quality camera  to do projects with.

Certainly not a photo/video camera replacement (even a phone camera is much easier to wok with, depth of view and focussing is too limited) , but will have its place in vision applications demanding higher quality images under computer control.

Since the camera comes without lens, but has a C or CS lens mount adapter, it is possible to choose a lens, like the two  available form the Pi Foundation.
I have bought both together with the camera, resulting in reasonable images but a pain to focus, let alone to change the focus often. The small one has a reasonable depth of view, and a wide view and lots of cushion distortion and color aberration. The bigger one is better, more a telelens.

The C mount allows more freedom in the choice of lenses, so I thought about checking out my (really high quality) Canon EF lenses.

This requires a C mount to Canon adapter. A metal one is on its way (May 10) from China, a metal one. In the meantime I set my 3D printer to work on 3D printed adapters.
I found two in Thingiverse:

Canon_EF_lens_to_C-MountCF-Mount_CCTV
Canon_EF_lens_to_C-Mount_w__stand
and printed both.

Some remarks about the two designs:

Canon_EF_lens_to_C-Mount_w__stand

The STL is missing the sizing information as required by the slicer program, as noted in the comments section. The trick to get a correct STL is to upload the STL in Autodesk Fusion and export as STL (with a new name of course!). It then prints fine in the right scale, once rotated and landed lying on its Canon side with supports and a brim. Reduce layer to 0.1.


It fits the Pi camera without adapter. I suppose I should have used a finer print, screwing on was hard, a gap was still present.
The tripod adapter needs to be removed from the camera, otherwise it will not fit.
The stand makes it a very stable setup on a table. I did not yet glue a tripod screw on it.

Canon_EF_lens_to_C-MountCF-Mount_CCTV
Prints fine, rotated and landed lying on the Canon side, with a brim. Reduce layer to 0.1.

It fits fine in the Pi camera (without c to cs adapter). The camera’s tripod support can be used, the result is quite unstable with a small table tripod and a real lens, a real tripod works fine, but the Raspberry Pi computer needs to be close and not dangling on the side. A longer camera cable of 50 cm helped a lot.

First impressions.

With each lens a photo of a test chart, printed on my laser printer, on the wall and a plant in the window.
Distance between camera and object for all lenses is 60 cm.

Focussing and capturing photo has to be done manually by looking at the monitor display running this command:

$ raspistill -fw -md 3 -q 90 -k -v -o filename

The – fw switch requires downloading and building Raspbian userland, it gives a numeric indication of the quality of the center part of the screen. Very helpful to get to the best focus.
The -k -v keep the camera image on screen with a prompt until Return key is pressed. Note that the -k in combinationwith other image formats like PNG do not work.

Canon EF-S 18-55 IS
Only way to focus is to adjust the zoom, making it a fixed length. Very high quality.

Canon EF-S 18-135
More a telelens. Same remarks as the EF-S 18-55.

Canon 40 mm (Pancake)
With a 13 mm ring added and about 25 cm distance between camera and object.


EF-S 60 mm Macro
Unable to focus

EF-S- 55-250
Unable to focus

6mm 3MP Lens for HQ Camera
Not easy to focus, extreme sensitive to small movements. Low quality, cushion distortion is high, wide view.

16mm 10MP Lens for HQ Camera
Not easy to focus, extreme sensitive to small movements. Quality is allright. Smaller view of point.

post

Tiny LCD Screens

Over the years I have collected several tiny touch LCD screens for the Raspberry Pi which are based on sending the framebuffer display data via SPI to the screen.
This has been made possible by the work of Noralf Trønnes aka notro as documented on his github page.. The resulting driver made its ways into upstream Linux. Some displays got now device tree support and can be used with the latest Raspbian versions.

Only the TinyLCD 3.5 survices my current test as being fully supported, fast screen refresh and operational under Raspbian now and in the future.The  Adafruit 2.8 LCD also survices the test with a bit special installation.

The Kedei V2.0 and Itead V2.0 are frozen in time with OS support Jessie 2015 and slow refresh rates, and will not see much use by me, perhaps as a front end if a Zero runs Jessie.

All displays support touch, of the resistive type. So a pen is the preferred way to operate, anyway these screens are too small for finger touch.

Itead 2.8 TFT Add-on V2.0. I have 2. Installation post here.

Advantages
– Nice screen quality.
– GPIO connector available via breakout
Disadvantages
– OS support frozen in time, Jessie 2015
– slow screen updates
– Small screen, supporting PCB bulky

TinyLCD 3.5. Installation post here.

Advantages
– Nice screen quality.
– GPIO connector available via breakout
– Current Raspbian support
– Fast refresh
Disadvantages
– GPIO breakout is bulky (but can be removed)

Adafruit 2.8. Installation post here.

Advantages
– Nice screen quality.
– GPIO connector available via breakout
– Current Raspbian support
– Fast refresh
– 4 buttons on 4 GPIO’s
Disadvantages
– GPIO breakout is bulky

Kedei 2.0. I have 2. Installation post here.

Advantages
– Nice screen quality.
– Connector blocks only part of GPIO connector, many I/O free.
Disadvantages
– slow refresh
– OS frozen in time, Jessie 2015.

post

Experiments and boards

A Raspberry Pi  or Arduino is a perfect companion for experiments, but you need some hardware support during development and deployment.

Here I show you the breadboard development tools I have first, followed by deployment boards.

Breadboard experimenters boards

Traditional extenders into a breadboard. From Adafruit and China, 26 pin (yes, that old) and 40 pin with a flatcable to the Pi. I do not like these very much.

Rasp.io Breadboard Pi Bridge – Pi Ports to Breadboard in Numerical Order. Nice setup, can be used with a Pi B or a Pi Zero. Easy to locate the pins with the descriptions on the PCB.
No Dupont wires required (except for +5V). .Blocks the power rows alas.


RasPiO Pro Hat Protect/Position Raspberry Pi Ports. Ideal if you fear damaging your Pi, has current limiting resistors on the GPIO pins.
Disadvantages are that these resistors may interfere e.g. I2C or SPI and the very small breadboard. Seldom used.

A simple and cheap Chinese breadboard solution. Requires Dupont wires and a printed pin layout required. Works fine, affordable Prototype comes close to deployment layout. Recommended.

The Wombat, a great experimenters board. Much I/O on board (serial to USB, ADC MCP3008, 2 button,s 4 output LEDs, power regulator for +3.3V. All jumpered.Well documented single in line I/O connector.
Large breadboard! The best board in my collection! From Gooligum Australia.

Sunfounder China, experiments Raspberry Pi and Arduino Uno or Mega. Solid, large breadboard, recommended.

Arduino Uno experimenters boards, acryl, from China.

Deployment boards

These boards are where the permanent circuit will be soldered on. Essential are the GPIO connector and enough solder islands.


Richard Saville aka AverageMan made a great collection of boards, I have many in use.

A Chinese (40 pin) and Adafruits board (26 pin, yes that old). The Chinese ones are affordable and great for deployment. Recommended!

Mini Mega deployment board. From China.

Itead 2.8 TFT Add-on V2.0 Touch

A small display, again one of those LCD screens attached via SPI. slow refresh, OS support frozen in time.

Instructions that worked for me, April 2020. 

https://www.itead.cc/blog/raspberry-pi-b-2-8-tft-add-on-v2-0-touch-function-realizing


Download Raspbian-2015-02-16.img into SD card, then launch Raspberry Pi B 
Its old Wheezy Debian, unsupported and outdated, so make sure you change to the legacy update, the official repository moved on. But there is a legacy repository!

Replace this line in /etc/apt/sources.list
deb http://legacy.raspbian.org/raspbian/ wheezy main contrib non-free rpi

Now you can do the 

sudo apt-get update

Do the usual raspi_config, add SPI support

sudo nano  /etc/modprobe.d/raspi-blacklist.conf
Comment the mask of spi out
#blacklist spi-bcm2708

Connect Raspberry Pi B+ 2.8 TFT Add-on V2.0 to Raspberry Pi B+ correctly

sudo apt-get install xinput evtest tslib libts-bin

Download the fbtft driver, and you may need to run the following command three times:
sudo REPO_URI=https://github.com/notro/rpi-firmware rpi-update

Finally get the codes:
*** Running pre-install script
Work around rpi-update issue #106
*** Updating firmware
*** Updating kernel modules
*** depmod 3.12.21+
*** Updating VideoCore libraries
*** Using HardFP libraries
*** Updating SDK
*** Running ldconfig
*** Storing current firmware revision
*** Running post-install script
/lib/firmware
*** Deleting downloaded files
*** Syncing changes to disk
*** If no errors appeared, your firmware was successfully updated to b77683205688d3f6ae2b32a3c7
f4e63de1c06a5d
*** A reboot is needed to activate the new firmware

By now,you need to reboot your Raspberry Pi B+
sudo reboot

sudo touch /usr/share/X11/xorg.conf.d/99-fbdev.conf

Configure the file /usr/share/X11/xorg.conf.d/99-fbdev.conf

sudo nano /usr/share/X11/xorg.conf.d/99-fbdev.conf

Section "Device"
  Identifier "itdb28"
  Driver "fbdev"
  Option "fbdev" "/dev/fb1"
EndSection

sudo modprobe fbtft_device name=itdb28 gpios=reset:5,dc:6,wr:12,cs:13,db00:20,db01:21,db02:22,d
b03:23,db04:24,db05:25,db06:26,db07:27 rotate=90 fps=50

Add the following contents to file /boot/config.txt
dtoverlay=ads7846,cs=1,speed=2000000,penirq=17,swapxy=1,xmin=230,xmax=3850,ymin=190,ymax=3850,p
max=255,xohms=100
startx &
 (you may have to reboot)

Load the touch driver
1.Add the following contents to file /boot/config.txt

dtoverlay=ads7846,cs=1,speed=2000000,penirq=17,swapxy=1,xmin=230,xmax=3850,ymin=190,ymax=3850,pmax=255,xohms=100
2.Reboot Raspberry Pi B+

sudo reboot
3.Load TFT display driver

sudo modprobe fbtft_device name=itdb28 gpios=reset:5,dc:6,wr:12,cs:13,db00:20,db01:21,db02:22,db03:23,db04:24,db05:25,db06:26,db07:27 rotate=90 fps=50
4.start up X Server

startx &
Adjust the X&Y directions of this touch screen
DISPLAY=:0 xinput --set-prop 'ADS7846 Touchscreen' 'Evdev Axis Inversion' 0 1
Test
·Check the event’s number which is in accord with the touch screen.

	cat /proc/bus/input/devices

This event’s number here is event3, then you need to execute the following command to do the calibration and test touch screen according to the event’s number you’ve got. When do calibrating, you’d better use touch pen to click the cross’s center unless you want a rough calibration result.

·Touch screen calibration

sudo TSLIB_FBDEVICE=/dev/fb1 TSLIB_TSDEVICE=/dev/input/event3 ts_calibrate

Hyperpixel 3.5 Pimoroni

3.5 inch touch screen. Superseeded by Hyperpixel 4.0

Reasonable quality, touch is, though it i capacitive, not too easy to use. Resistive screens an be handled with pens, not this one.

With current Buster not a perfect pair.

Two experiments:

Raspberry Pi 2 B V1.2 success

1 imaged a SD with current Buster (feb 2020)
2 booted on a Pi 4 1 GB
3 did the usual raspi-config things and update/upgrade
4 checked out the system, works as expected
5 curl https://get.pimoroni.com/hyperpixel | bash
6. rebooted , installed Hyperpixel

Result is a working display, HDMI whosw rainbow screen, touch is wrong, cursor moves opposite directions, axes mixed up.
So not too bad, but touch not configured correctly.

Fixed with, in a console window, the command

$ hyperpixel-rotate normal

which changed the orientation of the screen to what is aleady was, and changed the touch matrix to a working touch.

So far so good.

Raspberry Pi 4 1 GB failure

To check out the Pi4, current Buster (feb 2020) and Hyperpixel 3.5 I did the following:

1 imaged a SD with current Buster (feb 2020)
2 booted on a Pi 4 1 GB
3 did the usual raspi-config things and update/upgrade
4 checked out the system, works as expected
5 curl https://get.pimoroni.com/hyperpixel | bash
6. rebooted , installed Hyperpixel

Result is not a working Hyperpixel display, but reverse image on HDMI, Hyperpixel dead.
Which is the same effect as booting from the working Raspberry Pi 2 SD.
Maybe the curl https://get.pimoroni.com/hyperpixel | bash gets the old hyperpixel install and not the Pi 4 version? Looks like it.

So back to

1 imaged a SD with current Buster (feb 2020)
2 booted on a Pi 4 1 GB
3 did the usual raspi-config things and update/upgrade
4 checked out the system, works as expected
5 downloaded the Hyperpixel Pi 4 git repository
6. rebooted , installed Hyperpixel with ./setup.h

Result is Hyperpixel noise banner, HDMI shows normal screen

So install fails with the curl or setup, and instructions clearly wrong.Issue opened at Pimoroni.