Translate

Showing posts with label microSD. Show all posts
Showing posts with label microSD. Show all posts

Saturday, May 4, 2019

MacOS - duplicate an SD card

Very few notes about how to duplicate an SD card or micro SD card using a Mac.
All these operations are done via terminal.

Sunday, April 8, 2018

Raspberry Pi - broken micro SD card reader

One of the Raspberry Pi I have around has now a broken micro SD card reader.
The micro SD card is not retained anymore, thus the options are :

a) trash away the Raspberry and buy a new one
b) try to repair it

Wednesday, December 3, 2014

TeirmiLab - Raspberry Pi prototype



This article describes the building of a TeirmiLab prototype based on a Raspberry Pi B board.
The goal using a Raspberry Pi is to have a machine that can be expanded later.




Shopping list


The idea is to use a traditional LCD display instead a more sophisticate touch screen display.
Mainly the reasons :
  • is not expensive
  • doesn't require to develop a graphic interface for it
  • allows to focus on the purpose - to show a temperature
  • can be easily placed inside a protective container (no touch capabilities)

Hardware


Here a initial schematic for the TeirmiLab-Pi.



The RTC clock module is actually necessary only for the enhanced version, for the data-log feature, however it will be tested also on the base version.
The idea is to use as much as possible "ready to use" modules, like the RGB display, the GPIO I2C expander and so on, in order to use already made code (see the Software section).

The encoder will be connected directly to the Raspberry GPIO as well as the interrupt signal from the MCP23017 (optional for now), in order to be able to detect faster changes from the keyboard.
The internal pullup resistors for the encoder will be enabled.

First tests on a breadboard
The second prototype on perforated board

The second prototype on perforated board
The second prototype with the keyboard and RPOf cable connected
The keyboard is working fine, however it would be better to have an easiest way to select an alarm or set up the offset.
A new version of the hardware will include a digital encoder to be used instead the keyboard (see below).

The prototype installed on a wooden platform for a more mechanical stability.
A monochromatic LCD is used instead an RGB one

The prototype installed on a wooden platform for a more mechanical stability.
The round PCB is hosting the RPOf to be piggy-bagged on a MSP430 Launchpad
The used board for the prototype is a Raspberry Pi B, however the final installation will use a Raspberry Pi A+ because the reduced dimensions and power usage.
A new interface board is under development.

GPIO Use

Here a table for the GPIO use :

Raspberry GPIO MCP GPIO Direction Description

GPA0 Output LCD

GPA1 Output LCD

GPA2 Output LCD

GPA3 Output LCD

GPA4 Output LCD

GPA5 Output LCD

GPA6 Output LCD

GPA7 Output LCD





GPB0 Output LCD

GPB1


GPB2


GPB3


GPB4 Input Keyboard 1

GPB5 Input Keyboard 2

GPB6 Input Keyboard 3

GPB7 Input Keyboard 4




GPIO4
Input/Output 1Wire protocol
GPIO17
Input Shutdown input
GPIO18
Output Shutdown feedback
GPIO22
Output Buzzer
GPIO23
Input Encoder A
GPIO24
Input Encoder B
GPIO25
Input Encoder switch


Sensor


With the sensor used (DS18B20) the TeirmiLab has these basic characteristics:

  • Range -55 to 125°C (-67°F to +257°F)
  • ±0.5°C Accuracy from -10°C to +85°C

Keyboard


The TeirmiLab-Pi needs to have at least 3 push buttons in order to do some settings.
  • a Mode button
    Allows to select different modes, like "display temperature" or "Set alarm" or "Set offset"
  • two + and - buttons
    Allows to increase or decrease a value, like the alarm temperature or the offset

Encoder


Instead of the keyboard, it is more easy to use a mechanical digital encoder with an embedded pushbutton for the selection.
The pushbutton acts as Mode button and rotating the encoder cause the values to change.

The video is showing the encoder operations

Power Supply


The instrument must be powered.
An USB wall wart, with at least 1 A, will be the power source for the Teirmilab.

