Avatar for JumJum

JumJum

Member since Oct 2013 • Last active Apr 2021
  • 151 conversations
  • 770 comments

Most recent activity

    • 9 comments
    • 346 views
  • in Puck.js, Pixl.js and MDBT42
    Avatar for JumJum

    got it running at the end (HIP HIP HURRAY)
    IMHO at the end its all about PYTHON version hell. No idea, why python3.6 did not accept nrfutil 6.1.0. Testing with TensorFlow and Opencv might have been the root of problems
    I'm pretty sure people with more knowhow around python could explain. People like me, that want to compile Espruino only, have to walk through dessert to find some water_

    This is my way to find water:

    • installed python3.8
    • added an alias for python to python3.8 in .bashrc for user espruino
    • logged out and logged in again
    • installed pip with python -m pip install pip did this because pip before still pointed to python3.6. Therefore all installation had been done to .local/lib/python3.6
    • installed nrfutil with python -m pip install nrfutil
      now I've a folder ~/.local/lib/python3.8/site-packages.And­ nrfutil is installed in version 6.1.0
      Next switched to folder with Espruino-installation and called
    • RELEASE=1 DFU_UPDATE_BUILD=1 BOARD=MDBT42Q make >tmp/stdout 2>tmp/stderr
      and it worked fine. I've got my zip for uploading to MDB42Q board

  • Avatar for JumJum

    I used pip install nrfutil==5.2.0
    See https://pypi.org/project/nrfutil/#histor­y for more

    But as long as I don't get it running, I would not suggest to change provision.sh

  • Avatar for JumJum

    After doing some searching in the web, BTW I'm working with ubuntu 18.04.4 LTS
    Actual nrfutil version is 6, but with that I get errors around installing pc-ble-driver

    Figured out, that nrfutil V 5.22 can be installed.
    Actual installation according to pip list is

    .....
    .....
    nrfutil (5.2.0)
    ....
    ....
    pc-ble-driver-py (0.11.4)
    ....
    ....
    
    

    I've got an error and somewhere I found to do this

    export LC_ALL=C.UTF-8
    export LANG=C.UTF-8
    
    

    But now I'm running into problems inside py-sources.
    Sometimes life is not as friendly as it could be ;-(

  • Avatar for JumJum

    hmm, good point, I ran into several problems with python-version-hell in the past
    Hmm, I'm running python 3.6.9, and pip 9.0.1, will try with other versions

  • Avatar for JumJum

    I've tried to compile firmware for MDBT42Q.
    Installation of nrfutil, copied from provision.sh, fails.
    Any idea?

    sudo pip install --ignore-installed nrfutil
    ....
    ....
    Collecting pc_ble_driver_py>=0.14.2 (from nrfutil)
      Could not find a version that satisfies the requirement pc_ble_driver_py>=0.14.2 (from nrfutil) (from versions: 0.1.0, 0.2.0, 0.3.0, 0.4.0, 0.5.0, 0.6.0, 0.6.1, 0.6.2, 0.8.0, 0.8.1, 0.9.0, 0.9.1, 0.10.0, 0.11.0, 0.11.1, 0.11.2, 0.11.3, 0.11.4)
    No matching distribution found for pc_ble_driver_py>=0.14.2 (from nrfutil)
    
    
  • in JavaScript
    Avatar for JumJum

    At least in my test, it did not matter, writing data or an empty string.
    writing undefined or nothing gives an error, but, surprise,surprise, a file is created.
    @fanoush, Data cannot be overwritten, thats a good point. I did not read this before.
    BTW, try this:

    st.write("a","",0,10);
    =true
    >st.read("a");
    ="\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\x­FF"
    >st.readArrayBuffer("a");
    =new Uint8Array([255, 255, 255, 255, 255, 255, 255, 255, 255, 255]).buffer
    >st.write("a","AB",0);
    =true
    >st.read("a")
    ="AB"
    >st.readArrayBuffer("a");
    =new Uint8Array([65, 66]).buffer
    >st.write("a","CD",2);
    Uncaught Error: Too much data for file size
     at line 1 col 20
    st.write("a","CD",2);
                       ^
    >st.write("a",[66,67],2);
    Uncaught Error: Too much data for file size
     at line 1 col 23
    st.write("a",[66,67],2);
                          ^
    >st.read("a");
    ="AB"
    > 
    

    On the other hand, this works

    >st.write("a","abcd",0,10);
    =true
    >st.readArrayBuffer("a");
    =new Uint8Array([97, 98, 99, 100, 255, 255, 255, 255, 255, 255]).buffer
    >st.write("a","efg",4);
    =true
    >st.readArrayBuffer("a");
    =new Uint8Array([97, 98, 99, 100, 101, 102, 103, 255, 255, 255]).buffer
    >st.read("a")
    ="abcdefg\xFF\xFF\xFF"
    > 
    

    Anyway, it works for me now ;-)

  • in JavaScript
    Avatar for JumJum

    Supporting size again did not help.
    I've a different hack ;-)

    I'm using Storage to save some images data from GraphicsBuffer.
    Creating the file was seperated from writing data.

    //initialization of file storage
    var st = require("Storage");
    var fn = "b";
    st.write(fn,'X',0,1024);
    ......
    ......
    //write data to file
    for(y = 0; y < height; y++){
      st.write(fn,data_for_one_line,y * width);  // write one line of graphics data
    }
    

    My hack is to remove write in initialization, and add size to write of first line.

  • in JavaScript
    Avatar for JumJum

    My idea was to define a file in storage and use it free like this:

    var st = require("Storage");
    var fn = "b";
    st.write(fn,'X',0,20);
    print(st.read(fn));
    st.write(fn,[64,65,66],0);
    print(st.read(fn));
    

    This only works fine, if 2nd write does not use 0 for offset.
    Otherwise, size is reduced to data written. In this case 3, and not 20 as defined in first write.

Actions