Mounting a USB thumb drive in Linux

At one point I was trying to install linux wireless drivers and since I didn’t have access to an ethernet connection I decided to transfer my driver to the computer in question via a USB thumb drive. But what do you need to do after plugging in the USB disk drive to the Linux machine in order to access the data?

Before connecting your USB device, execute the list block devices “lsblk -f” command. Then, connect your USB storage device and execute an “lsblk -f” command again. Notice anything different?

In my case I observed a new block device filesystem named “sdb1” and its own UUID. Using the UUID, one can mount the USB device by executing “mkdir /mnt/usbdrive && mount -U YOUR_USB_DEVICE_UUID /mnt/usbdrive” as root. Take care when typing these commands, unlike most Windows/Microsoft systems I have used, *nix systems are case sensitive.

When you are finished with the device, you may “un-mount” it by executing “unmount /mnt/usbdrive” as root.

That was easy!

Advertisements

Calculating MSP430 BSL Checksum

Texas Instruments has a quick little java tool for calculating the checksum of a MSP430 dataframe. Recently, I’ve been seeing some forum posts looking for information on how to calculate the checksum so I thought I would post my quick Python 3 function for others.

def checksum_bsl_frame(frame):
  # http://docs.python.org/3.2/library/struct.html#format-characters
  fmt = "<" + len(frame) // 2*"H"

words = struct.unpack(fmt, frame)

words_xored = 0;

for word in words:
    words_xored ^= word

checksum = words_xored ^ 0xFFFF

return checksum.to_bytes(2, 'little')

Here, framis a bytes or bytesarray object and checksum returns a bytes objects.

Remember, strings are strings in Python3 and bytes and bytearray are data in Python3. Of course, if you are running PySerial on Python3 then this is the format you will be using.

The above code could be simplified I’m sure but it’s nice to have endianness defined out and in the open.

When you want to “human” check the data frame there is an easy one liner way of printing a formatted output.

def print_bsl_frame(frame):
  print(" ".join('{:02X}'.format(byte) for byte in frame))

Now, it’s easy to do things like…

password = bytearray.fromhex("80 10 24 24 00 00 00 00" + 32*" FF")
password.extend(checksum_bsl_frame(password))
print_bsl_frame(password)

The previous would print “80 10 24 24 00 00 00 00 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF 5B CB” to the screen.

I hope this helps someone, it will help you more in a custom class definition.


Machine Mixing Cob for Barefoot Builder

Photograph of Christina Ott of Barefoot Builder

Christina Ott of Barefoot builder during her 2012 “Building with Cob Workshop” in Woodbury, Tennessee.

Christina Ott is a natural building consultant and owner/operator of Barefoot Builder, she also happens to be a very good friend of mine.

During the nice sun shining months of summer, Christina offers a number of natural building and permaculture related workshops. Christina hosts workshops at her home base outside Woodbury, Tennessee but she has also held workshops at various locations across the country.

During the summer of 2011, I had the unique opportunity of working with Christina on her “off grid” cob building workshop in Middle Tennessee. The workshop helped our friend Mati Karol, of the Daffodil Meadow Contemplation Center, grow his presence at the meadow.

This summer, Christina invited me back to work with her again as her tractor operator for her 2012 “building with cob” workshop at a different site in Middle Tennessee.  As the tractor operator, I was responsible for machine mixing the ingredients for cob (sand, clay, water and straw) in large quantities and delivering it to the building site as opposed to the labor intensive, but educational, foot mixing method.

Read the rest of this entry »


MSP-FET430UIF on Mac OS X

Using the MSP430 toolchain in Ubuntu 11.04 is very simple to set up but what about on Macintosh OS X? It turns out that the fink instructions on the MSPGCC wiki for Mac OS X are very good and work flawlessly, even easier than the Linux install. However, the MSP430 USB-Debug-Interface (MSP430UIF) didn’t work immediately, but here is the fix!
Read the rest of this entry »


Install MSP430 Toolchain In Minutes on Ubuntu 11.04

First Texas Instruments Logo

First Texas Instruments Logo

Installing the MSP430 GCC toolchain is very easy and quick these days if you are running Ubuntu 11.04 (Natty). Steer clear of all the MSP430 toolchain confusion, installing just eight binaries will have you building and debugging MSP430 code in minutes and not hours!

Read the rest of this entry »


Bus Pirate, I2C, ChronoDot

Around the same time that I acquired a Bus Pirate I also acquired a ChronoDoh which is just the same as the traditional ChronoDot but the pins are soldered to the wrong side of the printed circuit board (PCB). This small error saved me 50-percent on the purchase cost. With my Bus Pirate and ChronoDot in hand I set out to learn how to use both. This document introduces using the Bus Pirate with I2C decices such as the ChronoDot’s DS3231 real time clock (RTC).

Read the rest of this entry »


Dusting off a Bus Pirate v3a

Screen shot showing Bus Pirate firmware and bootloader versions

Bus Pirate Version Information

Back in the fall/winter of 2009 I acquired a Bus Pirate from Dangerous Prototypes but I never did anything with it. Today I pulled it out of a container and performed a firmware upgrade.

Read the rest of this entry »