Wednesday 7 May 2014

BBB: Basic Setup of Debian

Connect Beaglebone to ethernet with DHCP. Find IP either through FTDI-debug console, scanning the network or otherwise.

Default user: debian
Default password: temppwd

Step 1: Update and upgrade system using
sudo apt-get update
sudo apt-get upgrade

Step 2: Restrict access to local LAN
sudo vi /etc/hosts.deny
ALL: ALL
sudo vi /etc/hosts.allow
sshd: 192.168.0.





Reference: https://www.eliteraspberries.com/blog/2013/09/installing-debian-on-the-beaglebone-black.html

Tuesday 6 May 2014

Make: Ground plane monopole antenna for 433 MHz

Time to make: 30 minutes
Cost: 5 USD








Can be made for many frequencies. Commonly used for higher frequencies from 80 MHz and upwards past 2.4 GHz. In this case, used for 433 MHz, where home automation usually is found. Copper is soldered, and the whole thing is put inside of glue to protect it. The connector used here is an F-connector, but you can use any. Look for a bulkhead-connector.

Monday 5 May 2014

BBB: Install Debian to eMMC on OS X

Recommended to use 8 GiB or larger SD-card.

Step 1: Download Debian eMMC flasher image from

Step 2: Quickformat SD-card to FAT using Diskutils from Applications

Step 3: Open terminal, check which path is SD-card using
diskutil list

Step 4: Unmount only the first partition using
diskutil unmount /dev/disk#s1

Step 5: Using 7-Zip, unpack the img.xz so that a file of around 2 GiB appears. This is the disk image.

Step 6: Write image to SD-card using
sudo dd if=/Path/To/BBB-eMMC-flasher-debian-7.4-2014-04-23-2gb.img of=/dev/rdisk# bs=1m

Step 7: After dd reports success, eject the SD-card using
sudo diskutil eject /dev/rdisk#

Step 8: Insert SD-card into Beaglebone Black, keep "BOOT" button nearest to the SD-card pressed while powering up. After a few seconds the lights will start to blink from 1 to 4 full LEDs, while it transfers to the eMMC. Just wait some minutes.

Step 9: Power down, remove SD-card then power up again. Log in using default username debian and password temppwd

Tool: Damn Small Linux USB

Damn Small Linux USB

Sometimes, you find yourself in a position where having a Linux-distro running would make life so much easier. For example, if you like me, intend to format SD-cards in use on the Beaglebone Black to the ext4 file format. As an alternative to download and install Ubuntu, which is huge and slow on old hardware, consider Damn Small Linux on a USB memory stick.

Requires a USB memory stick of any size above 128 MiB.

Step 1: Download livecd creator unetbootin for your OS from http://unetbootin.sourceforge.net
Step 2: Start program and select Damn Small Linux from the distro list.
Step 3: Select target USB Drive and press OK, wait for download and install to complete.


There you go. Stash it away for future use or reboot and test it immediately.

Monday 21 April 2014

Hack: Virtualized Siemens Software PLC using WinAC RTX 2010 and ESXi Hypervisor

To set up a fully virtual Siemens Software-PLC for testing purposes and rapid prototyping.

Requirements:
VMware Workstation or vSphere Server supporting at least virtualHW.version="9"
Windows 7 32bit Professional SP1
Siemens WinAC RTX 2010 SP1
Siemens Simatic NET 8.2

Step 1:
Set up a virtual machine with 2 GiB RAM, 1 CPU with 2 cores, 2 network interface cards. All other settings default.

Step 2:
Use custom BIOS, select specifc ethernet driver e1000e and add virtual HW version. The bios needs to be downloaded and placed into the same folder as the .vmx.

bios440.filename="FUJITSU211_314.ROM"
virtualHW.version="9"
ethernet0.virtualdev="e1000e"

This can also be done by editing the .vmx-file, for VMware Workstation, or first remove from inventory in vSphere then edit the .vmx-file through SSH. Re-add into vSphere using command.

Step 3:
Install Windows 7 32-bit. Upgrade using Windows Update.

Step 4:
Install WinAC RTX 2010 SP1, reboot when needed.
Install Simatic NET 8.2, reboot when needed.

