• Lots of progress made. I am loving Espruino!

    Most of my communications problems seem to be down to my BT router. I've created a separate wifi network for running the Espruino set-up on on and everything is working as expected. There must be some 'security' settings in the BT router that are messing things up.

    My permission problems when POSTing via XHRs in the webpage to the Espruino WiFi were fixed by including. Access Control info in the response header:

    res.writeHead(200, {
        'Access-Control-Allow-Origin': '*',
        'Content-Type': 'application/json',
      });
    

    I'm happily making websocket connections from a page in Chrome (not being served by the Espruino) to the Espruino. It's much faster than using HTTP, but I still get some packet loss. How many messages per second should the Espruino ws server be able to handle? Also, can my client tell when a packet hasn't got through? Would I have to send a message back from the Espruino to do this?

    I find that some of my packets are coming through mashed up though. I'm expecting 2 digit hex chars in my message (four pairs, like "0FEFDE99") but sometimes the Espruino ends up with:

    Hex Error: ÿM
    Hex Error: F
    Hex Error: õ
    Hex Error: ¨T
    Hex Error: Qâ
    Hex Error: V
    Hex Error: ZD
    

    The chars after "Hex Error:" are what's being received and that my function is trying to turn in to decimal. The packets are definitely being sent correctly.

    I'm also getting these error messages every now and then on the Espruino:

    WS: Unknown opcode 13
    WS: Unknown opcode 15
    WS: Unknown opcode 4
    

    I'm pretty close to having a little web drawing program talking to a Espruino controlling a neopixel grid. Not bad for a couple of days work. I'll do some tidying up at some point and share it.

    Nice platform.

    Sean

About

Avatar for seanclark @seanclark started