I use a module WIZnet W5500 for network. My code:
let WIZnet = require("WIZnet"); var http = require("http"); SPI2.setup({mosi: B15, miso: B14, sck: B13}); let eth = WIZnet.connect(SPI2, B12); setTimeout(function() { eth.setIP(); console.log("ip", eth.getIP()); },1000);
If I unplug the net cable, this code stopped in 'ERROR: No free sockets found', but I don't know how to catch this error.
On the other hand, how do I continuedly listen the eth while I plug the net cable for initializing the network?
@user109783 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.
I use a module WIZnet W5500 for network.
My code:
If I unplug the net cable, this code stopped in 'ERROR: No free sockets found', but I don't know how to catch this error.
On the other hand, how do I continuedly listen the eth while I plug the net cable for initializing the network?