gpdaniels / spike-prime

Experiments with the LEGO Mindstorms (51515) and SPIKE Prime (45678)
MIT License
282 stars 39 forks source link

Add upload script? #22

Open pepijndevos opened 3 years ago

pepijndevos commented 3 years ago

Hey I just found this repo, and it seems like you've been doing really amazing work.

I've been working on writing an upload script that works on Linux. I documented the effort in an issue on this other repo I found that was documenting the hub internals: https://github.com/azzieg/mindstorms-inventor/issues/2

I've just successfully uploaded my first program: https://gist.github.com/pepijndevos/9d55dd4b53f630186545fa6361fc229a

Feel free to integrate this code in any way you like.

Are you aware of where the AFOL Mindstorms community hangs out? Would be great to share info as we learn more.

gpdaniels commented 3 years ago

Thanks for the script. I'll have a proper look at it at some point.

I've seen a few posts on eurobricks and some on the bricks stackexchange. Otherwise I'm not really sure where others post.

cscovino commented 3 years ago

Hey @pepijndevos, thanks a lot! It works for me with Spike Prime.

I've changed only one thing, in the last line.

I changed this

dat = waitfor(cmd_id)

to this

dat = waitfor(project_id)
cscovino commented 3 years ago

@pepijndevos Now I have a question 🤓. Is there a way to get all the "m" commands? For example, if I want to delete some slot, what would be the command?

pepijndevos commented 3 years ago

What I did is intercept the communication to the device with Wireshark. So you just delete a slot in the official software and see the json command.

Alternatively you can go decompile the code on the hub, which is some weird micropython assembly. Maybe running strings on it will be educational.

cscovino commented 3 years ago

@pepijndevos cool, thanks!

gpdaniels commented 3 years ago

Have you seen this: https://github.com/gpdaniels/spike-prime/issues/8#issuecomment-776167238

pepijndevos commented 3 years ago

Nice!

cscovino commented 3 years ago

@gpdaniels Great!