You are reading a single comment by @Gordon and its replies. Click here to read the full conversation.
  • So this is an Original Espruino board with Bluetooth installed?

    I'm afraid the bluetooth module (HC-05 / HC-06) acts as a simple serial port - so there's no file transfer or even connected/disconnected event.

    You'd have to add a bit of software on the Mac to receive the file. It shouldn't be too bad for example if you have it send the string "\x10sendFile();\n" then it will silently call the sendFile function, which could send the contents.

    You can then make a sendfile function on Espruino -something like:

    function sendFile() {
    var f = E.openFile('log.txt','r');
    var d = f.read(100);
    while (d!==undefined) {
      Serial1.write(d);
      d = f.read(100);
    }
    f.close();
    Serial1.println("<<EOF>>");
    }
    

    Then your code only has to write everything it receives to a file until it gets the characters <<EOF>>

About

Avatar for Gordon @Gordon started