playdate: `run` command with `--device` flag gets stuck
As discussed in https://github.com/boozook/playdate/issues/314#issuecomment-2065686756
When I attempt to use cargo playdate run --device I can’t get past the device showing “sharing DATA segment as USB drive” and “Eject disk to reboot”.
My terminal says Running hello-world on a device and eventually exits but the device stays the same.
If I inspect the Games directory on the device while it’s still mounted, the game isn’t there. If I manually eject the device and then look for the game on it, it isn’t there either.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 1
- Comments: 46 (42 by maintainers)
Commits related to this issue
- Add debug print for #326 — committed to boozook/playdate by boozook 3 years ago
- Support devices connected via USB-hub on macOs (fixes #326) — committed to boozook/playdate by boozook 3 years ago
- Support devices connected via USB-hub on macOs (#358) * Support devices connected via USB-hub on macOs (fixes #326) * Bump bins, update deps — committed to boozook/playdate by boozook 3 years ago
Ah, yes I should have mentioned that. I have a bunch of USB devices/hubs connected to my machine, and previously the Playdate was connected two hubs deep.
Trying the new build, I see the expected behavior and trace/debug output for
pdtool mount --waitandpdtool unmount --wait. I confirmed this new build works with the PD connected directly, 1, 2, and 3 hubs deep. Thanks very much for getting this figured out and fixed so quickly!I’m sure the last issue I posted about here was due to the wrong/old build of
cargo-playdatehanging around in my Nix dev shell.It happened again when I was working on the Lua API PR and had pulled in some changes from the main branch. I’m not yet sure why it happens when I do that but I was able to identify it and make sure I was using the correct build.
All of that to say, this issue remains fixed for me at the moment.
Thanks guys, appreciate the prompt and thorough responses.
When running
pdtool mount --wait, the connected Playdate enters data disk mode very quickly. My shell sits waiting for a minute or so, eventually timing out with[ERROR pdtool] Awaiting device timeout `PDU1-YMYSERIAL(S)`.. The Playdate is visible in Finder as expected during/after.Works great here. Not sure what happened. Thanks again.
I tried
mainat 5f03a23ea8904799c7b26d1d371d74443ec38195 and this issue appears to be fixed. Thanks!I ran
CARGO_PLAYDATE_LOG=trace cargo playdate run --deviceand looked at the code that callssystem_profilerso have a better understanding of what that’s trying to do now.I think
ERROR: missing field `serial_num` at line 31 column 9must be the issue but it’s there in the JSON and appears in the output afterwaiting mount point availabilityI’ve been putting off upgrading just because I didn’t want to deal with any churn that might come with it 😄
I’m on 12.2.1
Will do, thanks!
Thank you. Done, merged, published.
» RUST_LOG=trace CARGO_PLAYDATE_LOG=trace system_profiler -json SPUSBDataTypeA bunch of output removed for brevity/privacy:
Running the second command errors with
jq: error (at <stdin>:313): Cannot iterate over null (null). This adjusted command gives the expected UUID:system_profiler -json SPUSBDataType | jq '.SPUSBDataType[] | ._items[]? | ._items[]?.Media[]?.volumes[]? | select(._name=="PLAYDATE") | .volume_uuid' -r@paulstraw I suppose its about changed format of
system_profiler.To get exactly what’s wrong I recommend do two steps.
But first of all set
RUST_LOGandCARGO_PLAYDATE_LOGenv vars to"trace.Well, first step is to mount device somehow (use
pdutil,pdtoolor by hand) and then run following command and show me the output (I need just structure with names of fields and to know that value is empty or not)Second is similar, but imitate used fallback method to determine mount-point:
(same as above)
This way we can understand whether the problem is in the output format or not.
I’m also hitting the issue originally described here. My env:
playdate 0.2.0specified in Cargo.lockI tried again from
mainand it works as expected. I’ll trydev/debug-326just to be sure.Reopening due to https://github.com/boozook/playdate/pull/327#issuecomment-2087818912
I traced the value passed to
Volume::fromhere and got a different result this time:https://github.com/boozook/playdate/blob/de8d14cf9b1e689bfed610d9dff60cf0bc452e74/support/device/src/mount/mac.rs#L101
The game installed and ran on my device. I reverted the change and it still works. I’m not sure what happened before that when I got
volume found ''I omitted a lot of fields for brevity and changed the names of things between angle brackets for privacy and security. I also redacted the serial number.
That appears to be the case, sorry for the confusion.
It’s not, at least not in this case, and I’m using Nix on macOS FWIW.
In this instance I’m using it as a convenient way to set up a developer shell environment, which basically just puts various things on the
PATHThe device is definitely mounted as a drive; I can explore it and need to eject the disk.