Using Photon to Send IR with a HTTP server


Could someone help me make a program that sends ir signal from a Photon using an onboard http server or via serial.

I would like to use Pronto IR code.

Thank you.

It always helps to show what you’ve tried so far :wink:

1 Like

I havent made a anything yet :worried:
Ive tried to learn some by reading this Photon: Sending Infrared remote control signals

I managed to connect to the photon with Telnet with an example code i found somewhere. Problem is I dont know how and where to add the “ir code”

I need a minimum of 2 different ir codes to send.

if i send A then ir signal 1
and if i send B then ir signal 2

TCPServer server = TCPServer(23);
TCPClient client;

char addr[16];

char incoming;

void setup()

   pinMode(D7, OUTPUT);
   digitalWrite(D7, HIGH); 
   digitalWrite(D7, LOW); 
   delay(1000);  // give a few seconds to reflash the core if it gets unresponsive on startup
   digitalWrite(D7, HIGH); 
   digitalWrite(D7, LOW); 

  IPAddress localIP = WiFi.localIP();
  sprintf(addr, "%u.%u.%u.%u", localIP[0], localIP[1], localIP[2], localIP[3]);
  Spark.variable("Address", addr, STRING);

void loop()
  client = server.available();
   if (client.connected()) {
    client.println("Connected to Spark!");

    while (client.connected()) {
      while (client.available()) {

        incoming =;
        client.write(incoming);  // great to show on telnet what has been printed
        if (incoming == 'A'){   digitalWrite(D7, HIGH); }
        if (incoming == 'B'){   digitalWrite(D7, LOW); }
1 Like

Have you got the IR signals you want to send already digitalized?
What IR transmitter are you intending to use?

In the thread you linked above you’d find a link to another thread featuring a uPWM hack by @AnalysIR

Have a look at his code