B4R Question IRSend and SendRaw (greater than 100 codes)


Active Member
Licensed User
Longtime User
I have a project and sketch that I'm looking to convert to a B4R project. My project is based on the NodeMCU 12e (so an ESP8266) and records IR signals in raw mode and can play them back. I can actually pass the raw code string (delimited by commas) via a http call to my NodeMCU and it will parse it and replay. I ended up using raw codes because there was a particular remote used by Comcast/Xfinity cable company in the US that can't be read by the standard IR read methods - it just doesn't work (in case anyone is wondering it's an XR2 remote). Using a good quality IR receiver (from Vishay) and this great sketch from the Analysis IR site I was able to read the raw codes from my Comcast remote and using IRSend.SendRaw I can blast the code back and everything works great.

So a couple questions I need answered before converting this project:

Question 1
I need to modify the RAWBUF length from 100 to 400 as defined in the IRremoteESP8266.h. I Arduino it's easy to simply change:

#define RAWBUF 100


#define RAWBUF 400

Yes, the Comcast remote codes are almost 300 codes. I added an extra 100 to account for other devices. So my first question is how can I change this in the B4R IRRemote library - is it even possible? If not, I guess I will add it as a wish list item. Alternatively if it's not possible, I was thinking of inlining my current c code into B4R.

Question 2

I'm considering copying the IR record raw signal record code which basically is the Analysis IR code as inline code into my B4R project. That code uses attachInterrupt and detachInterrupt in order to work. Do you see any issues with that in a B4R project? I'm okay with leaving the record part out as a normal Arduino c code sketch since really the playback functionality is the portion that will get used the most.

Right now I have a simple C# program sending http calls (opening a url) on my 12e ESP8266 (actually it's not even really http server on the ESP8266 as I'm just using a TCP server to read the callers URL string and parsing that out). I want this to a B4a/B4i app for control and also setup a broker type server on a Raspberry PI 3 using B4J (the broker will actually talk to all my receivers, the receivers will register with the broker, and my apps only need one device to connect to).

Really I'm very excited to use the B4XSerializator to pass object data over the air/wire between my device and apps. For example I can pass multiple IR button codes (for instance if I want to simulate pressing 1 0 0 for channel 100 on my remote) I can put it in an object and pass that all in one call using B4XSerializator.

Any thoughts on this would be really appreciated :)

Thank You


B4X founder
Staff member
Licensed User
Longtime User
Upvote 0