spike-prime icon indicating copy to clipboard operation
spike-prime copied to clipboard

Add upload script?

Open pepijndevos opened this issue 3 years ago • 8 comments

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.

pepijndevos avatar May 02 '21 15:05 pepijndevos

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.

gpdaniels avatar May 14 '21 20:05 gpdaniels

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 avatar Jun 02 '21 18:06 cscovino

@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?

cscovino avatar Jun 02 '21 20:06 cscovino

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.

pepijndevos avatar Jun 03 '21 11:06 pepijndevos

@pepijndevos cool, thanks!

cscovino avatar Jun 03 '21 12:06 cscovino

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

gpdaniels avatar Jun 04 '21 14:06 gpdaniels

Nice!

pepijndevos avatar Jun 04 '21 14:06 pepijndevos

@gpdaniels Great!

cscovino avatar Jun 04 '21 15:06 cscovino