Oct 142018

I had earlier shared my attempts to connect MiP to the Internet. In the last couple months I have managed to build an adapter board in Eagle to fit a D1 mini clone to MiP. Along with the Arduino IDE library support I’ve developed and hosted on GitHub, MiP is now a cloud-connected robot.

MiP's new hardware

MiP, outfitted with the D1 mini Pack and a D1 mini clone. MiP is now cloud-connected.

The use of the esp8266 is fairly well documented. The D1 mini Pack and accompanying library simply serve as an adapter to get MiP online. I’ve provided several examples of how to get MiP online in the project wiki.

To put this project together, you’ll have to order the D1 mini Pack from your favorite PCB manufacturer, connect a Wemos D1 mini or clone and build the short length of cable to connect the D1 mini Pack to MiP’s UART port. The assembly instructions can be found in the wiki for the MiP ESP8266 Library, however they’ll eventually migrate to the D1 mini Pack repository so stay tuned for updates.

As always, I heap praises on Adam Green. Without his help none of this would have happened.

If you decide to undertake this project, feel free to share your experience with me and provide feedback on areas for improvement.

Aug 082018

My latest project has been to add a clone of Wemos’ D1 mini to WowWee Labs’ MiP robot to provide it with Internet connectivity. So far I’ve been successful with bench-top experiments. I’ve been able to program MiP with the ability to send email using an ESP-01 and tell time using Network Time Protocol (NTP).

While the D1 mini is small enough to fit inside MiP’s empty head, doing so would make programming it a little more difficult. I designed an adapter board to replace the top of MiP’s battery compartment similar to the ProMini Pack and the Proto Pack that allows a D1 mini to be conveniently mounted outside MiP. With the D1 mini mounted externally you can add your own sensors to the board or power MiP externally using the D1 mini’s USB connector.

I’ve shared the source code for the API to support the D1 mini on MiP available on GitHub. I’ve also shared my Eagle files for the adapter board. Feel free to contribute to either project if you see room for improvement as I’m sure there is.

Jul 012018

Yet another infrequent update. During the last several months I got the remaining parts I needed to run eight Pis in a cluster. The only thing I was missing was a case. Today I re-purposed a cigar box and stuffed everything into it. I still need to do some cable-minding which may result in some soldering to made everything look nice. One last thing I need to do is to configure just one of the Pis to be an Ethernet-to-WiFi router for the other seven.

Eight-node Pi 3 Cluster.

Completed and housed in a cigar box.

Oct 142017

While building my Pi 3 cluster I looked around for an easy bash script to monitor the CPU temperature. I found Vivek Gite’s original script worked nicely but I wanted it to monitor continuously until I stopped the script, I wanted the CPU temperature to be reported with the same precision as the GPU temperature and lastly, I wanted to discard the “temp=” output in the GPU temperature. To achieve all that, I edited the script and installed bc on the system (for the CPU temperature precision):

pi@localhost:~ $ sudo apt-get install bc

The following script continuously monitors temperatures for the CPU and GPU.

# Display the CPU and GPU temperature of the Raspberry Pi 3
# Author: Samuel Trassare (trassare.com) based on original script by Vivek Gite (cyberciti.biz) under GPL v2.x+
# Requires bc for proper formatting of the CPU temperature.

cpu=$(echo "scale=1; `cat /sys/class/thermal/thermal_zone0/temp` / 1000.0" | bc)

echo "$(date) @ $(hostname)"
echo "Press [ctrl+c] to end monitoring"

while true
  echo ""
  echo "CPU => $cpu'C"
  echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp | cut -d = -f2)"
  sleep 3s

You can set the wait time between temperature reads by editing the line

  sleep 3s

to whatever you want.

Some folks have pointed out that the CPU and GPU don’t need to be read separately as both sensors are on the same SOC however I have noticed that the two sensors frequently report slightly different temperatures so I want them both reported.

This script can be downloaded from its github repository.