<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Raspbery_pi</id>
	<title>Raspbery pi - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?action=history&amp;feed=atom&amp;title=Raspbery_pi"/>
	<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Raspbery_pi&amp;action=history"/>
	<updated>2026-05-08T15:50:08Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.39.2</generator>
	<entry>
		<id>https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Raspbery_pi&amp;diff=472&amp;oldid=prev</id>
		<title>Chubbard: Created page with &quot;== General notes on some of my Pis == Prep work for power monitoring using lechacal Hats.... &lt;pre&gt; Run the raspi-config tool $ sudo raspi-config  Then disable the login uart 3 Interface Options     &lt;&lt;-- Use option 5 Interfacing Options instead if using the image before 12 DEC 2020 P6 Serial Would you like a login shell to be accessible over serial? Select No to the login shell question. Would you like the serial port hardware to be enabled? Select Yes to the serial port...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.iwillfearnoevil.com/mediawiki/index.php?title=Raspbery_pi&amp;diff=472&amp;oldid=prev"/>
		<updated>2023-09-18T01:13:32Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;== General notes on some of my Pis == Prep work for power monitoring using lechacal Hats.... &amp;lt;pre&amp;gt; Run the raspi-config tool $ sudo raspi-config  Then disable the login uart 3 Interface Options     &amp;lt;&amp;lt;-- Use option 5 Interfacing Options instead if using the image before 12 DEC 2020 P6 Serial Would you like a login shell to be accessible over serial? Select No to the login shell question. Would you like the serial port hardware to be enabled? Select Yes to the serial port...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;== General notes on some of my Pis ==&lt;br /&gt;
