Sunday, February 27, 2011

Modk.it/editor/preview challenges- Chrome developer tools

I looked a little further into the problem of getting Modkit to program the Arduino. I used Google Chrome's Developer tools to look at the kinds of errors that might be causing the "error programming/compiling" messages. It seems as if several are XMLHttpRequests that cannot load. The Modkit/editor seems to be trying to get information from a local host server (127.0.0.1:3000). A localhost server is one that runs on the device on which the browser is running.

XMLHttpRequest cannot load http://127.0.0.1:3000/send. Origin http://www.modk.it is not allowed by Access-Control-Allow-Origin.
sendFailed to load resource
receive:-1Resource interpreted as script but transferred with MIME type application/json.
XMLHttpRequest cannot load http://127.0.0.1:3000/send. Origin http://www.modk.it is not allowed by Access-Control-Allow-Origin.
sendFailed to load resource
receive:-1Resource interpreted as script but transferred with MIME type application/json.
getStateNamesFailed to load resource: the server responded with a status of 404 (Not Found)
XMLHttpRequest cannot load http://127.0.0.1:3000/registerEvent. Origin http://www.modk.it is not allowed by Access-Control-Allow-Origin.
registerEventFailed to load resource

For security and control, Apple and MLTI limit the use of MLTI machines as servers. I don't find anything in Modkit's rudimentary documentation (they say it is still under development) about requiring that the Modkit/editor has an active web-server. So, I guess we have to wait for updates and or more documentation at Modkit.

Neither Safari Webkit nor Firefox were any more successful in resolving the issue.

Update 2011-3-15: The latest releases seem to have resolved several of these challenges. I am able to read an analog input (potentiometer) and make the LEDs change in response to the changing input. I'm looking forward to being able to save and load code. These changes come from both improvements in the tools and improvements in my understanding of how to use them. Look for my contributions to the community of learners on the Modkit blog.

No comments: