Ethernet device stress testing

Thu 25 August 2016

Alt text

During testing of power management patches for usb ethernet dongles, a script was needed to stress test connecting/disconnecting/reconnecting these devices.

Luckily a script like that already exists as a part of the chromiumos project, and can be found here.

That script does however not run standalone and requires are remote device (chromebook) to execute on. So I took the liberty of changing it to support local testing. The modified version can be found here.

This might come in handy for someone, if not, the script will at least be archived on this site.

Example

$ sudo pip2.7 install autotest
$ ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1
    link/loopback 00:00:00 ...

Linux kernel development shell scripts

Tue 26 July 2016

Alt text

While upstreaming kernel patches scripts/checkpatch.pl and scripts/get_maintainer.pl often come in handy. But to me the interface they provide is slightly bulky and rely on using patch files instead of git commits, which to me is a bit inconvenient.

These scripts are all meant to be included in .bashrc or .zshrc

scripts/checkpatch.pl helper

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
#!/bin/bash
function checkpatch {
  if [ -z ${1+x} ]; then
    exec git diff | scripts/checkpatch.pl --no-signoff -q -
  elif [[ $1 == *"cache"* ]]; then
    exec git diff --cached | scripts/checkpatch.pl --no-signoff -q -
  else
    NUM_COMMITS=$1
    exec git diff HEAD~$NUM_COMMITS..HEAD | scripts/checkpatch.pl --no-signoff -q -
  fi
}

The checkpatch script simple wraps the patch creation process and allows ...

Running Weston on a Raspbian

Fri 03 June 2016

Alt text

Progress in the VC4 graphics camp and the Wayland camp now enables us to run Weston on top of the drm backend for VC4 platforms. Previously software acceleration using pixman was needed, but this is no longer the case.

Additionally the rpi backend for weston is now being removed since it has been obsoleted by the improved drm layer.

Let's explore running hardware accelerated Weston on the Raspberry Pi.

Building Linux kernel

A comprehensive guide for building a recent Linux kernel for Raspberry Pi boards has been written by the Raspberry Pi foundation and is available here.

As of this writing the guide helps you build a v4.4 kernel which is good enough for our purposes.

Set up alternative install location

These build ...

Coverpage template

Sun 27 March 2016

Alt text

Coverpage is a single-page landing page built to showcase an idea or a product. To allow interested parties to get notified of updates, the template has mailchimp subscription integration.

A live version of the site can be found at coverpage.memcpy.io.

Sources

git clone https://github.com/robertfoss/coverpage.git

GitHub hosting

This template was built with the explicit intention of having it be hosted at GitHub in a gh-pages branch. Therefore it includes a Makefile for pushing copy of the current design to a gh-pages branch.

ESP8266 APA102 Bulb

Sun 07 February 2016

Alt text

The product of this project is a WiFi connected LED bulb. Every LED on this bulb is individually programmable over the WiFi, by simply sending UDP packets to the bulb.

Software and hardware sources

git clone https://github.com/robertfoss/esp8266_apa102_bulb.git

This project consists of 3 parts: the software running on the led bulb, the software running on some host computer and the hardware.

Firmware

The firmare is based on the NodeMCU firwmare for the ESP8266. It's running the APA102 LED driver and the enduser setup module, which I've written about previously.

Additionally it's running 3 lua scripts that deal with different aspects.

There's init.lua which makes sure we're connected to a WiFi.

udp_listener.lua receives UDP packets ...

WS2812 LED Matrix

Mon 12 October 2015

Alt text

The LED Matrix is constructed out of a WS2812B 8x8 panel, a 3D printed case, an ESP8266, a LiPo battery and some software.

Code

git clone https://github.com/robertfoss/esp8266_ws2812_matrix.git

The software is divided into two parts. The receiving end is run on the ESP8266 that has been flashed with NodeMCU and is a simple lua script that receives UDP packets and forwards them to the excellent WS2812 module created by the the equally excellent Konrad Beckmann.

The second part is run on a host pc. It's a simple python script that generates a framebuffer from a sinusoidal animation and transmits it over UDP to the IP of the ESP8266. This relies on the host pc being able to connect to the ...

WS2812 Welding Goggles

Sun 11 October 2015

Alt text

The goggles were built using an AtTiny85 module and a WS2812B strip and some bits and bobs that were laying around. A more complete BOM can be found below.

Code

git clone https://github.com/robertfoss/digispark_ws2812_waves.git

The animation is built ontop of the excellent light_ws2812 library. It supports the AtTiny85 better than other competing libraries like FastLED.

The animation is built around an non-float sin function and a HSV function that generates the actual colors.

Video

Bill of materials

User friendly setup of ESP8266 gadgets

Thu 30 July 2015

Alt text

The ESP8266 lacks a simple end-user compatible way to be configured with the login details of the local WiFi. Running the ESP8266 in a 'captive portal' mode where every http request is hijacked and replaced with form allows the end user to submit the credentials of the local WiFi hotspot by simply connecting to an ESP8266 hosted access point.

esp8266_nodemcu_wifi_setup is designed to provide a simple interface for users to configure their ESP8266/NodeMCU based devices through.

  • Start ESP.
  • Connect to the "SetupGadget" WiFi through your internet enabled thing of choice.
  • Submit credentials of your local WiFi.
  • The ESP reboots and connects to your local WiFi.

What is this magic! How could a mere mortal like me summon features like this?!

Let me tell you ...

Building NodeMCU for the ESP8266

Thu 14 May 2015

Alt text

This is a simple step-by-step guide to building and flashing NodeMCU for the ESP8266.

Build ESP8266 SDK

sudo apt-get install make unrar autoconf automake libtool gcc g++ gperf flex bison texinfo gawk ncurses-dev libexpat-dev python sed
cd /opt
git clone https://github.com/pfalcon/esp-open-sdk.git
cd esp-open-sdk
git submodule sync
git submodule update
make
export PATH=/opt/esp-open-sdk/xtensa-lx106-elf/bin:$PATH

Build NodeMCU

git clone https://github.com/nodemcu/nodemcu-firmware.git
cd nodemcu-firmware
# Switch to dev branch, since it's the most up to date
git checkout --track origin/dev
# Make INTEGER version, since it uses less memory/space
make EXTRA_CCFLAGS="-DLUA_NUMBER_INTEGRAL"

Flash NodeMCU

COMPORT=/dev/ttyUSB0 make flash

Modifying NodeMCU to fit your needs

app/include/user_modules.h

Contains a list of which ...