Prep work for power monitoring using lechacal Hats....&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Run the raspi-config tool&lt;br /&gt;
$ sudo raspi-config&lt;br /&gt;
&lt;br /&gt;
Then disable the login uart&lt;br /&gt;
3 Interface Options     &amp;lt;&amp;lt;-- Use option 5 Interfacing Options instead if using the image before 12 DEC 2020&lt;br /&gt;
P6 Serial&lt;br /&gt;
Would you like a login shell to be accessible over serial?&lt;br /&gt;
Select No to the login shell question.&lt;br /&gt;
Would you like the serial port hardware to be enabled?&lt;br /&gt;
Select Yes to the serial port hardware to be enabled question.&lt;br /&gt;
&lt;br /&gt;
Select Ok at the summary.&lt;br /&gt;
&lt;br /&gt;
Back at the menu select finish.&lt;br /&gt;
&lt;br /&gt;
Would you like to reboot now?&lt;br /&gt;
Select No to the reboot question (we will do that later).&lt;br /&gt;
&lt;br /&gt;
sudo nano /boot/config.txt&lt;br /&gt;
&lt;br /&gt;
At the end of the file add the following line:&lt;br /&gt;
&lt;br /&gt;
dtoverlay=disable-bt&lt;br /&gt;
&lt;br /&gt;
sudo systemctl disable hciuart&lt;br /&gt;
&lt;br /&gt;
sudo reboot &amp;amp; exit&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Testing that it works&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
chubbard@power01:~$ cat /dev/ttyAMA0&lt;br /&gt;
11 1129.3 62.6 206.0 79.3 2583.9 986.6 246.9 92.4&lt;br /&gt;
11 1142.2 60.3 207.3 78.5 2576.7 1028.9 244.9 91.0&lt;br /&gt;
11 1134.1 66.0 208.5 75.3 2595.9 1014.4 244.8 90.8&lt;br /&gt;
11 1134.4 62.8 206.0 76.7 2566.3 987.1 248.9 91.8&lt;br /&gt;
^C&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
Script currently in use:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# Output from serial port:&lt;br /&gt;
# 11 125.7 54.2 51.2 54.5 260.2 58.8 1447.0 53.0&lt;br /&gt;
&lt;br /&gt;
getdata() {&lt;br /&gt;
stty -F /dev/ttyAMA0 raw speed 38400 &amp;gt;/dev/null&lt;br /&gt;
read ID &amp;lt; /dev/ttyAMA0&lt;br /&gt;
echo &amp;quot;${ID}&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Create array of values:&lt;br /&gt;
IFS=$' \r' read -r -a PROBES &amp;lt;&amp;lt;&amp;lt; &amp;quot;${ID}&amp;quot;&lt;br /&gt;
unset IFS&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
pushgraphite() {&lt;br /&gt;
local G_HOST=&amp;quot;192.168.15.193&amp;quot;&lt;br /&gt;
local G_PORT=2003&lt;br /&gt;
&lt;br /&gt;
# This is fast so only get the date once&lt;br /&gt;
local DAT=$(date +%s --utc)&lt;br /&gt;
&lt;br /&gt;
# Iterate over array of values&lt;br /&gt;
for element in &amp;quot;${!PROBES[@]}&amp;quot;; do&lt;br /&gt;
&lt;br /&gt;
  # Suppress the noise floor on the 100A RPICT8 (~59w or so)&lt;br /&gt;
  if [[ $( echo &amp;quot;${PROBES[element]} &amp;gt;= 71.9&amp;quot; | bc) -ne 1 ]];then&lt;br /&gt;
    VALUE=0.0&lt;br /&gt;
  else&lt;br /&gt;
    VALUE=&amp;quot;${PROBES[element]}&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  # 0 element is actually the ID of the hat, NOT a valid value&lt;br /&gt;
  if [[ ${element} -eq 0 ]]; then&lt;br /&gt;
    JUNK=0&lt;br /&gt;
  else&lt;br /&gt;
    # Send data to Graphite&lt;br /&gt;
    if [[ ${UDP} = 'true' ]];then&lt;br /&gt;
      echo &amp;quot; monitor.power.probe${element} ${VALUE} ${DAT}&amp;quot; | nc -u -q 1 -C ${G_HOST} ${G_PORT}&lt;br /&gt;
      echo &amp;quot;Sent: monitor.power.probe${element} REAL: ${PROBES[element]} SENT: ${VALUE} ${DAT} | nc -u -q 1 -C ${G_HOST} ${G_PORT}&amp;quot;&lt;br /&gt;
    else&lt;br /&gt;
      echo &amp;quot; monitor.power.probe${element} ${VALUE} ${DAT}&amp;quot; | nc -N -C ${G_HOST} ${G_PORT}&lt;br /&gt;
      echo &amp;quot;Sent: monitor.power.probe${element} REAL: ${PROBES[element]} SENT: ${VALUE} ${DAT} | nc -N -C ${G_HOST} ${G_PORT}&amp;quot;&lt;br /&gt;
    fi&lt;br /&gt;
  fi&lt;br /&gt;
done&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
#-------------------------------------------------------------------------------&lt;br /&gt;
# Set our defaults&lt;br /&gt;
#-------------------------------------------------------------------------------&lt;br /&gt;
UDP='false'&lt;br /&gt;
&lt;br /&gt;
# Get any command args for  the script&lt;br /&gt;
while getopts &amp;quot;hxU&amp;quot; OPTION&lt;br /&gt;
do&lt;br /&gt;
  case ${OPTION} in&lt;br /&gt;
    h) usage; exit 0       ;;&lt;br /&gt;
    x) export PS4='+(${BASH_SOURCE}:${LINENO}): ${FUNCNAME[0]:+${FUNCNAME[0]}(): }'; set -x ;;&lt;br /&gt;
    U) UDP=&amp;quot;true&amp;quot;       ;;&lt;br /&gt;
    *) echo &amp;quot;Status WARNING - Unexpected argument given $@&amp;quot;; exit 1 ;;&lt;br /&gt;
  esac&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
RES='none'&lt;br /&gt;
while [ &amp;quot;${RES}&amp;quot; != 'good' ]; do&lt;br /&gt;
  getdata&lt;br /&gt;
  # https://www.cyberciti.biz/faq/finding-bash-shell-array-length-elements/&lt;br /&gt;
  if [[ ${#PROBES[@]} -ne 9 ]] ; then&lt;br /&gt;
    echo &amp;quot;PROBE count ${#PROBES[@]} serial bug detected.&amp;quot;&lt;br /&gt;
    RES='bad'&lt;br /&gt;
    sleep 5&lt;br /&gt;
  else&lt;br /&gt;
    # echo &amp;quot;PROBE count ${#PROBES[@]}&amp;quot;&lt;br /&gt;
    RES='good'&lt;br /&gt;
  fi&lt;br /&gt;
done&lt;br /&gt;
&lt;br /&gt;
pushgraphite&lt;br /&gt;
&lt;br /&gt;
exit 0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[Category:Raspberry]]&lt;/div&gt;</summary>
		<author><name>Chubbard</name></author>
	</entry>
</feed>