Bluetooth module

Posted on
  • I recently tried but failed soldering the Bluetooth module on to the pad of my v1.4 board. I toasted two of the little pads near one of the corners, so now it won't work.

    Is there any other way to use the Bluetooth module? Can it be connected via wires to the pin strips I soldered on either edge of the Espruino?

  • Hi,

    Yes, no problem. Were the pads that came off some of the ones marked with red dots on the picture here? http://www.espruino.com/Bluetooth

    The bluetooth module only needs 4 pins. A9(Espruino TX), A10(Espruino RX), GND and 3.3v. All of which are on the pin strip. There's a bit of info here: http://www.espruino.com/Wiring+Up

    And I've attached an image showing what should be where on the bluetooth module - 'TX' on the image should be connected to Espruino RX (A10) and vice versa.

    It's probably best to keep the module soldered onto the board, but just to solder on wires for the 2 pads that have fallen off.


    1 Attachment

    • bluetooth_wiring.png
  • Gordon, thank you very much, as it turned out it was the GND and 3.3V pads that I ruined. I left the Bluetooth soldered and just wired these to pins on the strip.

    I have paired my laptop but I get undefined if I do:

    Serial1.on('data', function (data) {console.log(data);}); 
    Serial1.print("AT")
    

    If I plug the board in to USB and send the following code, and do save();

    var run = function(){
      digitalWrite(LED1,l=!l);
      console.log('run');
    };
    
    setInterval(run,1000);
    

    When I plug the board into a USB plug via the mains socket, I see a flashing LED and I get the string "run" sent via bluetooth to my WebIDE.

    What I don't understand is how can I send messages to the Espruino from either my PC or my phone?

  • When it's connected, and you're getting those "run" messages over web IDE, you should be able to interact with it through webIDE just like it was connected over USB...

  • Yes DrAzzy, I can send code to the board from the WebIDE and it does run, I guess I'm looking for help around how to implement some form of communication. Say I have some functions on the board, could I write a web app to call those functions? Just looking for a few ideas about how to interact with it rather than just send new code via Bluetooth.

  • @Coder20122012, take a look a the testing facility... even though it is for testing, it allows you to create a simple UI to send data to the board, trigger functions, and get values back displayed in timed graph. Check out the tours about testing and this post.

  • @Coder2012, take a look a the testing facility... even though it is for testing, it allows you to create a simple UI to send data to the board, trigger functions, and get values back displayed in timed graph. Check out the tours about testing and this post.

  • @allObjects personally I think that's just complicating matters.

    @Coder2012 Basically you have the 'console' - the thing on the Espruino that lets you enter code on the left-hand side of the Web IDE. When you're connected to a PC via USB, it's moved to USB, and when you're not it's moved to Serial1 (bluetooth).

    You can force it to be on one or the other using the commands Serial1.setConsole(); or USB.setConsole();.

    So now, the thing that really messes you up: When the console is on a device (like Serial1), the on('data',...) handler doesn't work.

    For what you want, I'd suggest you actually just use everything the console gives you. So, if you've written a bunch of functions then you can just execute one of them by sending the text myFunction(some,args);\n.

    When you do that you'll get the characters you send echo'd back to you, but you can fix that by sending echo(0)\n - you need to send 1 to turn echo back on though.

    Hope that helps!

  • This is fantastic, I downloaded Blue Term+ for my Android phone. Now I can just call functions on my Espruino from my phone.

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

Bluetooth module

Posted by Avatar for Coder2012 @Coder2012

Actions