Avatar for migsanvi

migsanvi

Member since May 2019 • Last active Jun 2019
  • 3 conversations
  • 15 comments

Most recent activity

    • 22 comments
    • 453 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for migsanvi

    Hi @Gordon!

    This morning (sorry for the delay!), I have loaded the firmware espruino_2v03.20_puckjs.zip into my Puck.js.

    >reset(true);
    Erasing saved code.
    Done!
    =undefined
     ____                 _
    |  __|___ ___ ___ _ _|_|___ ___
    |  __|_ -| . |  _| | | |   | . |
    |____|___|  _|_| |___|_|_|_|___|
             |_| espruino.com
     2v03.20 (c) 2019 G.Williams
    >
    

    This is the output with the new version:

    NRF ERROR 0x3202 at targets/nrf5x/bluetooth.c:1957
    REBOOTING.
    NRF ERROR 0x3202 at targets/nrf5x/bluetooth.c:1957
    REBOOTING.
    NRF ERROR 0x3202 at targets/nrf5x/bluetooth.c:1957
    REBOOTING
    

    I hope it works.

    Thanks for your support and the inconvenience

  • in General
    Avatar for migsanvi

    Hi at all!

    The following program has a button connected to pin D25 (MDBT42Q firmware 2v03). When the button is pressed, the "volumeUp" command is sent to the device connected by BLE. Only when button is pressed.

    I have tried the program in both Puck.js and MDBT42Q.

    var controls = require("ble_hid_controls");
    
    // Clean all previous watches
    clearWatch();
    
    // Configure PIN D25 with internal pulldown resistence
    // Wiring to VCC.
    pinMode(D25, "input_pulldown");
    
    NRF.setServices(undefined, {hid: controls.report});
    
    setWatch(function (ptt) {
      if (ptt.state) {
        LED.set();
        NRF.sendHIDReport(32, () => {});
      } else {
        LED.reset();
        NRF.sendHIDReport(0, () => {});
      }
    }, D25, {edge: "both", debounce: 50, repeat: true});
    

    However, when loading the code with WebIDE with the option of "Minification" Esprima (offline) an error occurs when the button is pressed for the first time. The program keeps sending the "volumeUp" command continuously.

    This is the minimized code that returns dump ():

    // Code saved with E.setBootCode
    Modules.addCached('ble_hid_controls','fu­nction b(a,b){NRF.sendHIDReport(a,function(){NR­F.sendHIDReport(0,b)})}exports.report=ne­w Uint8Array([5,12,9,1,161,1,21,0,37,1,117­,1,149,5,9,181,9,182,9,183,9,205,9,226,1­29,6,149,2,9,233,9,234,129,2,149,1,129,1­,192]);exports.next=function(a){b(1,a)};­exports.prev=function(a){b(2,a)};exports­.stop=function(a){b(4,a)};exports.playpa­use=function(a){b(8,a)};exports.mute=fun­ction(a){b(16,a)};exports.volumeUp=funct­ion(a){b(32,a)};exports.volumeDown=funct­ion(a){b(64,a)}');var controls=require('ble_hid_controls');cle­arWatch(),pinMode(D25,'input_pulldown'),­NRF.setServices(undefined,{hid:controls.­report}),setWatch(function(a){a.state?(L­ED.set(),NRF.sendHIDReport(32,()=>;)):(L­ED.reset(),NRF.sendHIDReport(0,()=>;));}­,D25,{edge:'both',debounce:50,repeat:!0}­);
    

    For now, the size of the code is not a problem but I would like to apply the best possible optimization.

    Any ideas?

    Thanks in advance

  • in Puck.js, Pixl.js and MDBT42
    Avatar for migsanvi

    Hi @Gordon!

    For my part, there's no problem. If you give me a binary to load that gives us more information, I could load it and pass on the data you need.

    Thank you!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for migsanvi

    Hi @Gordon,

    The TELO580 is not a device purchased directly from the factory and I'm not sure the manufacturer will personalize a firmware ...

    A question. Why does the first time connect correctly and the error only occurs when the Puck.js is restarted? Does not the MAC check the first time?

    Thanks,

  • Avatar for migsanvi

    Hi @Gordon,

    Yes, you're right. The rush is not good... (Spanish expression: "Las prisas no son buenas"). Sorry...

    The result of the code above is as follows:

    >console.log(devices);
    [
      "e4:b3:18:0b:a6:de public",  <-- PC
      "28:43:68:5e:7a:8a",               <-- TELO580
      "e4:b3:18:0b:a6:de public",  <-- PC
      "28:43:68:5e:7a:8a",               <-- TELO580
      "e4:b3:18:0b:a6:de public",  <-- PC
      "36:35:66:a1:6d:c9",               <--TELO580 (Bluetooth off and then on)
      "e4:b3:18:0b:a6:de public", <-- PC
      "12:ca:65:a3:45:24",               <--TELO580 (Bluetooth off and then on)
    ]
    =undefined
    

    When the TELO bluetooth is turned off and on again, the MAC changes, although none of them is the real one (real MAC of TELO: 7e:eb:46:03:35:1c).

    Thanks!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for migsanvi

    Hi @Gordon,

    Are you sure the code posted right at the beginning is the only code running on your device?

    Yes, I'm sure. I have to do a hard-reset every time the code is loaded, I connect the TELO and the Puck.js is restarted.

    When a hard-reset has been performed, the code that shows me dump() is as follows:

    > dump()
    digitalWrite(D18,0);
    =undefined
    >
    

    On the other hand, I have loaded the following code to see the MAC address of the TELO:

    devices = [];
    NRF.on('connect',function(addr) {
      devices.push(addr);
    });
    

    After connecting twice, this is the result ("e4:b3:18:0b:a6:de public" is the MAC of my PC). The other MACs correspond to TELO. It seems that they are random values...

    Thanks!

  • in Puck.js, Pixl.js and MDBT42
    Avatar for migsanvi

    Hello @Gordon,

    I have received the USB-TTL converter and I have connected it to the Puck.js

    This is error:

    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    NRF ERROR 0x3202 at ?:0
    REBOOTING.
    ....
    

    I hope you can help me,

  • in Puck.js, Pixl.js and MDBT42
    Avatar for migsanvi

    Hello @Gordon,

    I am testing with two devices. The first, is a Samsung Galaxy A5 (model 2015, Android 6.0) and with it, the Puck.js works perfectly.

    The second device is a particular device (Walkie-talkie) called TELO 580 built in Android 5.1. This is my production device and with itconnected, when the battery is removed, the error occurs.

    Yesterday I bought an USB-TTL converter and today, when it arrives, I will test the Puck.js and I write the result.

    Thanks for you dedication.

Actions