How difficult would it be to combine NetsBlox and Snap4Arduino?
In our project we would like students to combine the NetsBlox services (and other web services) with physical computing on a Raspberry Pi and/or Arduino. The ideal system would have blocks from both extensions of Snap!. Note that we are happy to use the Chromium extension to Snap4Arduino so it is completely browser-based just as NetsBlox is. For the Raspberry Pi we can run NetsBlox unaltered by adding blocks that communicate with a local web server that talks to the hardware pins. Is my guess right that combining NetsBlox and Snap4Arduino is a large undertaking?
Merging the code bases from each would likely be a pretty significant undertaking.
However, we have plans to add network enabled robots (controlled wirelessly) in NetsBlox. Basically, our idea is to leverage the existing network to communicate with swarms of network enabled robots. As the server is the intermediary which knows about all the robots, it can emulate sensors as well for the users. This would let the users write code which uses a variety of advanced sensors on the robot which are simply emulated on the server (so the robots can remain affordable and feasible for classroom environments).
We have also been considering taking this one step further. Since we have a server managing the communication between the users and the robots' environment, we could also use a projector to add virtual entities which are simply projected on the environment. As the server is emulating the robot sensors, it can make this virtual entity able to be sensed and interactive with respect to the robots.
Let me know if you decide to try to merge Snap4Arduino and NetsBlox and I can provide some more insight into the NetsBlox code base.
Thanks for the response.
Your plans are interesting and promising. While I personally am OK with simulated sensors I expect that will reduce the appeal for many students and teachers relative to real hardware. But I see your point about feasibility and cost.
This won't help in my project but see my next post.
I am now wondering if using the [http://snap4arduino.org/#http](Snap4Arduino local server) might enable one to run NetsBlox in one tab and Snap4Arduino in another. A student could then program NetsBlox to send data to Snap4Arduino using the HTTP block or the like. (Packaged up in a friendly user-defined block.) Snap4Arduino could receive the data as a message and as values of variables. NetsBlox could even ask for values of Snap4Arduino variables to know what data to send.
I tried to test the feasibility of this but ran into a problem right away. I tried localhost:42001/broadcast=MESSAGE, 127.0.0.1:42001/broadcast=MESSAGE, and 18.104.22.168:42001/broadcast=MESSAGE but couldn't get anything to work (I just got "localhost didn’t send any data.")
After posting this I will send a link to this thread to the Snap4Arduino discussion.
Link to this thread: https://github.com/bromagosa/Snap4Arduino/issues/179
Sending an http message from netsblox should work. I am not really familiar with the Snap4Arduino server... have you tried using something like postman to make sure that the snap4arduino server can receive messages?
Thanks. I've made some progress. See https://github.com/jmoenig/Snap--Build-Your-Own-Blocks/issues/1830