There you go, it should now work as a SoftPLC with WinLC CPU. Realtime determinism is lost, but should still work well for testing.

Sunday 23 February 2014

BBB: Install Archlinux to eMMC on any OS

With a new BBB with default distro Angstrom:

# Boot on Angstrom SD Image. Keep network cable attached, to get up to date system clock.
# What we will do:
# 1: Unmount and format boot and root partition on MMC, remount
# 2: Copy Archlinux boot and root files to respective folders
# 3: Reboot and set up Archlinux
# Read this for another perspective: http://archlinuxarm.org/platforms/armv7/ti/beaglebone-black
# This procedure created on 23.02.2014

# MMC device is
# /dev/mmcblk1
# Partition 1: boot requires boot flag
# /dev/mmcblk1p1
# Partition 2: root
# /dev/mmcblk1p2

# Unmount all partitions on the MMC
umount /dev/mmcblk1p1
umount /dev/mmcblk1p2

# Make and format filesystem, you may need to re-add partitions as FAT16
mkfs.vfat -F 16 /dev/mmcblk1p1
mkfs.ext4 /dev/mmcblk1p2

wget http://archlinuxarm.org/os/omap/BeagleBone-bootloader.tar.gz
wget http://archlinuxarm.org/os/ArchLinuxARM-am33x-latest.tar.gz

mkdir boot
mount /dev/mmcblk1p1 boot/
tar -xvf BeagleBone-bootloader.tar.gz -C boot/
# Ignore permission isssues, three files in boot now
umount boot

mkdir root
mount /dev/mmcblk1p2 root/
tar -xf ArchLinuxARM-am33x-latest.tar.gz -C root/
# If you get timestamp errors, ignore them. You forgot to keep connection to internet, to set systemclock.
umount root

# Reboot without SD card inserted. Default action is to boot SD card. SSH to IP.

passwd # Enter <rootpass>

# Set hostname
hostnamectl set-hostname kali

# Unsure of available timezones? timedatectl list-timezones
timedatectl set-timezone Europe/Oslo

# Check if correct date time?
date

# Initialize package manager key
pacman-key --init

# Do full upgrade, say Yes where applicable
pacman -Syu
reboot

# Check available MMC space, you should have ~1.1 GiB
df -h

# SSH back in and install your applications, set them up and enjoy
pacman -S vim mlocate screen
updatedb

# Add radio if you want
pacman -S rtl-sdr
pacman -S gnuradio

# Add X if you want
pacman -S xfce4

# Add irssi client if you want
pacman -S irssi

# Add gcc compiler if you want
pacman -S gcc


Saturday 1 February 2014

RPi: Install Raspbian to Pi on OS X

Goal of this post

Get you started with the Raspberry Pi Model B with as little extra hardware as possible.

What you need

  • Raspberry Pi Model B
  • SD Card 8 GiB Class 10
  • Micro-USB cable for power
  • Network cable for communication
  • A computer
  • Network router (optional)
  • External power supply for Raspberry Pi (5V, ~1A) (optional, very recommended)

What you do

Take careful note of everything in bold red, you might need to change these fields.

Prepare SD Card

  1. Download latest Raspbian operating system - http://www.raspberrypi.org/downloads
  2. Open Terminal
  3. df -h
  4. Insert SD Card into computer
  5. df -h (Note rdisk-number for SD Card, ex: /dev/disk1s1)
  6. sudo diskutil unmount /dev/disk1s1
  7. sudo dd bs=1m if=~/Downloads/2013-02-09-wheezy-raspbian.img of=/dev/rdisk1
  8. Wait until dd has done its job, around 2-3 minutes
  9. sudo diskutil eject /dev/rdisk1
  10. Remove SD Card and insert into Raspberry Pi
  11. Plug Raspberry Pi into network and attach power, three leds should light up, indicating power and network connection

Discover Raspberry Pi network address

Either use a network scan for port 22 (SSH) or log in to your router and check DHCP leases.

Make SSH connection

  1. Open Terminal
  2. ssh pi@192.168.1.100
  3. Default password is "raspberry"
  4. Run raspb-config and set up your own settings
  5. Go Crazy.