Playdate SDK for Linux?

Sadly not really one standard to go by :frowning:

I might do a little more digging on what standard apps do, but I've done some hacks for now. It's standard for any app to use udev rules, at least. The mounting bits are less standard as linux doesn't really want non-root users to mount things by default.

/etc/udev/rules.d/80-playdate.rules

SUBSYSTEM=="tty", ATTRS{manufacturer}=="Panic Inc", ATTRS{product}=="Playdate" SYMLINK+="playdateACM%n", GROUP="dormando"

SUBSYSTEM=="block", SUBSYSTEMS=="scsi", ATTRS{model}=="Playdate        ", SYMLINK+="playdate%n", GROUP="dormando"

May also need:

SUBSYSTEM=="tty", ATTRS{manufacturer}=="Panic Inc", ATTRS{product}=="Playdate", ENV{ID_MM_DEVICE_IGNORE}="1"

... as its own line or in the first line to avoid an issue opening the device when first plugged in.

Added to /etc/fstab:

/dev/playdate1 /mnt/playdate vfat noatime,noauto,group 0 0

... which creates some stable symlinks when the device is plugged in (for those of us who may have many ttyACM's...). The "group" option to the fstab line lets my user mount and unmount the device without sudo or root. eject also works.

A simple upload script would look like:

#!/bin/bash
pdutil /dev/playdateACM0 datadisk
sleep 2
mount /mnt/playdate
cp -R $1 /mnt/playdate/Games/
umount /mnt/playdate
eject /dev/playdate

... which you could then call from a makefile.

... I'll probably write a better script that waits for the devices to show up before doing things. There's also a bit of delay before you can re-run the mount routine (think I need another rule to disable the modemmanager). I also don't know if you're supposed to leave it mounted while testing or not :stuck_out_tongue: easy enough to adjust the script if so.

Also depending on your distro it will automount somewhere via the label PLAYDATE once the datadisk command is sent. So the rest of this might not make sense. :slight_smile:

[edit]: to expand a bit: all the various devices I have that are accessed under linux, either mount somewhere by default when plugged in (without being poked first, and then they stay mounted), or stream firmware over the /dev/ttyACM* device since distro's usually have a 'dialout' or similar group that it's easy to add your user to. Playdate seems to want to do both.

3 Likes