Hub SDK IR Module not playing



  • I'm trying to get a custom module to play IR. Starting off with a few general headaches from trying;

    1. It's pretty weird that you can't access the already stored IR-signals.
    2. Even if recording specifically for my module theres really no good way of storing it for when the module restarts. Storing Uint32Array as a string is a nightmare.
    3. I can't get it to play even a Uint32Array thats JUST got recorded. Even though I can see that it got recorded OK.
    ir.record();
    
    ir.on("recordComplete", function(signal) {
    	console.log(signal[0]);
    	setTimeout(function() {
    		console.log(signal[0])
    		ir.play(signal, function(err) {
    			console.log(err); //never called
    			console.log("played!"); //never called
    		});
    	}, 1000);
    });
    

    Console never writes out any err or played!. No IR is sent from the sender. However, i can tell that signal[0] is the same so it's actually trying to run play for the correct array.

    There is no new record ongoing, I've even tried to run the stopRecording before .play() without any difference.

    Any idea of why my .play() won't work?

    I've also noticed that the console prints Connected: 0 when recoding starts and when .play()is called. Related?



  • @Emil
    Did the record part work all the time, while the playing part failed all the time? Yes.

    Are you using the 1st hub generation or the 2nd (Hub LR)? 2nd.

    But my bet is that I might have sent in some bad Array while testing that made the IR-queue never emptying/play never ending? Maybe.


  • FlicTeam

    Did the record part work all the time, while the playing part failed all the time?

    Are you using the 1st hub generation or the 2nd (Hub LR)?



  • @oskaremilsson It really seems like I've in my very many attempts to get this to work queued up the IR-queue too much, when it didn't work from the app either I restarted the hub. And now this snippet works.

    So now the question would be, is there any way of clearing the queue except restarting the hub?


Log in to reply