• Hi, sometimes when i want to upload buffer code to puck.js, it stuck in middle of uploading.
    I use noble.js, i connect to the puck then convert the code splitted every 19 bytes to write each splitted code to puck.
    Sometimes the uploads stop and i cannot reconnect to the puck , i must force reset it to be able to reconnect..

    sample code :

    0|server   | Sending block "clearInterval();cle", wait 50ms
    0|server   | buffer :  <Buffer 63 6c 65 61 72 49 6e 74 65 72 76 61 6c 28 29 3b 63 6c 65>
    0|server   | Sending block "arWatch();var press", wait 50ms
    0|server   | buffer :  <Buffer 61 72 57 61 74 63 68 28 29 3b 76 61 72 20 70 72 65 73 73>
    0|server   | Sending block "es=0;\nsetWatch(func", wait 50ms
    0|server   | buffer :  <Buffer 65 73 3d 30 3b 0a 73 65 74 57 61 74 63 68 28 66 75 6e 63>
    
    

    i have tested with a delay of 100ms and it change nothing..

    when the upload works :

    0|server   | Sending block "clearInterval();cle", wait 50ms
    0|server   | buffer :  <Buffer 63 6c 65 61 72 49 6e 74 65 72 76 61 6c 28 29 3b 63 6c 65>
    0|server   | Sending block "arWatch();var press", wait 50ms
    0|server   | buffer :  <Buffer 61 72 57 61 74 63 68 28 29 3b 76 61 72 20 70 72 65 73 73>
    0|server   | Sending block "es=0;\nsetWatch(func", wait 50ms
    0|server   | buffer :  <Buffer 65 73 3d 30 3b 0a 73 65 74 57 61 74 63 68 28 66 75 6e 63>
    0|server   | Sending block "tion(){\nif(presses ", wait 50ms
    0|server   | buffer :  <Buffer 74 69 6f 6e 28 29 7b 0a 69 66 28 70 72 65 73 73 65 73 20>
    0|server   | Sending block "> 100){presses=0;}\n", wait 50ms
    0|server   | buffer :  <Buffer 3e 20 31 30 30 29 7b 70 72 65 73 73 65 73 3d 30 3b 7d 0a>
    0|server   | Sending block "presses++;\nLED2.res", wait 50ms
    0|server   | buffer :  <Buffer 70 72 65 73 73 65 73 2b 2b 3b 0a 4c 45 44 32 2e 72 65 73>
    0|server   | Sending block "et();\nLED3.reset();", wait 50ms
    0|server   | buffer :  <Buffer 65 74 28 29 3b 0a 4c 45 44 33 2e 72 65 73 65 74 28 29 3b>
    0|server   | Sending block "\nNRF.setAdvertising", wait 50ms
    0|server   | buffer :  <Buffer 0a 4e 52 46 2e 73 65 74 41 64 76 65 72 74 69 73 69 6e 67>
    0|server   | Sending block "({},{manufacturer:0", wait 50ms
    0|server   | buffer :  <Buffer 28 7b 7d 2c 7b 6d 61 6e 75 66 61 63 74 75 72 65 72 3a 30>
    0|server   | Sending block "x0590,manufacturerD", wait 50ms
    0|server   | buffer :  <Buffer 78 30 35 39 30 2c 6d 61 6e 75 66 61 63 74 75 72 65 72 44>
    0|server   | Sending block "ata:[presses]});\n},", wait 50ms
    0|server   | buffer :  <Buffer 61 74 61 3a 5b 70 72 65 73 73 65 73 5d 7d 29 3b 0a 7d 2c>
    0|server   | Sending block "BTN,{edge:'rising',", wait 50ms
    0|server   | buffer :  <Buffer 42 54 4e 2c 7b 65 64 67 65 3a 27 72 69 73 69 6e 67 27 2c>
    0|server   | Sending block "repeat:1,debounce:5", wait 50ms
    0|server   | buffer :  <Buffer 72 65 70 65 61 74 3a 31 2c 64 65 62 6f 75 6e 63 65 3a 35>
    0|server   | Sending block "0})\nLED1.set()\nsetT", wait 50ms
    0|server   | buffer :  <Buffer 30 7d 29 0a 4c 45 44 31 2e 73 65 74 28 29 0a 73 65 74 54>
    0|server   | Sending block "imeout(function(){L", wait 50ms
    0|server   | buffer :  <Buffer 69 6d 65 6f 75 74 28 66 75 6e 63 74 69 6f 6e 28 29 7b 4c>
    0|server   | Sending block "ED1.reset()},2000)\n", wait 50ms
    0|server   | buffer :  <Buffer 45 44 31 2e 72 65 73 65 74 28 29 7d 2c 32 30 30 30 29 0a>
    0|server   | Sending block "save()", wait 0ms
    0|server   | buffer :  <Buffer 73 61 76 65 28 29>
    

    the full javascript code :

      clearInterval();clearWatch();var presses=0;\nsetWatch(function(){\nif(presses > 100){presses=0;}\npresses++;\nLED2.reset();\nLED3.reset();\nNRF.setAdvertising({},{manufacturer:0x0590,manufacturerData:[presses]});\n},BTN,{edge:'rising',repeat:1,debounce:50})\nLED1.set()\nsetTimeout(function(){LED1.reset()},2000)\nsave()
    
    

    Thank You!

About

Avatar for Christof550 @Christof550 started