A main switch will be necessary in order to correctly power up and power down  the instrument (see RPOf project)

Container


All the electronic will be placed in a transparent plastic box.
This will allow to reduce the drilling to the minimum, basically for the main power switch and eventually for some push buttons if not other means are used.
The display will remain totally protected but visible behind the clear plastic.

Wednesday, October 8, 2014

TeirmiLab - prepare Raspbian

For the TeirmiLab project, one of the platform I choose to prototype it, is the Raspberry Pi B (or B+).

This is a quick step-by-step reminder about how to prepare Raspbian for the Raspberry Pi B and B+ for this project.

There are on-line hundreds of places where is described how to install a Raspbian over a Raspberry Pi.


If this quick step-by-step is not enough for you, try this.
If you think that this is too technical ... are you sure you want to play with microcontrollers ? :)

Lets start.
I used a 8 Gbyte micro SD card with a low profile adapter. In this way is easy to eventually swap to the Raspeberry Pi B+.

It is necessary, at least for the installation, to have :
  • a 5 Volt 1A USB power supply
  • a USB cable (microUSB) for the power supply
  • an internet connection, better if wired
  • a computer (needed to download the image and prepare the SD card)
Optionally if you want to enable the graphic interface or plan to use Noobs, better to have also:
  • a HDMI monitor or a composite monitor (suggested an HDMI one)
  • an USB keyboard
  • an USB mouse

As keyboard and mouse, I used a wireless Logitech keyboard with an included touch-pad with USB dongle, in this way there is still available an USB Port.

SD card preparation  

Once all the HW components are available and connected, is possible to prepare the SD card.
Raspberry Pi does not have flash, it boots from the SD card that is used also as hard drive.
Because of that it needs to be formatted in Fat32.

Using kparted erase all the data on the SD card (new partition) and then simply format all the card in Fat32.
If you DON'T plan to use Noobs, there is no need to format the SD card.

Problems
Use a decent SD card for the job.
It should be fast and good quality/brand.
I had some SD cards not working properly because not fast enough or bad brand.
I found more reliable to use microSD cards with the adapter.

Installing distribution

There are two main choices about installing a distribution/OS on the SD card:

  • installing Noobs
  • installing a specific distribution

Noobs
If you choose to use Noobs, here some notes.
It is easier, shows you the latest available distributions and install automatically everything needed.
You must connect an HDMI monitor and a keyboard/mouse to the Raspberry Pi.

To install Noobs, simply download it and extract it on the SD card.
That's it. No strange formatting of the SD card, no partitions, secret code, ecc.
Just a plain copy.

Once copied, insert the card on the Raspberry Pi and turn it on.
After few seconds will appear on the HDMI screen the list of available OS to install.
If you have enough space on the SD card, it is possible to install more than one.

With 8Gbyte SD card, generally there is space for 1 or 2 OS.

The suggested distro to install is the Raspbian , accessible via the Noobs menu.

It is a Debian based distro and is probably the most used.
Once installed, a configuration menu' will allows to set up some parameters, like starting the distro in graphic mode rather than command line.
The default is command line ! So it is normal to boot in command line if no configuration modifications are made.

Raspbian
It is possible to install directly Raspbian. The main advantage is to have much more space on the SD card.
Here how to do it.
Go on the Raspberry Pi website download page , locate the Raspbian image and download it on your computer (look for Operating Systems Images - Raspbian).
Detailed explanations about how to do that are available on the Raspberry website, shortly here a quick reminder. I'm using Linux and I'm assuming you KNOW how to work on Linux.
  • download the image on your PC
  • extract the image from the zip file
  • open a terminal
  • df -h
    to see what memory devices are present
  • insert the new SD card
  • df -h
    identify the latest device inserted - ignore the partitions, we need to overwrite the entire card with the image
    If nothing appears, try with gparted or kparted to identify the new card
  • umount /dev/sdxx
    umount the device added if for any reason it was mounted.
    In case the card has more than one partition, umount all of them.
    Eventually better reformat the card with gparted so to have a single partition but is not necessary.
  • copy the entire image downloaded on the sd card with the command:

    dd bs=4M if=name_image_downloaded.img of=/dev/sdx

    where name_image_downloaded is the path/name of the downloaded Raspbian image and sdx is the name of the unmounted device (DEVICE !  NON PARTITION !)

    CAUTION!  Take your time and triple check ! If you use the wrong /dev you can lose your data !
