Avatar for enaon

enaon

Member since Aug 2020 • Last active Apr 2024
  • 4 conversations
  • 65 comments

Most recent activity

  • in Projects
    Avatar for enaon

    So maybe GC is not done or other intervals may not run (pinging watchdog in this case) etc?

    nice, most probaby this was the case, I do have a watchdog that only needs 5 secs to fire, because the button on the dsd6 resets every 6 seconds or so, and I want to trigger it manually if needed.

    • 40 comments
    • 1,395 views
  • in Projects
    Avatar for enaon

    Thanks, but I wouldn't worry - it's older firmware so it'd be hard for me to track down here (it could already be fixed if it is an issue). Glad you found a way around it though!

    nice, yes fanoush's solution sound fine, I will try it next time I want to use the puck.js script. I had one more problem with it though, in your git example there was not a disconnect on lost signal event, it was not disconnecting when signal was lost, so I used the google way to be sure, disconnect due to low signal works fine with the google example. Next time I will ask for info :)

    this is what I am using now
    https://github.com/enaon/sCat-a/blob/910­9221dd977e7d7467cf9cbc1442445a11c7e53/in­dex.html

    it is served from github from this page.
    https://enaon.github.io/sCat-a/

    sCat-a in greek sounds like shit, poop etc, in case someone wonders about the name :)

  • in Projects
    Avatar for enaon

    So is it that problem? That sounds a lot more serious than just a delay to me...

    I believe so, I was able to make the dsd6 run slower just by making the signal worse, and eventually it was rebooting when using puck.js.com script. But I did not want the cli to be exposed anyway, so the NRF.updateServices solution is better in any case for real use, I did not investigate further. I can try something if you like though, I have a nice visual feedback of the delays to reboot sequence, the ball moves slower and then stops :)

    but I do not have the probem anymore, the NRF.updateServices way solved it for me.

  • in Projects
    Avatar for enaon

    this is a run cycle I just recorded, I like your tiny dash :)

    when it starts the empty cycle, the main gauge goes from powerbank battery reporting to ball placement reporting, you can see the empty cycle movement. Thanks again

    https://www.youtube.com/watch?v=mo4dGIFl­VFU

  • in Projects
    Avatar for enaon

    Oh, ok - well that's expected I think. It's not really a crash.

    nice, yes that is was I understood was happening, I was overdoing it, was gettting greedy because I was playing with your tiny dash and it was fun :)

    thanks, sory for not making my self clear, it is not a problem for me, I actually swiched to running NRF.updateServices 16 times per 1 sec, one variable after the other, and only send the ones I want to be instant every 100ms, while running all the rest of the code for the toilet empty cycle, and your amazing software is not breaking a sweat on the dsd6 :)

    https://github.com/enaon/sCat-a/blob/910­9221dd977e7d7467cf9cbc1442445a11c7e53/ap­p/main.js#L16

  • in Projects
    Avatar for enaon

    I will make an example and will upload a link so that you can both test if you like, it is easier, sory for the long posts.

  • in Projects
    Avatar for enaon

    I used the code Gordon has here(*), the write command I was sending to espruino for the loop was this one insted of the one on the example, so it was quite big, not as big as it looks ofcource, I was just returning the id and numbers,a json, but is was not a problem at all if the signal was ok, the script (http://www.puck-js.com/puck.js) was handling it nicely, only when signal was near lost the dsd6 was rebooting. 150 ms interval.

    if you use this github example on a phone with an espruino device, and add some code so that you can see a led go on and off at every interval run on the device, you will see it blinking slower as you make the make the signal worse. If not, then it is strange, maybe it is an older problem, but it sounds strange that it not known, even if solved.

    connection.write(
            "lal=setInterval(function(){Bluetooth.pr­intln(JSON.stringify({dt:Date().toString­().split(' ')[4],uv:scata.state.def.auto.uvc,ps:sca­ta.state.is.sys.pause,bs:scata.state.is.­sys.busy,db:scata.state.def.is.dbg,ac:sc­ata.state.def.auto.clean,ad:scata.state.­def.auto.delay,rtod:scata.state.is.sys.r­un,pos:scata.state.is.pos.ball,pwr:scata­.state.is.sys.pwr,lit:scata.state.is.vol­t.litres,pbv:ew.is.ondcVoltage(),ss:scat­a.state.def.sandType[scata.state.def.is.­sand].speed,sp:scata.state.def.is.sand,c­b:ew.is.batt(),pb:ew.is.ondcVoltage(1)})­);},150);NRF.on('disconnect', function() {clearInterval(lal)});\n",
    

    (*)https://github.com/espruino/EspruinoDocs­/blob/master/tutorials/Web%20Bluetooth%2­0Dashboard.md#realtime-dashboard

  • in Projects
    Avatar for enaon

    I will try if you cannot replicate it there, the version on dsd6 indeed only has standard BT packet length, but if the signal is good, it works fine for days connected. I only realized because I was getting random reboots, and could not figure out why. It turns out, I was not closing the connection from the phone, and when I was moving a floor down the toiler that was upstairs was rebooting :)

    I can demonstrate it for you if you like, I was able to make the empty cycle run slower just by placing the phone between my legs so that the signal got worse.

    I swiched to using characteristics and standard web bluetooth connection, and the problem is gone now for me, but I will make a small video if you believe it is usefull. If you are sure it does not affect newer vesions, then it is not problem.

  • in Projects
    Avatar for enaon

    my bad, I wrote puck.js, I meant http://www.puck-js.com/puck.js, the script for communications you offer.

    there is a loop locking problem for sure, I have verified it using espruino 2.14 on the p8 watch, I will try to explain better.

    when using the code on this example* for communicating from a web page to an espruino device, two way comms, say sending from the device to a web page a string 40(so that the info gets split on 2 or more packets) characters long every 200ms, all is fine as long as the signal is strong. When the bt signal goes low or near lost, the espruino device reboots. You can verify it very easily, just have a led blink on every loop on the device, and force a bad signal on the phone running the web page. You will notice that the led blinks slower as signal gets worse, and eventually a reboot will follow.

    I used characteristics and all is ok for me now, just reporting it in case you want to test.

    *(https://github.com/espruino/EspruinoDocs­/blob/master/tutorials/Web%20Bluetooth%2­0Dashboard.md#realtime-dashboard)

Actions