Avatar for fanoush

fanoush

Member since Jul 2018 • Last active Sep 2020
  • 7 conversations
  • 422 comments

Most recent activity

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

    It's fine when you have several units with the same name, they have different mac addresses, like fitness devices etc etc. For normal use this is not a problem, the app will talk to the mac and not the name etc etc.

    The problem with the cache is during development and programming, if a device changes it name from the default to the production name iOS then shows the old name instead of the new name as the cache is not updated, after some time it does change over.

    The same kind of problem happens when starting new units that have the same name, as I did yesterday where all the units show up as DFUtag, but with new mac addresses one after another, within iOS it self there is no way to tell them apart and apps like LightBlue struggles with this as they try to connect by getting the mac from the cache based on the name.

    Well, those are two separate unrelated situations and issues. 1. Device with same MAC changing its properties (like name, services). 2. two different devices with different MACs but with same name. Not sure why you mix them together and call them to be same problem.

    issue #1 is some per device cache, issue #2 looks like some UI dialog or application issue that apps cannot enumerate over all known devices and pick the right one. Maybe for second issue this could help? https://www.businessinsider.com/how-to-c­hange-bluetooth-name-on-iphone

    as for issue #1 nordic solves it by changing mac address when device is switched to DFU mode, the MAC for DfuTarg device changes in last digit so it acts as different device.

    Somehow Nordic has found a way around this, so will have a look if they published the code for the DFU app and I can show that to our iOS developers on how to force iOS to do a refresh or how to go around the cache issue.

    https://github.com/NordicSemiconductor/I­OS-nRF-Connect (but no source?)

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

    The same problem happens when a device change its name, the old name is shown for a long time in iOS as it is in the cache.

    That's different problem. It can be understandable that iOS caches information for same mac address (name, available services).

    Caching by name (even when mac address is different) like you described in first post is completely unreasonable because you can have many devices with same name (two pieces of same thing - fitness tracker, watch, thermometer,...). If iOS really does that then well, seem quite unlikely, but OK, but still it is not the same issue at all.

  • in General
    Avatar for fanoush

    Maybe I am also missing something but these are not 'messages' and you are not 'sending' it. it is advertising which is set once but is advertised all the time every advertising interval even if puck sleeps. you could however set it to something else when button is released, but again it would be broadcasted all the time, that's what advertising is for, so that other devices can find it anytime. And rssi are not messages either, it is just current info/number about connection quality, nothing is sent.

  • in General
    Avatar for fanoush

    Well, yes, accesing array element directly by integer index would be needed here too.

    Not sure how fast it could be when compared to direct memory access and how much stuff needs to be exported to make it usable, when checking eg. source of E.crc32 it looks relatively easy. But when checking E.mapInPlace it can be seen there are quite a lot of methods for various types. Or in jswrap_graphics.c I see lot of usage of string iterator, also plenty of methods there.

    But you mentioned JsvIterator and looks like there is generic implementation wrapping those various types here src/jsvariterator.c#L649 so maybe it could be easy after all?

  • in General
    Avatar for fanoush

    That's what I use already but it needs flat string and direct memory pointer. What I was thinking was directly passing JsVar of type string or typed array and iterating over it inside inline c even if it not flat string. Not super important but would solve cases with fragmented memory when E.toString does not work.

    Like the sort case above, some smaller arrays are not allocated as flat buffers so to sort every array it needs some extra code like this or this

  • in General
    Avatar for fanoush

    best way would probably be to use a quicksort function in Inline C on the raw data in the Int16Array

    How would you iterate over array in inline C? Actually I'd love to pass typed array/arraybuffer or string to inline C and iterate over it to avoid flat strings. I know there is some stuff exported for compiled javascript but didn't know how to use it properly. I there any example? Tried to decipher some output of compiled javascript but it was too hard.

  • in Bangle.js
    Avatar for fanoush

    So get both :-) Bangle and then get also the SMA Q2 or DK08 too and see how far you can get with hacking it to do what you want :-) And maybe check also this thread http://forum.espruino.com/conversations/­342466/#15450049 there are some videos there too. Or search this forum for P8.

  • in Bangle.js
    Avatar for fanoush

    There are many hackable nrf52 watches like that. The Q2 was good but is hard to buy nowadays. Currrently good one is P8 (very similar to PineTime watch, full touchscreen) or DK08 if you prefer display like Q2 or there are many nrf52 based fitness trackers. Our latest hot tip now is the SMA B5 fitness tracker which includes GPS and has SWD pins on USB port (!) so it is unbrickable without any need to open it.

    As for the bangle firmware - bare Espruino itself is easy and is running fine on watches I mentioned (and on few other ones). But there you need to write your Watch app yourself in javascript from scratch (handling button(s), screen, touch, sensors).

    The bangle specific APIs and Apps on top of Espruino it is however different matter. For that I guess the best is to get real Bangle.

    So it depends on you if you want fully supported watch with best out of box experience and by getting it you also support Espruino project or you prefer to hack your custom stuff with many other nrf52 watches, that's OK too.

    To answer your question in topic name - yes it is perfectly possible but most probably you must do it yourself.

    And BTW technically this conversation does not belong to "Official Espruino Devices" subforum, any other subforum would be better choice.

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

    The New interpreter error: BUFFER_FULL means that your ESP32 feeds the output to MDBT42Q
    javascript interpreter console. as these are not javascript commands you should move console away.
    But perhaps the

    E.setConsole('Bluetooth',{force:true});
    Serial1.setup(115200, { tx:D6, rx:D8 });
    

    is too late and maybe will be always too late as the serial buffer will be filled with garbage sooner than those lines can run. Either there is a way to flush Serial1 somehow after you redirect console or maybe better is to simply use different pins.

    Serial can be on any pins you chose, so if you actually don't plan to use Serial1 as Espruino console you may setup it on any other pins so it does not interfere with expected Espruino console input at boot time. So connect ESP32 to pins e.g. D11,D12 and then setup serial as Serial1.setup(115200, { tx:D11, rx:D12 });

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

    I'm not sure what an active scan is.

    I tried to explain what it is in post #17 but no matter what exactly it is, you have used it if you added active:true to NRF. findDevices or NRF.setScan as an extra option. Default is false so you probably did not use it.

Actions