Swift Playgrounds - Pixelblaze

Hello:

I am looking to develop a version of the PB web interface as a Swift Playgrounds app. A version without the 2D / 3D mapping. I would like advise on the best way to approach this challenge. For example, would using the Pixelblaze-Client created by zranger1 be a starting place for identifying the fundamental components necessary to recreate basic elements of the PB web interface? Or might there be a template for what would be required to develop the features that are currently present in the PB web interface? Any advise or suggestions would be appreciated. Thanks

Disclaimer: I haven’t had an Apple machine for development since Objective-C was king, and have only a passing familiarity with Swift, and none at all with the playground. Still…

The Web UI uses both http and websockets protocols, a couple of different data encodings, plus decompression of the pattern binaries to access preview images if you want them. It’s a non-trivial undertaking. I’d do it in stages, probably starting with using the websocket interface to control the Pixelblaze.

You can get information on protocols from pixelblaze-client and the Firestorm source code. I’d also recommend looking at @nick_w’s async python library, because the async model is a better fit for Swift, and it also has some code dealing directly with binary pattern files.

@zranger1
Currently, I am able to use the websocket to control the PB. As I am in the early development stages, I am still working out how much of the PB web interface I need to recreate. Ultimately this project will be an app to introduce middle-schoolers to coding.

Thanks for the information. I appreciate the work that you did on the Python library.

1 Like

There’s no tougher or more worthwhile task than getting kids to understand how fun and useful it is to know something about programming. Awesome! I look forward to seeing what you come up with!

Absolutely. Happy to share.