You are reading a single comment by @ChristianW and its replies. Click here to read the full conversation.
  • As already mentioned here I try to develop a kind of BLE based race track lap counter .

    The base station is a MDBT42s with external antenna, big LIPO batteries, a LCD, a few buttons, a piezo buzzer and a RGB LED.
    The transponders are just Puck.js devices advertising at the highest rate.

    The Puck/transponder code is quite simple: flash a LED once in a while to show it's active, detect keypress > 2 s for switching on/off

    The MDBT42s/tracker code has gotten quite complex:

    • scan for transponders in range
    • monitor RSSI values and detect out-of-range (timeouts)
    • count lap when RSSI reaches a certain threshold
    • display various status pages (Laps, RSSI, RX counter, Battery)
    • log laps to array in RAM

    Basically everything works, but after running a certain time/detecting some dozen laps everything freezes and things become quite unstable:

    • keypresses are still handled (setWatch() handler causes a beep)
    • display update loop (setInterval() seems stuck, connecting to the console and just once calling the display handler function seems to cure the setInterval() loop again
    • connecting the terminal via BLE after this stuck situation lasts forever

    process.memory().free still shows ~390 when this happens, so I don't thinks this is a memory issue.

    I have uploaded the current code.
    Maybe someone has some pointers or an idea what might go wrong here.

    The code is capsulated into classes with either dynamic or static methods, maybe some of this was not a good idea?


    2 Attachments

About

Avatar for ChristianW @ChristianW started