2014-12-17

After experiencing some problems with Bonechop (my Beaglebone Black), I decided it was time to do a clean install of Debian on the internal eMMC storage.

Following the directions at http://elinux.org/Beagleboard:BeagleBoneBlack_Debian, I installed the console version of Debian to the eMMC. Once the install was complete, I rebooted the board (and I had a monitor connected to the HDMI so that I could see what was going on).

During the boot process, the screen displayed a cutsy wootsy little penguin in the corner of a black screen. About a minute, the screen changed to a sign in console, and I logged in.

Once in the system, I quickly installed wicd (my preferred network connection manager), and the drivers for my wireless USB card. When wicd was configured to automatically connect to my wireless network, the beaglebone was rebooted again.

This time I still got the little penguin on the black screen, but the the boot took quite a bit longer, and I still had no idea what was going on in the background. A quick question asked in the Beagleboard Community on Google Plus, and I was getting some insight as to what I needed to do in order to get output on my screen.

In a nutshell, in my /boot/uEnv.txt file, the line:
cmdline=quiet init=/lib/systemd/systemd
was changed to
cmdline=init=/lib/systemd/systemd

and I needed to add an additional line:
console=tty0

Rebooting the Beaglebone Black, I was quite pleased to see output text flashing before my eyes.... oh, what is that? The unused eth0 network was trying to get an IP address using DHCP, but since there was no cable connected to eth0, the request was never fulfilled and it tool far too long to timeout.

For this problem, I edited the /etc/network/interface file and commented out:
auto eth0 so that networking wouldn't try to automatically connect with eth0.

Another reboot, and I noticed a significant decrease in boot time. Awesome!

Just to make things a bit more fun, in /etc/wicd/scripts/postconnect, I created a file as follows:

#!/bin/sh
curl --data "text=bonechop is now online" cronos:8255/speak

On cronos, there is a basic web accessible Text-To-Speech wrapper that 'speaks' text that is sent to it.

Now that the Beaglebone is running headless, when I reboot the device I get auditory feedback. sweet sauce!

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
0 plus 1
Answer:
required
  • Tags:
2014-12-15

After making my first windchime, I made a second, and a third and then a fourth, and while it is nice to know when the wind is blowing, I really wanted a wind chime that I could control (preferably with a computer).

Fortunately for me, I had some tools and materials.

Figure out the tube lengths

I started out with about 3 meters of 1¾ inch conduit.

Whoa, am I mixing metric and imperial? No way Bub! I did all of the measurements in metric. That 1¾" pipe is actually 44mm in diameter.

Anyway, I fired up tubell, selected a full octave of notes and entered the total pipe length.

Cut to length

Once I had the measurements, it was time to start cutting.

In hind sight, I probably shouldn't have used a haggard old sawsall for cutting the tubing. Although the sawsall is far preferable to using a hacksaw, a metal cutting blade on a circular saw would have made a much cleaner cut.

After this pic was taken, the holes for suspending the tubes were drilled.

Cut some pegs

my "design" for this Tubular Music Thingy involved making a frame to hold 8 tubes strung together and some pegs would be used to keeps the tubes separate.

I don't remember the length, but these pegs have a 9mm diameter.

Drill some holes to hold the pegs

Technically, I used a 9mm drill to make these holes, although the bit was actually measured in some horrid fraction.

In other news, I should really put "shop-vac" on my shopping list; because there is no way in hell that I'm going to stop building stuff indoors when it is raining out.

Put the frame together

All lined up and screwed together.

See those notches on the short sides of the frame? That is where the end of the string holding the tubes will go.

Legs!

After adding some legs to the tube holding frame, the tubes were threaded and put in place.

And thus completes step 1 of the Tubular Music Things. To be honest, I mostly build this thing so I could play Sudo Modprobe.

Now quit reading, and SWITCH TO THE METRIC SYSTEM!

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
6 minus 5
Answer:
required
2014-12-13

Sometimes, it is really nice to know what the weather is like without having to look out a window. Similarly, it is nice to know what the weather will be like in the future. Fortunately, getting weather information isn't that difficult.

For my needs, I wanted to get the weather data for a few cities in the Golden State, and have the data spoken to me by a computer.

For accessing the weather data, I headed over to http://api.wunderground.com/weather/api/ and signed up for a free API account. The free account limits me to 500 API calls per day and 10 calls per minutes. Since I am only interested in getting weather data a few times a week, the limits for the free account are of no real concern.

After getting my API key, it was time to fire up geany and smash out some Ruby code to do what I need to do, which is:

  • get the data from the API
  • save the data in a file
  • transform the data into a more speakable string
  • speak the string!

Enter the Ruby

#!/usr/bin/env ruby
require 'open-uri'
require 'json'
require 'fileutils'

key='########'
city=ARGV[0]
forecast_num ARGV[1].to_i || 0

#was city defined?
unless city
  puts 'you must enter a city name (or zip code)'
  exit()
end

#define some file locations
this_dir File.dirname(__FILE__)
data_file File.join(this_dir"#{city}.json")
temp_file data_file+".tmp"
#if the data file doesn't exist or it is more than an hour old
if not File.exists?(data_fileor File.mtime(data_file) < Time.now() - (1/24.0)
  #we need to dowload fresh data
  url="http://api.wunderground.com/api/#{key}/forecast/q/CA/#{city}.json"
  uri URI.parse(url)
  begin
    #read the text
    txt uri.read
    #write to the temp file
    open(temp_file"w"do |f|
      f.puts txt
    end
    #mv the temp file, clobber if necessary
    FileUtils.mv(temp_filedata_file:force => true)
  rescue
    puts "Failed to get weather data"
  end
    
end
#process the text from the data_file
txt IO.read(data_file)
weather JSON.parse(txt)
forecasts weather['forecast']['txt_forecast']['forecastday']
title forecasts[forecast_num]['title']
forecast forecasts[forecast_num]['fcttext']
#do some regex processing of the forecast
forecast forecast.gsub(/mph/"miles per hour")
forecast forecast.gsub(/([0-9]+)F/'\1 Fahrenheit')
#remove any %20 from  the city
city city.gsub(/%20/,' ')
string = (forecast_num.zero?) ? "" "Forecast "
string += "for #{city}#{title}#{forecast}"

#speak the string
`speak_string "#{string}"`

#comply with Section 2(d) @ http://www.wunderground.com/weather/api/d/terms.html
puts "This data is from Wunderground.com"

Just to make it a bit easier for me to get the weather or the forecast, this script is running on Cronos (my Minnowboard Max voice input machine) and is triggered via Blather when I say "what is the weather" or "what is the forecast". SWEET SAUCE!

Oh, the script references a command named "speak_string" which is a very simple wrapper for Festival and it looks like

#!/bin/sh
echo "$1" | festival --tts

Now quite reading, and go talk to a computer.... or look out the window and see some weather.

Comments
Name:
not required
Email:
not required (will not be displayed)
Website:
not required (will link your name to your site)
Comment:
required
Please do not post HTML code or bbcode unless you want it to show up as code in your post. (or if you are a blog spammer, in which case, you probably aren't reading this anyway).
Prove you are human by solving a math problem! I'm sorry, but due to an increase of blog spam, I've had to implement a CAPTCHA.
Problem:
8 minus 8
Answer:
required
subscribe
 
2014
2013
2012
2011
2010
December
November
October
September
August
July
June
May
April
March
February
January
2009
December
November
October
September
August
July
June
May
April
March
February
January
2008