At this point you have the SD card ready to be inserted in the Raspberry Pi.
Do it, be sure to have connected the board to the network, no need to have HDMI and keyboard/mouse, you can operate via ssh.

The image installed allows for the default user named 'pi' and password 'raspberry'.
Hook up  a terminal to the board, for example in ssh, is possible to login with:

- ssh pi@192.168.xxx.xxx   (address of the board - see your DHCP assignment)
- password : raspberry

Once gained access, is better to do an update with :  sudo apt-get update

After the reboot is better to configure Raspbian running the command sudo raspi-config.
At least run the option
- Expand Filesystem and the
- Advanced Options/A6 I2C in order to enable the I2C support.

No need to run other options.

The Raspberry Pi B (or B+) board is ready for the next step.

Sunday, April 13, 2014

Beagle-Board - Beaglebone Black - re-flash it

Yes, OK OK, another post on internet about how to re-flash a Beagle-board Beaglebone black (BBB).
Why ?

Well, I needed to bring back to the origins my BBB and I found tons of instructions if you have Windows or Mac and some contradictory or incomplete instructions for Linux.
So, here my brief note to describe how to re-flash a BBB.

This procedure should be used in order to install the image on the BBB internal memory.
Basically the image will be copied on the internal memory.

Download the image

The image to download MUST BE one for the flash.
Normally is called BBB-eMMC-flasher-yyyy.mm.dd.img.xz from the Beagleboard latest images  link.
oh wait .. WHAT image ?

Well, I wanted to restore the original configuration as when I received the board, so Angstrom.

Prepare the image

On the net there are many places that describe how to do that under Window or Mac OS.
I'm using Ubuntu 10.04 LTS. Any versions however should do.
It is needed :


  • Archive Manager
  • Disk Utilities
  • dd


With the Archive Manager extract the image from the compressed file.

Load the image on the card 

You will end up with a file approx 3.6 Gbyte, so better to use at least a 4 Gbyte micro SD card or better, 8 Gbyte one like I did.
Put the micro SD card in a reader and connect it to the USB port.
Using Disk Utilities identify the added driver, it will be something in the range /dev/sdx.
Also, using the Disk Utility, unmount any partition eventually present on the microSD card.

Open a terminal, go in the directory where is contained the image file and in sudo mode type this command :

sudo dd if=BBB-eMMC-flasher-yyyy.mm.dd.img of=/dev/sdx bs=1M

where yyyy.mm.dd is the part of the image name with the date and x is the correct driver associated with the inserted SD card.
BE VERY CAREFUL in this phase.
A misspelled driver name can format something else !

After few minutes the SD card will be ready.

Flashing the board


Time to flash the board.
ATTENTION !  The procedure can take quite a while !
Allow at least 30 to 45 minutes ! It could take longer though.

Follow these steps :


  • Be sure to have the board powered down
  • Remove any cape and USB stuff
  • Insert the microSD card in the microSD card slot
  • Push down the S2 button
  • Power up the board KEEPING PUSHED S2
  • When the 4 LEDs goes on, release S2
  • Some activity on the LEDs will indicate the loading process
  • Wait until ALL the 4 LEDs  are back ON - steady ON
  • Power off the board
  • Remove the microSD card
  • Reconnect cape and USB stuff if you have it
  • power up again the board

I found in my case, that it is important to have the "bare" board, no capes or USB stuff attached.
I had a USB dongle for an external wireless keyboard and I was unable to flash the NAND.
After removing LCD cape and USB dongle, I was able to flash the NAND without any problem.

Now I have the board running happily with full X server on the LCD.

Hope this article can help somebody