For the wiznet, this is what I use:
function onInit() { // Ethernet Card SPI2.setup({ mosi:B15, miso:B14, sck:B13 }); var eth = require("WIZnet").connect(SPI2, B10); eth.setIP(); global.eth = eth; // Prevent reset function softreset() { clearInterval(); clearWatch(); Object.keys(global).forEach(function(n) { if(n!="onInit" && n!="Ethernet" && n!="Server" && n!="Socket" && n!="Serial" && n!="Pipe" && n!="LoopbackA" && n!="LoopbackB" && n!="eth" && n!="fullreset" && n!="reset") { delete global[n]; } }); console.log("Can't reset properly - we'd break the network. Use fullreset() instead."); } // Telnet Server require("net").createServer(function (connection) { connection.pipe(LoopbackA); LoopbackA.pipe(connection); LoopbackB.setConsole(); if(!global.fullreset) { global.fullreset = global.reset; global.reset = softreset; } }).listen(23); } //save();
(Updated with Gordon's tip)
@heri16 started
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
For the wiznet, this is what I use:
(Updated with Gordon's tip)