Tag Archives: arch linux

I’m on Linux, and here’s what I did to get the Adafruit Pro Trinket (3.3V version) to work. I think most of this should work for other Adafruit boards as well. I’m on Arch Linux, but other distros will be similar, just find the right paths for everything. Your version of udev may vary on older distros especially.

Install the Arduino IDE. If you want to install the adafruit version, be my guest. It should work out of the box, minus the udev rule below. I have multiple microprocessors I want to support, so this wasn’t an option for me.

Copy the hardware profiles to your Arduino install. pacman -Ql arduino shows me that I should be installing to /usr/share/aduino. You can find the files you need at their source (copy the entire folder) or the same thing is packaged inside of the IDE installs.

1

cpadafruit-git/usr/share/arduino/adafruit

Re-configure “ATtiny85” to work with avrdude. On arch, pacman -Ql arduino | grep "avrdude.conf says I should edit /usr/share/arduino/hardware/tools/avr/etc/avrdude.conf. Paste this revised “t85” section into avrdude.conf (credit to the author)

Install a udev rule so you can program the Trinket Pro as yourself (and not as root).

Add yourself as an arduino group user so you can program the device with usermod -G arduino -a <username>. Reload the udev rules and log in again to refresh the groups you’re in. Close and re-open the Arduino IDE if you have it open to refresh the hardware rules.

You should be good to go! If you’re having trouble, start by making sure you can see the correct hardware, and that avrdude can recognize and program your device with simple test programs from the command link. The source links have some good specific suggestions.

In a previous post I discussed how to backup android with rsync. In this post, I’ll improve on that solution so it happens when you plug the phone in, rather than manually. My solution happens to know I have only one phone; you should adjust accordingly.

The process is

Plug the phone in

Unlock the screen (you’ll see a prompt to do this).

Backup starts automatically

Wait for the backup to finish before unplugging

First, let’s add a udev rule to auto-mount the phone when it’s plugged in and unlocked, and run appropriate scripts.

We’ll add something to mount and unmount the system. Keeping in mind that mounting only works when the screen is unlocked we’ll put that in a loop that checks if the mount worked:

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

#!/bin/sh

# /usr/local/bin/android-mountfs

android_locked()

{

ls/media/android2&gt;/dev/null&gt;/dev/null

["$?"-eq2]

}

jmtpfs/media/android# mount

whileandroid_locked;do

fusermount-u/media/android

sleep3

jmtpfs/media/android# mount

done

1

2

3

#!/bin/sh

# /usr/local/bin/android-umountfs

fusermount-u/media/android

The contents of /usr/local/bin/phone-backup are pretty me-specific so I’ll omit it, but it copies /media/android over to a server. (fun detail: MTP doesn’t show all information even on a rooted phone, so there’s more work to do)

Connecting android to Windows and Mac, pretty easy. On arch linux? Major pain. Here’s what I did, mostly via the help of the arch wiki:

Rooted my phone. Otherwise you can’t back up major parts of the file system (including text messages and most application data) [EDIT: Actually, you can’t back these up over MTP even once you root your phone. Oops.]

Installed jmtpfs, a FUSE filesystem for mounting MTP, the new alternative to mount-as-storage on portable devices.

Enabled ‘user_allow_other’ in /etc/fuse.conf. I’m not sure if I needed to, but I did.

Plugged in the phone, and mounted the filesystem:

1

jmtpfs/media/android

The biggest pitfall I had was that if the phone’s screen is not unlocked at this point, mysterious failures will pop up later.

Synced the contents of the phone. For reasons I didn’t diagnose (I assume specific to FUSE), this actually fails as root: