• I've been able to get a bunch of stuff to work from the IDE => RAM, then I figured out how to get it going properly from USB (no computer/IDE) by removing onInit(); and using save() command. So yeah, that works when powered over USB cube.

    However, when I apply 5V to the VUSB pin, it just flashes a blue light on and off... Not sure why it works in all circumstances but this?

    Thoughts?

    const wifi = require("Wifi");
    const ws = require("ws");
    
    const WIFI_NAME = "OceanusStudio";
    const WIFI_OPTIONS = { password : "studio125" };
    
    const connectToWifi = () => {
        wifi.connect(WIFI_NAME, WIFI_OPTIONS, (err)  => {
            if (err) {
              //console.log("Connection error: " + err);
              return;
            } else {
                //console.log("Wifi Connected!");
    
                var info = {
                        ip: "192.168.0.159",
                        gw: "192.168.0.1",
                        netmask: "255.255.255.0"
                };
    
                wifi.setIP(info, (err) => {
                        //console.log("IP set!");
                        startServer();
                });
            }
        });
    };
    
    const getPage = () => {
        var today = new Date();
        var time = today.getHours() + ":" + today.getMinutes() + ":" + today.getSeconds();
        return 'allo guv :: ' + time;
    };
    
    const onHttpRequest = (request, response) => {
        //console.log("Processing request");
        response.writeHead(200, { 'Content-Type': 'text/html' });
        response.end(getPage());
    };
    
    const startServer = () => {
        //console.log("Starting Server");
        ws
            .createServer(onHttpRequest)
            .listen(80)
            .on("websocket", (socket) => {
                //console.log("websocket connection");
                socket.on("message", (msg) => {
                    //console.log("websocket message: " + msg);
                    socket.send("pong");
                });
            });
    
    };
    
    function onInit() {
        connectToWifi();
    }
    

    Thanks!
    Matt

  • I checked voltage w meter and it's around 4.5, which I believe should work, no?

  • Man this is embarrassing again, but 4.5V is not enough. I was able to get 5.2V or so and now it works.

  • It has to do with misplaced voltage regulator, but basically, blue light flashing is the behavior when u arent properly powered.

  • It has to do with misplaced voltage regulator

    Misplaced regulator on the Espruino board? I imagine most likely what happens is as soon as the WiFi powers on it draws so much power it cases a reset

  • No its a bad regulator coming from the PS on my side. I used the autolocator all day in a session yesterday and it's running pretty well!

  • Interface is not right. But it's working pretty well.


    1 Attachment

  • That's great! Glad to see it working nicely :)

  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

It works over IDE, when powered from USB, but not when powered via VUSB pin 5v?

Posted by Avatar for mattw @mattw

Actions