Permalink
Browse files

Updates for ScratchX.org site

  • Loading branch information...
1 parent 8869cd5 commit 7dfdd9e43aa4adb1cb0f575adc9584783f6909c1 @MrYsLab committed May 15, 2015
Showing with 10 additions and 30 deletions.
  1. +6 −27 README.md
  2. +4 −3 servers/xiserver/xiserver.js
View
@@ -18,39 +18,18 @@ None
### Known Limitations Imposed By The Scratch Team:
-####!!!!!! Scratch 2.0 Has Gone From HTTP to HTTPS, Preventing WebSocket Connections From Succeeding !!!!!!!!
-Until we can provide a wss (secure WebSocket) solution, here is a workaround for Firefox and Chrome Browsers.
+Currently Xi works only on Chrome. After launching the Xi server for your board, go to:
+[http://scratchx.org/?url=http://MrYsLab.github.io/xi4s.js](http://scratchx.org/?url=http://MrYsLab.github.io/xi4s.js)
-For Firefox, enter this "url" into the browser:
-```
-about:config
-```
+Xiduino loads this page automatically after the server is started.
-When the warning screen appears, click on the "I'll be careful I promise" button.
+This is the new Scratch Extension Web Site. After it launches, wait a moment and a dialog box will appear to allow
+you to continue with loading the extension.
-Next, search for
-```
- network.websocket.allowinsecureFromHTTPS
-```
-and click on the line to set it to true. Then close and reopen Firefox.
+Accept the warning and the Xi blocks will load.
-For Chrome, enter this "url" into the browser:
-```
-chrome://flags
-```
-and then search for
-```
-Allow insecure WebSocket from https origin.
-```
-Then click on "enable". Close and reopen Chrome.
-
-
-1. Currently Xi only works with the Scratch 2.0 Online editor.
-2. Projects created using Xi cannot be shared on the Scratch cloud.
-
-
### Arduino/Device Wiring Information:
1. [HC-SR04 SONAR Distance Device](https://github.com/rwaldron/johnny-five/blob/master/docs/ping.md)
2. [Infrared Distance Sensor - GP2Y0A21YK0F -- Black Wire to ground, White wire to Analog Input Pin](https://www.adafruit.com/products/164)
@@ -70,7 +70,7 @@ var board; // a johnny-five 'board'
var xiServerVersion = "XiServer version .004 22 Nov 2014";
var serverType = 'ard'; // set by user in command line invocation
-var urlAddr = 'http://scratch.mit.edu';
+var urlAddr = 'http://scratchx.org/?url=http://MrYsLab.github.io/xi4s.js';
var debugLevel = 0; // set by user in command line invocation
var comPort; // communications port for Arduino - allows user to select the com port
var ipPort = 1234; // ip port number
@@ -210,6 +210,7 @@ board.on('ready', function () {
// TODO: explore using JSON instead of current delimitation scheme
var msg = message.utf8Data.split('/');
+
// Process each message type received
switch (msg[0]) {
// handshake with client at start up of socket
@@ -397,9 +398,9 @@ board.on('ready', function () {
if (debugLevel >= 3) {
console.log('digitalWrite: board ' + msg[1] + 'pin' + msg[2] + ' value ' + msg[3]);
}
- // validate that this pin was initially set to correct mode
+ //validate that this pin was initially set to correct mode
if (board.io.pins[msg[2]].mode !== five.Pin.OUTPUT) {
- connection.send('invalidPinCommand/' + 2 + '/' + msg[1] + '/' + msg[2]);
+ connection.send('invalidPinCommand/' + 2 + '/' + msg[1] + '/' + msg[2]);
}
else {
if (msg[3] === 'Off') {

0 comments on commit 7dfdd9e

Please sign in to comment.