• Raspberry Pi dwc2 Gadget Notes

    Here are some notes from experiments with dwc2 otg enabled on a Raspberry Pi Zero.

    read more →
  • Message Queue Link Dump

    We use Redis fairly heavily for Adafruit IO, and I started wondering if there might be some better/faster options for our MQTT Redis message queue. It looks like there are many options that are much faster than Redis.

    read more →
  • Redis Killed by OS?

    Redis Server has been killed a few times this week by the OOM. More info in this post on stackoverflow.

    After setting the maxmemory limit to 3GB, and maxmemory-policy to allkeys-lru, things should have gotten better. For some reason node.js workers would die as soon as they were restarted, reporting that they couldn’t connect to Redis.

    Starting the process manually would connect successfully, so the problem seemed to be with pm2, which manages the node cluster.


    I tried killing pm2 by running the following command.

    $ pm2 kill

    Then, I restarted the node cluster, and everything was back to normal.

    $ sudo service io-server-cluster restart
    read more →
  • Copy Raspbian Image to SD Card with Progress Bar on OS X

    Find the SD card using diskutil list:

    todd:~ todd$ diskutil list
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:      GUID_partition_scheme                        *251.0 GB   disk0
       1:                        EFI EFI                     209.7 MB   disk0s1
       2:          Apple_CoreStorage                         250.1 GB   disk0s2
       3:                 Apple_Boot Recovery HD             650.1 MB   disk0s3
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:                  Apple_HFS Macintosh HD           *249.8 GB   disk1
                                     Logical Volume on disk0s2
                                     Unlocked Encrypted
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     Apple_partition_scheme                        *17.5 MB    disk2
       1:        Apple_partition_map                         32.3 KB    disk2s1
       2:                  Apple_HFS Flash Player            17.4 MB    disk2s2
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *15.9 GB    disk3
       1:             Windows_FAT_32 boot                    62.9 MB    disk3s1
       2:                      Linux                         15.9 GB    disk3s2

    Unmount the SD card:

    todd:~ todd$ diskutil unmountDisk /dev/disk3
    Unmount of all volumes on disk3 was successful

    Copy the image to the SD card using dd and use pv to display progress:

    todd:~ todd$ pv ~/Downloads/2015-11-21-raspbian-jessie.img | sudo dd bs=16m of=/dev/disk3
    837MiB 0:05:19 [3.21MiB/s] [=======>                              ] 22% ETA 0:18:29
    read more →
  • Notes on Raspberry Pi USB Gadget Mode

    via raspberrypi/linux#884:

    Use the upstream dwc2 driver in gadget mode - this in theory “should work” but hasn’t really been tested in device mode. The hardware is similar to the type underneath the s3c_hsotg driver in upstream and there is an ongoing effort to consolidate both codebases. This would be the ideal solution if you just require device mode.

    Other useful threads:

    read more →