Apparent diameter plot for Jupiter 2017-2026

The apparent diameter of Jupiter varies with the Earth-Jupiter distance. Depending on the distance, the apparent angular diameter of Jupiter is between approx. 0.5 and 0.8 arcminutes. For best astrophotography results, one should pick a time when Jupiter is closest. Similar to my plot of the apparent size of Venus, I wrote a short program to plot Jupiter’s apparent diameter for the time period 2017-2026:

Plot of apparent diameter of Jupiter for the time period 2017-2026
Plot of apparent diameter of Jupiter for the time period 2017-2026

Apparent diameter plot for the Moon 2017-2018

The apparent diameter of the Moon varies with the Earth-Moon distance. Depending on the distance, the apparent angular diameter of the Moon is between 29.4 and 33.5 arcminutes. For best astrophotography results, one should pick a time when the moon is closest. Similar to my plot of the apparent size of Venus, I wrote a short program to plot the Moon’s apparent diameter:

Plot of the apparent diameter of the Moon for the time period 2017-2018
Plot of the apparent diameter of the Moon for the time period 2017-2018

Venus apparent diameter plot for 2017-2020

The apparent size of Venus varies dramatically with the Earth-Venus distance, depending on both orbits around the sun. The apparent angular diameter of Venus is between 0.175 and 1 arcminutes.

Phases of Venus and evolution of its apparent diameter. (Statis Kalyvas - VT-2004 programme)
Phases of Venus and evolution of its apparent diameter. (Statis Kalyvas – VT-2004 programme)

Wikipedia has nice images on that and says that…

“the extreme crescent phase of Venus can be seen without a telescope by those with exceptionally acute eyesight, at the limit of human perception.”

I will definitely try next time with my naked eyes, but if you have an entry-level telescope, you will be certainly be better able to see the crescent phase during closest approach.

The question is, when does Venus come closest to Earth for best observation? Not finding anything on the interwebs, I wrote a quick plotting program with Python’s ephem package and gnuplot.

Venus apparent diameter plot for 2017-2020

Graph of apparent diameter of Venus in arcminutes for the time period 2017-2020
Graph of apparent diameter of Venus in arcminutes for the time period 2017-2020

Here is the very short Python program that calculates the apparent diameter of Venus for 4 years beginning with January 2017:

Reading Raspberry Pi chip temperature with mainline Linux kernel

This tutorial is based on a previous article where we installed pure Debian 9 with a recent mainline/vanilla Linux kernel on a Raspberry Pi, and so differs from what would be done on a Raspbian Distribution with a Raspbian kernel. In this article, we will read the Raspberry Pi chip temperature. Here is my previous article:

Raspberry Pi 2 running pure Debian 9 (“Stretch”) and the Linux Mainline/Vanilla Kernel

As of mainline Linux Kernel 4.9.0-rc3, the sysfs entry /sys/class/thermal for the Broadcom BCM283x chip found on Raspberry Pi’s is empty. You can apply the following patch to Linux kernel 4.9.0-rc3, even though it will soon be superfluous because it seems that currently there is ongoing work by Linux Kernel developers to add in the missing functionalities.

The patch which will get you the standard sysfs temperature node which you can read like this:

This is the chip temperature in thousandths of degrees cenigrade, i.e. 40.084 degrees Celsius.

The following patch will give you a new entry in the mainline Kernel config, under Drivers -> SoC -> BCM -> Raspberry Pi thermal sysfs driver, which you have to enable, then recompile your kernel.

I have actually submitted this patch to a Linux kernel developer, but the process to get code into the Linux kernel is quite elaborate, and he said that they are already working on it, so I let it drop and decided to write this blog post instead.

 

Setting I2C bus speed on a Raspberry Pi via Device Tree

This tutorial is based on my previous article where we installed pure Debian 9 with a recent mainline/vanilla Linux kernel, and so differs from what would be done on a Raspbian Distribution with a Raspbian kernel. In this article, we will set the I2C bus speed on a Raspberry Pi. Here is my previous article:

Raspberry Pi 2 running pure Debian 9 (“Stretch”) and the Linux Mainline/Vanilla Kernel

Device Trees

The I2C bus on the Broadcom BCM283x chips found on Raspberry Pi’s is well and directly supported by the mainline/vanilla Linux kernel. Since with the Raspberry Pi we’re dealing with a System on a Chip (SoC), and not a regular PC, the hardware is configured with so-called device trees, which is a low-level description of the chip hardware compiled from text into binary format.

The rpi23-gen-image script mentioned in my previous tutorial installs the binary device tree into /boot/firmware/bcm2836-rpi-2-b.dtb. The U-Boot bootloader can read this file and pass it to the Linux kernel which interprets it and enables all the mentioned features in it.

The clock frequency for the I2C bus is configured in this .dtb file, and the default is 100kHz. There is a tool which allows you to inspect the .dtb file, outputting regular text. With this tool you also can make changes to the device configuration. Nowadays, this is the proper way to configure low-level devices on SoC’s!

 

Read the device tree

This will output the decoded device tree as text. Regarding I2C, you will find i2c@-entries like this:

Change the device tree

The clock-frequency value is what we want to change. The value is a raw binary unsigned 32-bit int stored big-endian, unreadable for humans.

But you can use another tool fdtget to read just this value decoded:

This will output 100000.

In my case, I wanted to set the I2C bus to the slowest frequency, to compensate for long cable lengths. I found that one of the lowest supported I2C clock frequencies is 4kHz. With fdtput you can set the clock-frequency property for each i2c device (there are 3 on the RPi):

And that’s it. You have to reboot for these settings to take effect.

I used an oscilloscope to verify that the SCL pin of the GPIO of the RPi indeed toggled with 4kHz, and it did!