Open shownb opened 4 years ago
This is supposed to connect to a python script that will communicate via mqtt with rpi. The python script can run anywhere, including your pi.
I created a similar project like that. instead of rpi,i use a esp32 chip with Micropython. my aim is that my children can control the esp32 through Scratch3. now very thing works almost perfect.
I use it in that way: https://sheeptester.github.io/scratch-gui/?url=http://shownb.github.io/esp/rpi.js
only the Scratch.BlockType.HAT can not work
I am also interested in esp32 for scratch - this is going to help me as well :) Keep in mind that the BlockType.HAT does work if you build the Scratch VM with the extension included instead of side loading it as a .js file. This had been a known issue since the pre-release days but I don't know if it has been somehow addressed in the meantime.
yes, it works when I build it in a Scratch VM. and it won't work through the remote url import only in the scratch gui . your raspberrypi.js is for gui,not for vm ,so I just think that you have solved the problem. now I know that it is a issue in scratch gui.😊
and the idea of your hello-pie is very good. I have learned a lot of it.
I set up like this: I edit scratch-gui/src/lib/libraries/extensions/index.jsx like that:
but can not connect to websocket console show that
[Log] vm – "warn" – "Primitive rejected promise: " – DataCloneError: The object can not be cloned. — shared-dispatch.js:137 (lib.min.js, line 233846) DataCloneError: The object can not be cloned. — shared-dispatch.js:137