Showing posts with label RealVNC. Show all posts
Showing posts with label RealVNC. Show all posts

Monday, 25 May 2020

Setting a default screen size for a headless Raspberry PI

I have a few Raspberry Pis, and most of them are run "headless" (without keyboard or display).

Now the default screen size for a headless PI is what used to be called VGA and has a resolution of 640 x 480. This was state of the art in the 'nineties, but unfortunately the majority of software expects a larger display. This means that programs tend to fall off the available screen size, in some case losing the close button as well.

You can set the display resolution via the Raspberry Pi configuration tool or via the command line using raspi-config. The problem is that there is no guarantee that your chosen display mode will then work with your monitor.

This particuklar resolution (720p) works okay on monitors and via VNC. Other options are available.

This can be set by editing the config.txt file

sudo nano /boot/config.txt

Scroll down to this section (the highlighted text areas will probably read VGA and 1 respectively). Change the mode to 4 and the resolution description - that is for your information later).
# uncomment to force a specific HDMI mode (this will force 720p resolution)hdmi_group=1hdmi_mode=4
Use Control X, Y to save and accept the default file name to save the changes.

Reboot your machine and you should have a much more workable graphics screen on VNC.

References

Sunday, 3 May 2020

Chaos - and the Headless Raspberry Pi

Cryptography is a voracious consumer of randomness, and computers depend on cryptography for security. Most operating systems harvest this randomness (under the name of entropy) from various pieces of hardware, quite often from mouse movement or keyboard operation. This is fine when the computer has a keyboard and/or mouse, but what happens when the computer is running headless?

Raspberry Pis quite often run headless, and remote operation using products like RealVNC encrypt the communication between the server and the client. To maintain security, no connection can be made until there is sufficient stored entropy. This can lead to long delays between switching the computer on and being able to connect to it remotely.

The package haveged is available in Debian based systems (including Raspbian and Ubuntu) and fills the entropy pool when the supply falls below a set value. This will speed up the start up of RealVNC.

Installing haveged

sudo apt-get install haveged

References


Saturday, 2 May 2020

Raspberry Pi 4 and the Pimoroni Heatsink case

The Raspberry Pi 4 was released in June 2019, but I have only just bought my first one. When released, there was a 1GB, 2GB and a 4GB version. The 1GB version has been discontinued for consumer purchase, but in line with the Raspberry Pi Foundation's long term support ideals will be available for commercial purchase while there is still demand.
The board is supplied in a standard cardboard box with a (very brief) quick start and be careful guide.
I forgot to photograph the board before assembling it into its shiny new case. Maybe next time.

I bought my Raspberry Pi 4 from Pimoroni, and I also bought their bright and shiny Heatsink case.

Before assembling the board into the case, I installed the latest version of Buster onto an SD card using the Raspberry Pi Installer. This was then inserted into the board.

It was at this point I realised that I had forgotten two things.
The Raspberry Pi 4 is a lot more power hungry (hence my choice of the heatsink case) and so has moved away from the traditional micro USB power connector to the USB C type connector.

The second is that to make use of the dual 4K screen option, the monitor connection(s) use the Micro-HDMI connector.

There is a dedicated USB-C power supply available, and I probably should have ordered one (there is also a micro USB to USB-C adaptor). However, I ended up buying a 1m USB-C cable from my local supermarket.

The micro-HDMI cable would have been a bigger issue, but it turned out I had one in my cable collection.

Assembly of the case was straightforward. There is a tutorial here.

The only problem I had was with the thermal conductive pad. When I came to remove the backing sheet, it managed to tear and ended up looking like a blob of blue tack. Luckily there is a spare one which came in handy. So when fitting the thermal conductive pad, be very careful.

Here is the Raspberry Pi securely fitted into its case.

As you can see, the network port and the USB connectors are exposed, not just the sockets. The case will keep fingers away from the delicate components but it does not protect against much else.

There is a slot for the screen out cable, and the camera cable. The power over Ethernet port is also exposed.
The GPIO is available. It is claimed you could just plug a HAT in as normal, but it is recommended that you use a  booster header to raise the HAT well clear of the case to prevent any chance of it contacting the case and causing a short.
Side view showing the GPIO pins.
End view showing the USB 3 and USB 2 sockets and the higher speed Ethernet connection.
The other side view, showing the USB-C power socket, two Micro HDMI sockets for dual monitors and the composite/headphone socket.
The other end view showing the micro SD card and the camera connector.
If you have the option, it is well worth having your Raspberry Pi plugged connected via Ethernet. It makes the initial set up so much faster.

The Raspberry Pi 4 require Raspbian Buster or higher. The default behaviour appears to be different to previous builds. Previously, if you started a RaspberryPi up without a monitor, it would (by default) have a (virtual) GUI screen with what looked like VGA resolution. If you were using it with RealVNC to operate it remotely, this would be annoying as the resolution was not compatible with most of the applications etc. With Buster, no GUI screen (virtual or otherwise) is generated. If you plug a monitor in later, you just get a blank screen. This is annoying.

The solution is to set a default screen size (be careful that this screen resolution is actually supported by your monitor.

This can be done via the command line using:
sudo raspi-config

Saturday, 15 December 2018

Raspbian Pixel desktop VNC Viewer

Since September 2016, all Raspberry Pi Raspbian distributions have included the RealVNC Virtual Network Computer server and viewer.

This allows the remote connection to the desktop on a Raspberry Pi machine. This is great if you want to to run your Raspberry Pi "headless" and do not want to use the Secure SHell (SSH).

You can connect to your Raspberry Pi from another (non Raspberry PI) machine by downloading and installing the RealVNC viewer (make your selection from the operating systems shown here https://www.realvnc.com/en/connect/download/viewer/. The RealVNC viewer is available from the Google Play Store (and probably from the Apple store as well). For Raspbian on the Raspberry Pi, wou can just get it from the Raspbian repository using the normal apt-get install (instructions are available from the above link)

Now I have an elderly Samsung Windows Netbook which is having a second life as a Raspbian Pixel netbook. Now this would be really useful to see what is happening on any live Raspberry Pis. Unfortunately, the non Raspberry PI distribution of Raspbian does not contain the RealVNC viewer.

So going back to the RealVNC downloads page, select the Linux option:
https://www.realvnc.com/en/connect/download/viewer/linux/

You need to select DEB x86 from the drop down menu, then click on Download VNC Viewer.

The file will (by default) appear in your Downloads directory. The one I received was called VNC-Viewer-6.18.907-Linux-x86.deb.

In the File Manager, right click and select Package Install. This will request your password to give the installer permission to make changes to the operating system (in the same way that normally you use SUDO to give heightened permissions).

Once it has been installed, the RealVNC viewer can be found in the Internet options on the start menu.

You will need to know either the ip address of the Raspberry Pi, or the network name. A default Raspberry Pi is normally called "raspberrypi", so should appear on the local network under the name "raspberrypi.home".

References: