Usage of a device running Espruino

Posted on
  • Dear all,
    I am using a RAK8212 board with Espruino. When the board is connected over BLE to the Espruino IDE, the device works(I receive messages on my UDP server from the device), while when I disconnect I dont receive any messages. The device is powered by a LiPo battery pack . The onInit() function has been implemented and also the save() command was issued at the beginning of the program(once after the flashing of the code). Any idea why this happens?

    Thank you in advance!

  • You might want to take a look at http://www.espruino.com/Troubleshooting+BLE#my-code-works-when-i-m-connected-via-bluetooth-but-stops-when-i-disconnect

    Bluetooth.setConsole(true) in onInit should fix it for you though.

  • Thank you very much Gordon, I have a 10 minute interval and even with the Bluetooth.setConsole(true) in onInit, the problem exists, is there any limitation on espruino about the time of intervals, etc?

  • Hi,

    There shouldn't be an issue with intervals at all - you can do them years in advance.

    If you connect via Bluetooth at a later point, does it then start working again?

    You could try:

    var log = "";
    LoopbackB.on('data',function(d) { log = (log+d).substr(0,1000); });
    LoopbackA.setConsole();
    

    And then you can connect at some point later on and do print(log) - it'll then show you any messages that were written to the console while you were disconnected. It might give you a hint what's going on?

    You can also use software serial on Espruino v2:

    var s = new Serial();
    s.setup(9600,{tx:D10})
    LoopbackB.on('data',function(d) {s.write(d); });
    LoopbackA.setConsole();
    

    It's still a bit beta, but might be good enough for you to get realtime info on what's going on despite only having one serial port (which I guess you're using).

  • I have the RAK8212 working fine whilst having the bluetooth disconnected.
    Bluetooth.setConsole(true) was the secret for me.

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

Usage of a device running Espruino

Posted by Avatar for user94721 @user94721

Actions