- os-IoTtalk
- os-AutoGen
- os-ScratchTalk
- Configure https on your server
- Create the device model
Scratch3
on your IoTtalk, containing idfs: Microphone-I (1-dim), Orientation-I (3-dim) and odfs: Horizontal-O (1-dim), Vertical-O (1-dim), Volume-O (1-dim).
- Download
$ git clone https://github.com/IoTtalk/os-ScratchTalk.git
$ cd os-cratchTalk
$ git submodule init
$ git submodule update --recursive
- Configurations
In
scratch-gui/src/components/library/library.jsx
,line 21 set URL.
const serverName = "<ScratchTalk Address>"
In scratch-gui/config.js
line 1, 2 set URLs.
exports.iottalkCSM = "<IoTtalk Address>";
exports.serverName = "<ScratchTalk Address>";
In scratch-vm/src/extensions/scratch3_iottalk/iottalk/config.js
,line 1, 2 set URLs.
exports.iottalkCSM = "<IoTtalk Address>";
exports.serverName = "<ScratchTalk Address>";
In ScratchTalk-Subsystem/config.js
, set URLs.
exports.serverName = "<ScratchTalk Server Domain Name>";
exports.serverPort = "<ScratchTalk Server Port>";
exports.autogenURL = "<AutoGen Address>/autogen/ccm_api";
exports.authIssuer = "<OAuth server URL>";
exports.authClientID = "<clientID>";
exports.authClientSecret = "<clientSecret>";
exports.authURI = "<OAuth Auth URI>";
exports.authCallbackURI = "<OAuth callback URI>";
exports.authTokenURI = "<URI for exchange token>";
In ScratchTalk-Subsystem/rc/js/main.js
, line 2 set URL.
const csmURL = "https://<iottalk address>";
In ScratchTalk-Subsystem/rc/js/csmapi.js
, line 2 set URL.
var ENDPOINT = "https://<iottalk address>";
- Run Scratch GUI (frontend)
$ cd ./scratch-vm && npm install && npm link
# Link the scratch-vm to GUI
$ cd ../scratch-gui && npm install && npm link scratch-vm
$ npm start
- Run ScratchTalk-Subsystem (backend)
$ cd ScratchTalkSubsystem
$ npm install
$ npm start
- DB setting (using sqlite as DB)
In
ScratchTalk-Subsystem/db/db.js
uncomment line 21 to 33 and comment line 7 to 18 and 44 to 50
- DB setting (using mysql as DB)
In
ScratchTalk-Subsystem/config.js
exports.dbHost = "<your_db_host>"; // eg: "localhost";
exports.dbUser = "<your_db_user>"; // eg: "root";
exports.dbPassword = "<your_db_passwd>"; // eg: "root";
exports.db = "<your_db_pawwsd>"; // eg:"scratchtalk";
- Setting IoTtalk user and password
In
ScratchTalk-Subsystem/config.js
exports.iottalkUser = "<your_iottalk_useer>" //eg: "scratchtalk";
exports.iottalkPassword = "<your_iottalkpasswd>" // eg: "scratchtalk";
In scratch-gui/webpack.config.js
, add public
in the devServer
section.
devServer: {
public: '<scratch GUI domain name>' // That solved it
}