Avatar for Abhigkar

Abhigkar

Member since Dec 2017 • Last active Oct 2020
  • 21 conversations
  • 106 comments

Love Esp

Most recent activity

    • 4 comments
    • 41 views
  • in Bangle.js
    Avatar for Abhigkar

    Sorry for typo.. I mean setScan(). I understand why microbit is not appearing. Now I can see the device are coming in scan results.

  • in Bangle.js
    Avatar for Abhigkar

    I understand it now. Just a quick question..

    How can u save a single function in flash? Write a module??? Or in bootcde bootrst file?

  • in Bangle.js
    Avatar for Abhigkar

    Hi,

    I have 4 diffetent types of image data. 3 of them are in SVG format and one is in bitmap. I have converted SVG->BangleJS using this, and Bitmap->BangleJS using this

    1- Bitmap

    var img =
    require("heatshrink").decompress(atob("o­NDyBC/AH4A/AH4A/AH4A/AH4A/AGlVnltzpD/AG8­87gBLJv4Avtu9P5oBDqs8Kv4AFqtcon8sudf9oBH­Pf4ABst9Jsp/VQf5/CvhNnQP7/hJ76BZrtcP/6Dj­st8QLK1ZADtdKbQvTFrNdnh/0rjTbQaavtAD9Vnh­/dK6aB/P75hTQcp/xpp/UMKo5NtudEKJNBP+EcM7­bhhf/9E/hjfDp4xBY6tlvp9xP8aDTNOYAVPqJdXQ­P4AVtudP86DPPP7XVLMJ//QMJP/AGNVnh//AH4AB­Po9NjhJ/AHdt3o31rt8PP4A9P4M87hD/P/6B/P/6­B/P/6B/P/6B/AHp/JALZl/QP6D/MpKB7pscP/6DX­QM9dviB/Qa6BnP/JjRD57dBPr9lvp/7cqZP9Qf6D­/Qf6D/ONqD/P/6D/P/6D/P/6D/P/5hdQf5//Qf5/­/Qf5//Frdlvh//P9dVngtRpscP/5/pFaIBDtu9P/­5/lPqqxdP/59jP/5NjPrdtzp//P79Nnh9ZrtcPvZ­/lPrKZBPvp/9on8Pv5/lQK57/P9InpP/5XZrt8Pv­4ATtuda9dlvojFsudO/4AJP9YA/ACttzp//AH4AB­P/4A/AAdtzp9Bst8Iv4A/AH4A/AH4A5"));
    

    2- SVG - Int Array

    var polyImg = [
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("PQg9Czs­NOA82DzMOMA0vCi4ILwUxAjMBNgA5ATsCPQU9CA=­=")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("KxMsECs­OIQQeAxsEDxEOEw8WEhcUFh4LJhMoFCsT")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("OhwuHC4­VKBwoICkhKiI6IjwhPR88HToc")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("ATwEPQY­8GSkUJAE3ADoBPA==")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("Hx4cHRo­eGCEaIyMtGDMWNRY4GTobOSoxLC4rKw==")))},
      {fill: "#3d9ae2", points: new Uint8Array(E.toArrayBuffer(atob("")))}
    ];
    

    2- SVG Float32 array

    var polyImgF = [
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("NlB1Q­lon8kAf4XJC8VYoQWL1a0ISz09BkLhhQiAfaUFbg­VdCG09wQVCwS0LAkmZBUNJBQsrjSkFvfjtCg/AhQ­X+yOUJaJ/JAgiE8QgSfk0AfDUNCDl4JQO9JTULSf­xA/W4FXQoYf7D0sUmNCrUQ5PzQwbULyCh1AN4RzQ­vlroEA2UHVCWifyQA==")))},
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))}­,
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("jgQrQ­m9BlUEUSC9C1qp+QfEKK0LgRVhBBNgFQnD0hkCjI­PJBMbQ+QFCP20FAHYdAgDxvQWO4hUFbWV5B6o6bQ­eJ4b0Hf1q5B+JKNQXJIt0FzxaBBK86uQVKl80GZ3­DdBlYAWQiNKlUFfayFCtrudQY4EK0JvQZVB")))}­,
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))}­,
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("2IloQ­n5a3kF/sjlCflreQX+yOUIGQatBwyUgQn5a3kHEJ­SBCWjkAQp40IkIgwwVCAqooQvu5CEJDj2hC+rkIQ­mOZcUL09ARCNVB1QmXc90Evi3FCJMjlQdiJaEJ+W­t5B")))},
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))}­,
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("yv+HP­xp7cULMbHNA1b11QnKCxkB9gXFCnTnJQf20JUL9G­KBBNiURQq90hz+J9VxCrpSBOyXhZ0LK/4c/GntxQ­g==")))},
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))}­,
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("Bo/1Q­d7K8kFFp99Bak3qQZ5kzEGZ0/JB4O/DQZRZBEJVb­cxB0PYNQjWJC0IHRDNCPnC8QWhqS0LN3K5BPDVUQ­gvbskEgQWBCzsHFQZIuZ0IrhdpBnpllQuWBKEIXf­UVCD+kwQv3yOELUECxCBqsqQg==")))},
      {fill: "#3d9ae2", points: new Float32Array(E.toArrayBuffer(atob("")))}­
    ]; 
    

    3- Regular Array

    var polyImg = [
      {fill: "#3d9ae2", points: [61.328,7.567,60.72,10.521,58.99,12.988,­56.43,14.57,53.876,15.019,50.922,14.411,­48.455,12.681,46.873,10.121,46.424,7.567­,47.033,4.613,48.763,2.146,51.322,0.564,­53.876,0.115,56.83,0.724,59.297,2.454,60­.879,5.013,61.328,7.567]},
      {fill: "#3d9ae2", points: []},
      {fill: "#3d9ae2", points: [42.754,18.657,43.82,15.917,42.761,13.51­7,33.461,4.217,30.266,2.98,27.445,4.222,­14.952,16.715,13.897,19.445,14.967,21.85­5,17.697,22.91,20.096,21.851,30.456,11.4­91,37.626,18.661,40.355,19.717,42.754,18­.657]},
      {fill: "#3d9ae2", points: []},
      {fill: "#3d9ae2", points: [58.135,27.794,46.424,27.794,46.424,21.4­07,40.037,27.794,40.037,32.056,40.551,33­.441,42.166,34.182,58.14,34.182,60.4,33.­239,61.328,30.983,60.386,28.723,58.135,2­7.794]},
      {fill: "#3d9ae2", points: []},
      {fill: "#3d9ae2", points: [1.062,60.37,3.804,61.435,6.203,60.376,2­5.153,41.427,20.012,36.286,1.058,55.24,0­.004,57.97,1.062,60.37]},
      {fill: "#3d9ae2", points: []},
      {fill: "#3d9ae2", points: [30.695,30.349,27.957,29.288,25.549,30.3­53,24.492,33.087,25.553,35.491,34.884,44­.816,23.555,50.854,21.858,53.052,22.357,­56.064,24.72,57.795,27.315,57.4,42.127,4­9.372,44.228,46.237,43.016,42.667]},
      {fill: "#3d9ae2", points: []}
    
    

    My question is, what would be the best option to save RAM considering I am storing the image data in files and reading then using Storage module. I know that option 1 is not the best one but I just listed because I have it.

    I am getting the best rendering output when using Option 1 or 2

  • in Bangle.js
    Avatar for Abhigkar

    Hi @NebbishHacker, How about compress the output using heatshrink??

  • in Bangle.js
    Avatar for Abhigkar

    I see the device name with NRF.findDevice() and setConnect() sometimes but not always.

  • in Bangle.js
    Avatar for Abhigkar

    I am scanning BLE peripheries using NRF.findDevices() /NRF.requestDevice() calls. None of the methods returning the local-name/ name of the discovered devices.

    I am using latest BangleJS firmware V.08

    NRF.findDevices(function(devices) {
    :  console.log(devices);
    :}, 1000);
    =undefined
    [
      BluetoothDevice: {
        "id": "1d:0d:90:b3:74:f1 private-nonresolvable",
        "rssi": -55,
        "data": new Uint8Array([24, 255, 6, 0, 1, 9, 33, 10, 80, 19, 206, 177, 8, 16, 65, 66, 72, 73, 78, 65, 86, 45, 80, 67, 56]).buffer,
        "manufacturer": 6,
        "manufacturerData": new Uint8Array([1, 9, 33, 10, 80, 19, 206, 177, 8, 16, 65, 66, 72, 73, 78, 65, 86, 45, 80, 67, 56]).buffer
       },
      BluetoothDevice: {
        "id": "f0:d1:ff:48:71:b7 random",
        "rssi": -56,
        "data": new Uint8Array([2, 1, 6, 3, 3, 170, 254, 21, 22, 170, 254, 0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]).buffer,
        "services": [
          "feaa"
         ],
        "serviceData": {
          "feaa": new Uint8Array([0, 246, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]).buffer
         }
       }
     ]
    > 
    

    But my device is advertising the name. I can see in noble.js scan output

      id: 'f0d1ff4871b7',
      uuid: 'f0d1ff4871b7',
      address: 'f0:d1:ff:48:71:b7',
      addressType: 'random',
      connectable: false,
      advertisement:
       { localName: 'BBC micro:bit [zevov]',
         txPowerLevel: undefined,
         manufacturerData: undefined,
         serviceData: [ [Object] ],
         serviceUuids: [ 'feaa' ],
         solicitationServiceUuids: [],
         serviceSolicitationUuids: [] },
      rssi: -30,
      services: null,
      state: 'disconnected' }
    Peripheral {
      _noble:
       Noble {
         initialized: true,
         address: '00:1a:7d:da:71:13',
         _state: 'poweredOn',
         _bindings:
          NobleBindings {
            _state: 'poweredOn',
            _addresses: [Object],
            _addresseTypes: [Object],
            _connectable: [Object],
            _pendingConnectionUuid: null,
            _connectionQueue: [],
            _handles: {},
            _gatts: {},
            _aclStreams: {},
            _signalings: {},
            _hci: [Hci],
            _gap: [Gap],
            _events: [Object],
            _eventsCount: 21,
            onSigIntBinded: [Function: bound ],
            _scanServiceUuids: [] },
         _peripherals:
          { '1d0d90b374f1': [Peripheral],
            f0d1ff4871b7: [Peripheral],
            cf937c826f4b: [Circular] },
         _services: { '1d0d90b374f1': {}, f0d1ff4871b7: {}, cf937c826f4b: {} },
         _characteristics: { '1d0d90b374f1': {}, f0d1ff4871b7: {}, cf937c826f4b: {} },
         _descriptors: { '1d0d90b374f1': {}, f0d1ff4871b7: {}, cf937c826f4b: {} },
         _discoveredPeripheralUUids: [ '1d0d90b374f1', 'f0d1ff4871b7', 'cf937c826f4b' ],
         _events:
          [Object: null prototype] {
            warning: [Function: bound ],
            newListener: [Function: bound ],
            stateChange: [Function],
            discover: [Function] },
         _eventsCount: 4,
         _allowDuplicates: undefined },
      id: 'cf937c826f4b',
      uuid: 'cf937c826f4b',
      address: 'cf:93:7c:82:6f:4b',
      addressType: 'random',
      connectable: true,
      advertisement:
       { localName: 'DS-D6 6f4b',
         txPowerLevel: undefined,
         manufacturerData: undefined,
         serviceData: [],
         serviceUuids: [ '6e400001b5a3f393e0a9e50e24dcca9e' ],
         solicitationServiceUuids: [],
         serviceSolicitationUuids: [] },
      rssi: -86,
      services: null,
      state: 'disconnected' }
    
    

    I dont have a clue!! I want to show the name of the device in search so that I can select the device based on name.

  • in General
    Avatar for Abhigkar

    I found answer here

Actions