Hardware testing

I have begun receiving hardware parts. Testing is being perfomred on the Pi zeros to get an acurate grasp on the true numbers.
Long post warning



I did very simple testing on these cables. I have a cable checker TRENDnet TC-NT2 just doing a simple plug and check showed all my cables are made correctly.

Ethernet jack

The jack I purchased can be here is a 10/100 USB micro Ethernet adapter
I used a cat 5e cable connected from my pi to a laptop to perform this test.


Lets first create a test file

dd if=/dev/zero of=/home/tmp/zero bs=1073741824 count=1
1+0 records in
1+0 records out
1073741824 bytes (1.0GB) copied, 5.016000 seconds, 204.1MB/s

dd called disk destroyer is a very powerful command make sure to read the manual before using it as you can, as the name suggests, destroy a disk.

next we copy the file over.

scp zero user@
zero ---------- 100% 1024MB  13.3MB/s   01:17

Ok not to bad 13.3 MB/s

Sending over a smaller file I get much worse speed

scp smallFile user@
smallFile ---------- 115MB   4.4MB/s   00:26

Not what I was expecting but lets look into what factors may be impacting this.

  • The Ethernet is a USB 2.0 port USB 2.0 is rated a 420 Mbits/ second or 64MB/s
  • The SD card is a U3 clasos sd card rated at 30 MB/s
  • The speed of the PI zero SD card slot is rated for 40 MB/s

So why the slow down. I am not sure why the small file was so slow. but for the overall speed I want to explain that we are looking good. My first impression was sadness as I thought this was 10/100 MB/s but the card is rated at 10/100 Mb/s, OK lets do the conversions
A 10/100 card running at 100 Mb/s would be capable of 100 million bits per second. A byte is 8 bits, so divide by 8 to get 12.5 MB/s. Fantastic. Now we can see we are well within the spec of the device.

The downside

Not to much of a down side here but copying a file from the pi is a lot slower speed.

 scp  user@ .
zero ----------  100% 1024MB   5.8MB/s   02:57

all in all it is not truly bad.

Pro side

I have no need for this high of speed. I would be over saturating my clusters switch if I was at this speed all the time. and on top of it i wont be sending this large of files ever. So overall the Ethernet jack is a success for my application.

Buck Converter

to come

Charge circuit

to come

SD Cards

Bellow you will find a bash script to test the speed of the SD card on the pi.
Copy the code and run

sudo nano sdbench.sh

Past the code into the file that was created. save the file and exit. Then run

sudo chmod +x sdbench.sh

and finally

sudo ./sdbench.sh

My results were as follows

Here is the code to copy


[ -f /flash/config.txt ] && CONFIG=/flash/config.txt || CONFIG=/boot/config.txt

trap "rm -f ${FILENM}" EXIT

[ "$(whoami)" == "root" ] || { echo "Must be run as root!"; exit 1; }

HDCMD="hdparm -t --direct /dev/mmcblk0 | grep Timing"
WRCMD="rm -f ${FILENM} && sync && dd if=/dev/zero of=${FILENM} bs=1M count=${DATAMB} conv=fsync 2>&1 | grep -v records"
RDCMD="echo 3 > /proc/sys/vm/drop_caches && sync && dd if=${FILENM} of=/dev/null bs=1M 2>&1 | grep -v records"
grep OpenELEC /etc/os-release >/dev/null && DDTIME=5 || DDTIME=6

  local cmd="${1}" fcount="${2}" ftime="${3}" bormb="${4}"
  local result count _time perf

  result="$(eval "${cmd}")"
  count="$(echo "${result}" | awk "{print \$${fcount}}")"
  _time="$(echo "${result}" | awk "{print \$${ftime}}")"
  if [ "${bormb}" == "MB" ]; then
    perf="$(echo "${count}" "${_time}" | awk '{printf("%0.2f", $1/$2)}')"
    perf="$(echo "${count}" "${_time}" | awk '{printf("%0.2f", $1/$2/1024/1024)}')"
  echo "${perf}"
  echo "${result}" >&2

  echo "${1} ${2} ${3}" | awk '{r=($1 + $2 + $3)/3.0; printf("%0.2f MB/s",r)}'

systemctl stop kodi 2>/dev/null

[ -f /sys/kernel/debug/mmc0/ios ] || mount -t debugfs none /sys/kernel/debug

overlay="$(grep -E "^dtoverlay" ${CONFIG} | grep -E "mmc|sdhost")"
clock="$(grep "actual clock" /sys/kernel/debug/mmc0/ios 2>/dev/null | awk '{printf("%0.3f MHz", $3/1000000)}')"
core_now="$(vcgencmd measure_clock core | awk -F= '{print $2/1000000}')"
core_max="$(vcgencmd get_config int | grep core_freq | awk -F= '{print $2}')"
turbo="$(vcgencmd get_config int | grep force_turbo | awk -F= '{print $2}')"
[ -n "${turbo}"    ] || turbo=0
[ ${turbo} -eq 0 ]   && turbo="$(cat /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy)"
[ -n "${core_max}" ] || core_max="${core_now}"

echo "CONFIG: ${overlay}"
echo "CLOCK : ${clock}"
echo "CORE  : ${core_max} MHz, turbo=${turbo}"
echo "DATA  : ${DATAMB} MB, ${FILENM}"

echo "HDPARM:"
echo "======"
HD1="$(getperfmbs "${HDCMD}" 5 8 MB)"
HD2="$(getperfmbs "${HDCMD}" 5 8 MB)"
HD3="$(getperfmbs "${HDCMD}" 5 8 MB)"
HDA="$(getavgmbs "${HD1}" "${HD2}" "${HD3}")"

echo "WRITE:"
echo "====="
WR1="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)"
WR2="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)"
WR3="$(getperfmbs "${WRCMD}" 1 ${DDTIME} B)"
WRA="$(getavgmbs "${WR1}" "${WR2}" "${WR3}")"

echo "READ:"
echo "===="
RD1="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)"
RD2="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)"
RD3="$(getperfmbs "${RDCMD}" 1 ${DDTIME} B)"
RDA="$(getavgmbs "${RD1}" "${RD2}" "${RD3}")"

echo "RESULT (AVG):"
echo "============"
printf "%-33s   core_freq   turbo   overclock_50    WRITE        READ        HDPARM\n" "Overlay config"
printf "%-33s      %d        %d     %11s   %10s   %10s   %10s\n" "${overlay}" "${core_max}" "${turbo}" "${clock}" "${WRA}" "${RDA}" "${HDA}"

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.