IoT.js is an open source software platform for Internet of Things with JavaScript. For more details, please refer to http://www.iotjs.net or shipped README in sources.
- Use reference configuration
- To enable IoT.js feature
- How to load scripts
- How to configure Network
- Resources
machine=artik053 # Adapt with your supported target
cd os && ./tools/configure.sh ${machine}/iotjs # Generate os/.config
make menuconfig # Verify WiFi credentials
make # Will build os image with IoT.js in and example
To select the required feature, you can use the menuconfig as in the example below:
make menuconfig
# Application Configuration --->
# Examples --->
# [*] IoT.js StartUp example
# (/rom/example/index.js) Main javascript file
# [ ] Connect WiFi
# (0) Authentication type
# (0) Encryption type
# Application entry point (...) --->
# (X) IoT.js StartUp example
File can be loaded for different locations. For convenience, it is recommended to use the approach of adding a ROM partition as explained in HowToUseROMFS.md. Then place your script(s) in tools/fs/contents-romfs, such as, for instance:
cat tools/fs/contents-romfs/example/index.js
console.log(JSON.stringify(process));
WiFi can be also enabled on boot if you want to join a network before running the script. You need to run "make menuconfig" again and edit credentials.
make menuconfig
# Application Configuration --->
# Examples --->
# [*] IoT.js StartUp example
# (/rom/example/index.js) Main javascript file
# [*] Connect WiFi
# ("APSSID") SSID of AP
# ("APPassword") Passphrase of AP
# (4) Authentication type
# (4) Encryption type
# Application entry point (...) --->
# (X) IoT.js StartUp example
Edit "SSID of AP" and "Passphrase of AP" with your WiFi SSID and password. For values of "Authentication type" and "Encryption type", use menu to find values that match your WiFi configurations. For example, 4 for Authentication type of "WPA and WPA2 PSK", and 4 for "Encryption type of "TKIP".