LimitlessLED Technical Developer Opensource API

LAST UPDATED: 22nd November 2017

Wifi bridge v6 Apps that support RGBW and RGBW/WW/CW/CCT bulbs

August 2017: Home Assistant for v6 bridges RGBWW https://home-assistant.io/components/light.limitlessled/
June 2017: com.epocapp.milightcontroller by Epocapp applications (please donate to Epocapp if you enjoy their apps) http://www.epocapp.eu
June 2017: EpoCapp youtube video https://www.youtube.com/channel/UCBHTarafAl8d2jgzDvX3NAg
February 2017: PHP based on API V6 created by Wilfleaji, you can check it out there https://github.com/winosaure/MilightAPI
February 2017: Wilfleaji made a small tutorial for those I may need some help : http://stackoverflow.com/questions/42535502/problems-with-sending-udp-packets-milight-limitlessled/
January 2017: Domoticz supports wifi bridge v6 https://github.com/domoticz/domoticz
the sample code for wifi bridge v6 is here: https://github.com/domoticz/domoticz/blob/master/hardware/Limitless.cpp
March 2017: home-assistant supports bridge v6: https://home-assistant.io/

LimitlessLED Wifi Bridge Windows 10 and Windows7 App supports v6 bridge: Download LimitlessLEDv6.zip Here

LimitlessLED Wifi Bridge v6.0 Working Program code

VB.NET


    Imports System.Net
    Imports System.Net.Sockets
    Imports System.Text.Encoding

    Private LimitlessLEDWifiBridgeSessionID1 As Byte = 0
    Private LimitlessLEDWifiBridgeSessionID2 As Byte = 0
    Private SequenceNumber As Byte = 0

    'Usage:  SendLightCommand(txtV6cmd01.Text, txtIP2.Text, txtCommandUDPPort.Text, txtZone.Text, "Waiting for response...", 500, "", 10, True)

    Private Sub SendLightCommand(ByVal v6CommandString As String, ByVal sendIPAddress As String, ByVal sPortNumber As String, ByVal sZone As String, ByVal WaitText As String, ByVal ReceiveTimeout As Integer, ByVal ValidResponse As String, ByVal Retries As Integer, ByVal WaitForResponse As Boolean)

            Dim iPortNum As Integer = CInt(sPortNumber)

            If udpAdmin Is Nothing Then
                udpAdmin = New UdpClient(iPortNum)
                udpAdmin.EnableBroadcast = True
                udpAdmin.DontFragment = True
            Else
                Throw New Exception("udpAdmin was already initialised")
            End If

            Dim sendEndPoint = New IPEndPoint(IPAddress.Parse(sendIPAddress), iPortNum)
            Dim listenEndPoint = New IPEndPoint(IPAddress.Parse(sendIPAddress), iPortNum)
            Dim StartSessionCommandString As String = "20 00 00 00 16 02 62 3A D5 ED A3 01 AE 08 2D 46 61 41 A7 F6 DC AF D3 E6 00 00 1E"
            Dim b As Byte() = StringToBytes(StartSessionCommandString)
            udpAdmin.Send(b, b.Length, sendEndPoint)
            udpAdmin.Client.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReceiveTimeout, 1000)

            Try
                  Do While iFoundWifiBridges < iLookForNumberOfWifiBridges


                    receiveBytes = udpAdmin.Receive(listenEndPoint) 'wait here until a UDP packet has been received. TIMEout if no response received.

                    If receiveBytes.Length > 0 AndAlso receiveBytes(0) = (b(0) + 8) AndAlso receiveBytes.Length = (receiveBytes(4) + 5) Then
                        'if the first byte sent on the command is 0x10 then expect response of 0x18 (+8)
                        'if the first byte sent on the command is 0x20 then expect response of 0x28 (+8)

                        UpdateCommandsResponseMessage("Received: " & ByteArrayToString(receiveBytes)) 'ByteArrayToHexString(receiveBytes))
                       ' UpdateCommandsResponseMessage("Received bytes " & CUInt(receiveBytes(4)))

                        If Not chkFreezeSessionID.Checked Then
                            LimitlessLEDWifiBridgeSessionID1 = receiveBytes(19) '20th response byte
                        End If
                        UpdateCommandsResponseMessage("LimitlessLEDWifiBridgeSessionID1 is " & ByteToHexString(LimitlessLEDWifiBridgeSessionID1))

                        If Not chkFreezeSessionID.Checked Then
                            LimitlessLEDWifiBridgeSessionID2 = receiveBytes(20) '21st response byte
                        End If
                        UpdateCommandsResponseMessage("LimitlessLEDWifiBridgeSessionID2 is " & ByteToHexString(LimitlessLEDWifiBridgeSessionID2))

                        'could be broadcast, so we don't know how many bridges might respond
                        UpdateCommandsResponseMessage("IP Address is " & listenEndPoint.Address.ToString())

                        'The mac address is returned from the wifi bridge.
                        Dim macAddressFormatted As String = ByteToHexString(receiveBytes(8)) & ":" & ByteToHexString(receiveBytes(9)) & ":" & ByteToHexString(receiveBytes(10)) & ":" & ByteToHexString(receiveBytes(11)) & ":" & ByteToHexString(receiveBytes(12)) & ":" & ByteToHexString(receiveBytes(13))
                        Dim macAddressRaw As String = macAddressFormatted.Replace(":", "")
                        UpdateCommandsResponseMessage("MAC Address is " & macAddressFormatted)


SendCommand:
                        '80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 01(zone) 00 3F(chksum) response: (88 00 00 00 03 00 SN 00) 
                        Dim sendFullcommand As String = "80 00 00 00 04 05 06 00 08 00 " & v6CommandString & " 19 00 21"
                        Dim cmd As Byte() = StringToBytes(sendFullcommand)
                        cmd(4) = cmd.Length - 5 'set packet length (excluding 5 packet header bytes)
                        cmd(5) = LimitlessLEDWifiBridgeSessionID1 'session byte 1
                        cmd(6) = LimitlessLEDWifiBridgeSessionID2 'session byte 2

                        If Not chkFreezeSequenceNumber.Checked Then
                            If SequenceNumber = 255 Then
                                SequenceNumber = 0
                            Else
                                SequenceNumber = SequenceNumber + 1
                            End If
                        End If

                        cmd(8) = SequenceNumber
                        cmd(19) = CByte(sZone)
                        'Calculate Checksum:
                        Dim iChecksum As Integer
                        Dim bChecksum As Byte
                        For i As Integer = 10 To 20 '11 bytes
                            iChecksum += cmd(i)
                        Next
                        bChecksum = CByte(iChecksum And &HFF)
                        cmd(21) = bChecksum

                        UpdateCommandsResponseMessage("Sequence Number is " & ByteToHexString(SequenceNumber))
                        UpdateCommandsResponseMessage("Checksum is " & ByteToHexString(bChecksum))

                        udpAdmin.Send(cmd, cmd.Length, sendEndPoint)
                        'udpAdmin.Send(cmd, cmd.Length, broadcastEP)

                        UpdateCommandsResponseMessage("Sent: " & ByteArrayToString(cmd))

                        Do While iFoundWifiBridges < iLookForNumberOfWifiBridges
                            receiveBytes = udpAdmin.Receive(listenEndPoint) 'wait here until a UDP packet has been received. TIMEout if no response received.

                            If receiveBytes.Length > 0 AndAlso receiveBytes(0) = (cmd(0) + 8) AndAlso receiveBytes.Length = (receiveBytes(4) + 5) Then 'check header byte 0x88 and length byte 0x03 is correct (including the 5 packet header bytes that aren't counted)
                                UpdateCommandsResponseMessage("Command SUCCESSFUL.")
                                UpdateCommandsResponseMessage("Received: " & ByteArrayToString(receiveBytes))
                                'response should be: 88 00 00 00 03 00 SN 00

                                Exit Do
                            End If
                        Loop

                        Exit Do
                    End If
                Loop

         Catch ex As System.Net.Sockets.SocketException

            Dim excp = ex.SocketErrorCode

            If excp = SocketError.TimedOut Then
                'TODO: retry if there is a timeout, chances are it will work the second time on UDP
                UpdateCommandsResponseMessage("Timeout waiting for Wifi Bridge Response.")
            Else
                UpdateCommandsResponseMessage(ex.Message)
            End If

        Catch ex As Exception

            UpdateCommandsResponseMessage(ex.Message)
        Finally

            Try
                udpAdmin.Client.Shutdown(SocketShutdown.Receive)
            Catch ex As Exception
                'UpdateStatusMessage("udpAdmin.Client.Shutdown(SocketShutdown.Receive) exception." & ex.Message)
            End Try
            Try
                udpAdmin.Client.Close()
            Catch ex As Exception
                'UpdateStatusMessage("udpAdmin.Client.Close() exception." & ex.Message)
            End Try
            Try
                udpAdmin.Close()
            Catch ex As Exception
                'UpdateStatusMessage("udpAdmin.Close() exception." & ex.Message)
            End Try
            Try
                udpAdmin = Nothing
            Catch ex As Exception
                ' UpdateStatusMessage("udpAdmin = Nothing exception." & ex.Message)
            End Try

        End Try

    End Sub

    Public Shared Function StringToBytes(ByVal hex As String) As Byte()
        hex = hex.Replace(" ", "")

        If hex.Length Mod 2 = 1 Then
            Throw New Exception("The hex string cannot have an odd number of digits")
        End If

        Dim arr As Byte() = New Byte((hex.Length >> 1) - 1) {}

        For i As Integer = 0 To (hex.Length >> 1) - 1
            arr(i) = CByte((GetHexVal(hex(i << 1)) << 4) + (GetHexVal(hex((i << 1) + 1))))
        Next

        Return arr
    End Function

    Public Shared Function GetHexVal(ByVal hex As Char) As Integer
        Dim val As Integer = AscW(hex)
        'For uppercase A-F letters:
        'Return val - (If(val < 58, 48, 55))
        'For lowercase a-f letters:
        'Return val - (If(val < 58, 48, 87))
        'Or the two combined, but a bit slower:
        Return val - (If(val < 58, 48, (If(val < 97, 55, 87))))
    End Function

    Private Sub UpdateStatusMessage(ByVal message As String)
        txtLog.Text &= message.Replace(vbCr, "\r").Replace(vbLf, "\n") & vbCrLf
        '\r = Cr = decimal13 = 0x0D = Carriage Return  
        '\n = Lf = decimal10 = 0x0A = Linefeed
        txtLog.SelectionStart = txtLog.Text.Length
        txtLog.ScrollToCaret()
        Application.DoEvents()
    End Sub
 

LimitlessLED Wifi Bridge v6.0 Sample code

NodeJS

'use strict';
var dgram = require('dgram');

var debug=false;

var DEFAULT_HOST ;
var DEFAULT_PORT ;
var DEFAULT_REPEATS=3 ;

var PREAMPLE = [0x80,0x00,0x00,0x00,0x11]

var FILLER = 0x00

var CMDS={
 ON: [0x31,0,0,0x08,0x04,0x01,0,0,0],
 OFF: [0x31,0,0,0x08,0x04,0x02,0,0,0],
 NIGHT: [0x31,0,0,0x08,0x04,0x05,0,0,0],
 WHITEON: [0x31,0,0,0x08,0x05,0x64,0,0,0],
 REG: [0x33,0,0,0,0,0,0,0,0,0],
 BON: [0x31,0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x00],
 BOFF:[0x31,0x00,0x00,0x00,0x03,0x04,0x00,0x00,0x00],
 BWHITE:[0x31 ,0x00 ,0x00 ,0x00 ,0x03 ,0x05 ,0x00 ,0x00 ,0x00],
};
var socket;

var zoneCtlRGBWFactory=function(zoneID){
  var color=0x7A;
	var brightness=0x32;
  var saturation=0x32;
  var colorTemp=0x4B;
  var zone=zoneID;
  if(zone > 4 || zone <0 ) console.log("invalid zone");

  return {
    on: function(){
      return [0x31,0,0,0x08,0x04,0x01,0,0,0,zoneID];
    },
    off: function(){
      return [0x31,0,0,0x08,0x04,0x02,0,0,0,zoneID];
    },
    nightMode: function() {
      return [0x31,0,0,0x08,0x04,0x05,0,0,0,zoneID];
    },
    whiteMode:function() {
      return [0x31,0,0,0x08,0x05,0x64,0,0,0,zoneID];
    },
    saturationUp:function(){
      saturation=Math.min(saturation+5,0x64);
      return [0x31,0x00,0x00,0x08,0x02,saturation,0x00,0x00,0x00,zoneID]
    },
    saturationDown:function(){
      saturation=Math.max(saturation-5,0x00);
      return [0x31,0x00,0x00,0x08,0x02,saturation,0x00,0x00,0x00,zoneID]
    },
    saturationSet:function(b){
      saturation=Math.max(b,0x00);
      saturation=Math.min(b,0x64);
      return [0x31,0x00,0x00,0x08,0x02,saturation,0x00,0x00,0x00,zoneID]
    },
   brightnessUp:function(){
      brightness=Math.min(brightness+5,0x64);
      return [0x31,0x00,0x00,0x08,0x03,brightness,0x00,0x00,0x00,zoneID]
    },
    brightnessDown:function(){
      brightness=Math.max(brightness-5,0x00);
      return [0x31,0x00,0x00,0x08,0x03,brightness,0x00,0x00,0x00,zoneID]
    },
    brightnessSet:function(b){
      brightness=Math.max(b,0x00);
      brightness=Math.min(b,0x64);
      return [0x31,0x00,0x00,0x08,0x03,brightness,0x00,0x00,0x00,zoneID]
    },
    colorUp:function(){
      color=Math.min(color+5,0xFF);
      return [0x31,0x00,0x00,0x08,0x01,color,color,color,color,zoneID]
    },
    colorDown:function(){
      color=Math.max(color-5,0x00);
      return [0x31,0x00,0x00,0x08,0x01,color,color,color,color,zoneID]
    },
    colorSet:function(c){
      color=c;
      return [0x31,0x00,0x00,0x08,0x01,color,color,color,color,zoneID]
    },
    colorRGB:function(rgb){
      return rgbHandler(rgb,this);
    },
    colorTempUp:function(){
      colorTemp=Math.min(colorTemp+5,0x64);
      return [0x31,0x00,0x00,0x08,0x05,colorTemp,0,0,0,zoneID]
    },
    colorTempDown:function(){
      colorTemp=Math.max(colorTemp-5,0x00);
      return [0x31,0x00,0x00,0x08,0x05,colorTemp,0,0,0,zoneID]
    },
    colorTempSet:function(c){
      colorTemp=c;
      return [0x31,0x00,0x00,0x08,0x05,colorTemp,0,0,0,zoneID]
    },
    mode:function(mode){
      return [0x31,0x00,0x00,0x08,0x06,mode,0,0,0,zoneID]
    },
    modeSpeedUp:function(){
      return [0x31,0,0,0x08,0x04,0x03,0,0,0,zoneID]
    },
    modeSpeedDown:function(){
      return [0x31,0,0,0x08,0x04,0x04,0,0,0,zoneID]
    },
    link:function(){
      return [0x3D,0,0,0x08,0,0,0,0,0,zoneID]
    },
    unlink:function(){
      return [0x3E,0,0,0x08,0,0,0,0,0,zoneID]
    },
    command(fnName,arg){
      if (this[fnName]) {
        var cmds=this[fnName](arg);
        if (Array.isArray(cmds) && Array.isArray(cmds[0])){
          cmds.forEach(function(elem){
sendCmd(elem)})
        } else {
          sendCmd(cmds);//single cmd`
        }
      }
    }
  }
}

var zoneCtlRGBWWFactory=function(zoneID){
  var color=0x7A;
	var brightness=0x32;
  //var saturation=0x32;
  //var colorTemp=0x4B;
  var zone=zoneID;
  if(zone > 4 || zone <0 ) console.log("invalid zone");

  return {
    on: function(){
      return [0x31, 0x00, 0x00, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, zoneID];
    },
    off: function(){
      return [0x31, 0x00, 0x00, 0x07, 0x03, 0x02, 0x00, 0x00, 0x00, zoneID];
    },
    nightMode: function() {
      return [0x31, 0x00, 0x00, 0x07, 0x03, 0x06, 0x00, 0x00, 0x00, zoneID];
    },
    whiteMode:function() {
      return [0x31, 0x00, 0x00, 0x07, 0x03, 0x05, 0x00, 0x00, 0x00, zoneID];
    },
    brightnessUp:function(){
      brightness=Math.min(brightness+5,0x64);
      return [0x31, 0x00, 0x00, 0x07, 0x02, brightness, 0x00, 0x00, 0x00, zoneID]
    },
    brightnessDown:function(){
      brightness=Math.max(brightness-5,0x00);
      return [0x31, 0x00, 0x00, 0x07, 0x02, brightness, 0x00, 0x00, 0x00, zoneID]
    },
    brightnessSet:function(b){
      brightness=Math.max(b,0x00);
      brightness=Math.min(b,0xFF);
      return [0x31, 0x00, 0x00, 0x07, 0x02, brightness, 0x00, 0x00, 0x00, zoneID]
    },
    colorUp:function(){
      color=Math.min(color+5,0xFF);
      return [0x31, 0x00, 0x00, 0x07, 0x01, color, color, color, color, zoneID]
    },
    colorDown:function(){
      color=Math.max(color-5,0x00);
      return [0x31, 0x00, 0x00, 0x07, 0x01, color, color, color, color, zoneID]
    },
    colorSet:function(c){
      color=c;
      return [0x31, 0x00, 0x00, 0x07, 0x01, color, color, color, color, zoneID]
    },
    colorRGB:function(rgb){
      return rgbHandler(rgb,this);
    },
    mode:function(mode){
      return [0x31, 0x00, 0x00, 0x07, 0x04, mode, 0x00, 0x00, 0x00, zoneID]
    },
    modeSpeedUp:function(){
      return [0x31, 0x00, 0x00, 0x07, 0x03, 0x03, 0x00, 0x00, 0x00, zoneID]
    },
    modeSpeedDown:function(){
      return [0x31, 0x00, 0x00, 0x07, 0x03, 0x04, 0x00, 0x00, 0x00, zoneID]
    },
    link:function(){
      console.log("link not captured");
      return [0x3D,0,0,0x07,0,0,0,0,0,zoneID]
    },
    unlink:function(){
      console.log("link not captured");
      return [0x3E,0,0,0x07,0,0,0,0,0,zoneID]
    },
    command(fnName,arg){
      if (this[fnName]) {
        var cmds=this[fnName](arg);
        if (Array.isArray(cmds) && Array.isArray(cmds[0])){
          cmds.forEach(function(elem){sendCmd(elem)})
        } else {
          sendCmd(cmds);//single cmd`
        }
      }
    }
  }
}

var baseCtlFactory=function(){
	var color=0x7A;
	var brightness=0x32;
  var zoneID=0x01;
	return {
 		on:function(){return [0x31,0x00,0x00,0x00,0x03,0x03,0x00,0x00,0x00,zoneID]},
		off:function(){return [0x31,0x00,0x00,0x00,0x03,0x04,0x00,0x00,0x00,zoneID]},
 		whiteMode:function(){return [0x31 ,0x00 ,0x00 ,0x00 ,0x03 ,0x05 ,0x00 ,0x00 ,0x00,zoneID]},
		brightnessUp:function(){
			brightness=Math.min(brightness+5,0x64);
			return [0x31,0x00,0x00,0x00,0x02,brightness,0x00,0x00,0x00,zoneID]
		},
		brightnessDown:function(){
			brightness=Math.max(brightness-5,0x00);
			return [0x31,0x00,0x00,0x00,0x02,brightness,0x00,0x00,0x00,zoneID]
		},
		brightnessSet:function(b){
			brightness=Math.max(b,0x00);
			brightness=Math.min(b,0xFF);
			return [0x31,0x00,0x00,0x00,0x02,brightness,0x00,0x00,0x00,zoneID]
		},
		colorUp:function(){
			color=Math.min(color+5,0xFF);
			return [0x31,0x00,0x00,0x00,0x01,color,color,color,color,zoneID]
		},
		colorDown:function(){
			color=Math.max(color-5,0x00);
			return [0x31,0x00,0x00,0x00,0x01,color,color,color,color,zoneID]
		},
		colorSet:function(c){
			color=c;
			return [0x31,0x00,0x00,0x00,0x01,color,color,color,color,zoneID]
		},
    colorRGB:function(rgb){
      return rgbHandler(rgb,this);
    },
		mode:function(mode){
			return [0x31,0x00,0x00,0x00,0x04,mode,0,0,0,zoneID]
		},
    command(fnName,arg){
      if (this[fnName]) {
        var cmds=this[fnName](arg);
        if (Array.isArray(cmds) && Array.isArray(cmds[0])){
          cmds.forEach(function(elem){sendCmd(elem)})
        } else {
          sendCmd(cmds);//single cmd`
        }
      }
    }
	}

};

var bridgeID;
var bridgeID2;
var seqNum=0x02;

var sendCmd = function(CMD,repeats){
	if (typeof repeats === 'undefined') { repeats = DEFAULT_REPEATS};

	var out=[];
	//console.log("#"+WB.toString('hex')+"-"+CMD.toString("hex"));
	out=out.concat(PREAMPLE,bridgeID,bridgeID2,0x00,seqNum,FILLER,CMD)
	var chkSum=calcCheckSum(out);
	out =	out.concat(chkSum);
	//console.log(JSON.stringify(out));
	if (debug) console.log("#"+out.toString('hex'));
	out=new Buffer(out);
	seqNum=(seqNum+1)%256;
  	if(debug) console.log("Sending: " + out.toString('hex'));
	for (var i=0;i {
  //console.log('Received %d bytes from %s:%d\n',
  //            msg.length, rinfo.address, rinfo.port);
  var hmsg=msg.toString('hex');
  var resp=(msg.toString('hex').substring(0,10));
  if (_func[resp]) {
    _func[resp](msg)
  } else {
    console.log("Unknown code");
    console.log(hmsg);
  }
});

var initiate=function(host,port){
	//socket.send(payload,0,payload.length,DEFAULT_PORT,DEFAULT_HOST,function(a,b){});
	DEFAULT_HOST=host;
	DEFAULT_PORT=port;
  //socket.bind();
  //socket.bind(DEFAULT_PORT);
  var payload=new Buffer([0x20,0x00,0x00,0x00,0x16,0x02,0x62,0x3a,0xd5,0xed,0xa3,0x01,0xae,0x08,0x2d,0x46,0x61,0x41,0xa7,0xf6,0xdc,0xaf,0xfe,0xf7,0x00,0x00,0x1e]);
if (debug) console.log(payload.toString('hex'));
	sendFrame(payload);
};




    exports.initiate= initiate;
    exports.baseCtlFactory= baseCtlFactory;
    exports.zoneCtlRGBWFactory= zoneCtlRGBWFactory;
    exports.zoneCtlRGBWWFactory= zoneCtlRGBWWFactory;
    exports.sendCmd= sendCmd;
    

LimitlessLED Wifi Bridge v6.0

Section 1. Manual Web Browser Wifi Bridge v6 Setup.

  • Connect Phone to Milight AccessPoint
  • Use Phone Web Browser to http://10.10.100.254
  • Username: admin
  • Password: admin
  • Work Mode: change to STA mode, press Save
  • STA Setting: Scan for your Home Wifi Router
  • Encryption Method: WPA2PSK
  • Encryption Algorithm: AES
  • Password: enter your home wifi router password here.
  • Obtain an IP address automatically: Enable
  • Restart: Click Ok
  • Now put your phone back on your home wifi network, and open the app, it will see the wifi bridge, assuming you entered your wifi password correctly a few steps back. :)

Section 2. Searching for LimitlessLED v6 Bridge/s on the LAN.

  • We have a Windows App for this called LimitlessLED Admin tool v5/v6
  • If you are building your own Program, use the following...
  • UDP.IP = "255.255.255.255"; // IP.Broadcast
  • UDP.PORT = 48899;
  • UDP.SendBytes(UTF8.GetBytes("HF-A11ASSISTHREAD")); // this is the broadcast string for the v6 Bridge (for v5 bridges use the string "Link_Wi-Fi")
  • receiveBytes = UDP.Receive();
  • response = UTF8.GetString(receiveBytes);
  • //each wifi bridge responds with one response at time. so call receive again until 1 second is up.
  • // returns a string containing: IP address of the wifi bridge, the unique MAC address, and the name(which is always the same for v6, and the name is empty for v5 bridges) there is always two commas present regardless of v5 or v6 wifi bridge.
  • // 10.1.1.27,ACCF23F57AD4,HF-LPB100
  • // 10.1.1.31,ACCF23F57D80,HF-LPB100

Section 3. Wifi Bridge v6 Protocol - All values are in Hex

  • all values below are in hex, 0xFF means 255 in decimal aka FF in hex, aka 1 byte of FF, aka 8 bits of 11111111.
  • UDP.IP = "255.255.255.255"; (or direct Wifi Bridge IP Address)
  • UDP.PORT = 5987; //(decimal integer 5987)
  • UDP.SEND (hex bytes, see below)
  • SN = Sequential Byte
  • Sequential byte just helps with keeping commands in the correct order, and it helps to ignore duplicate packets already received. increment this byte for each new command by 1.
  • WB1 = LimitlessLED Wifi Bridge Session ID1
  • WB2 = LimitlessLED Wifi Bridge Session ID2
  • to get the WB1 and WB2 send this command
  • UDP.SEND hex bytes: 20 00 00 00 16 02 62 3A D5 ED A3 01 AE 08 2D 46 61 41 A7 F6 DC AF (D3 E6) 00 00 1E <-- Send this to the ip address of the wifi bridge v6
  • UDP.Response: 28 00 00 00 11 00 02 (AC CF 23 F5 7A D4)(mac) 69 F0 3C 23 00 01 (05 00)(<--WifiBridgeSessionID1 & WifiBridgeSessionID2) 00 <-- (example response 1)
  • UDP.Response: 28 00 00 00 11 00 02 (AC CF 23 F5 7A D4)(mac) 69 F0 3C 23 00 01 (17 01)(<--WifiBridgeSessionID1 & WifiBridgeSessionID2) 00 <-- (example response 2)
  • UDP.Response: 28 00 00 00 11 00 02 (AC CF 23 F5 7A D4)(mac) 69 F0 3C 23 00 01 (F2 00)(<--WifiBridgeSessionID1 & WifiBridgeSessionID2) 00 <-- (example response 3)
  • WB1 = LimitlessLED Wifi Bridge Session ID1 = response[19] (20th byte of response above)
  • WB2 = LimitlessLED Wifi Bridge Session ID2 = response[20] (21st byte of response above)
  • RGBW/WW/CW Commands
  • UDP Hex Send Format: 80 00 00 00 11 {WifiBridgeSessionID1} {WifiBridgeSessionID2} 00 {SequenceNumber} 00 {COMMAND} {ZONE NUMBER} 00 {Checksum}
  • UDP Hex Response: 88 00 00 00 03 00 {SequenceNumber} 00
  • List of {COMMAND}s:
  • format of {command} 9 byte packet = 0x31 {PasswordByte1 default 00} {PasswordByte2 default 00} {remoteStyle 08 for RGBW/WW/CW or 00 for bridge lamp} {LightCommandByte1} {LightCommandByte2} 0x00 0x00 0x00 {Zone1-4 0=All} 0x00 {Checksum}
  • 31 00 00 08 04 01 00 00 00 = Light ON
  • 31 00 00 08 04 02 00 00 00 = Light OFF
  • 31 00 00 08 04 05 00 00 00 = Night Light ON
  • 31 00 00 08 05 64 00 00 00 = White Light ON (Color RGB OFF)
  • 31 00 00 08 01 BA BA BA BA = Set Color to Blue (0xBA) (0xFF = Red, D9 = Lavender, BA = Blue, 85 = Aqua, 7A = Green, 54 = Lime, 3B = Yellow, 1E = Orange)
  • 31 00 00 08 02 SS 00 00 00 = Saturation (SS hex values 0x00 to 0x64 : examples: 00 = 0%, 19 = 25%, 32 = 50%, 4B, = 75%, 64 = 100%)
  • 31 00 00 08 03 BN 00 00 00 = BrightNess (BN hex values 0x00 to 0x64 : examples: 00 = 0%, 19 = 25%, 32 = 50%, 4B, = 75%, 64 = 100%)
  • 31 00 00 08 05 KV 00 00 00 = Kelvin (KV hex values 0x00 to 0x64 : examples: 00 = 2700K (Warm White), 19 = 3650K, 32 = 4600K, 4B, = 5550K, 64 = 6500K (Cool White))
  • 31 00 00 08 06 MO 00 00 00 = Mode Number (MO hex values 0x01 to 0x09 : examples: 01 = Mode1, 02 = Mode2, 03 = Mode3 .. 09 = Mode9)
  • 31 00 00 08 04 04 00 00 00 = Mode Speed Decrease--
  • 31 00 00 08 04 03 00 00 00 = Mode Speed Increase++
  • 3D 00 00 08 00 00 00 00 00 = Link (Sync Bulb within 3 seconds of lightbulb socket power on)
  • 3E 00 00 08 00 00 00 00 00 = UnLink (Clear Bulb within 3 seconds of lightbulb socket power on)
  • Wifi Bridge iBox LED Lamp {COMMAND}s (Zone Number = 0x01)
  • 31 00 00 00 03 03 00 00 00 = Wifi Bridge Lamp ON
  • 31 00 00 00 03 04 00 00 00 = Wifi Bridge Lamp OFF
  • 31 00 00 00 04 MO 00 00 00 = Mode Number (MO hex values 0x01 to 0x09 : examples: 01 = Mode1, 02 = Mode2, 03 = Mode3 .. 09 = Mode9)
  • 31 00 00 00 03 01 00 00 00 = Mode Speed Decrease--
  • 31 00 00 00 03 02 00 00 00 = Mode Speed Increase++
  • 31 00 00 00 01 BA BA BA BA = Set Color to Blue (BA) (FF = Red, D9 = Lavender, BA = Blue, 85 = Aqua, 7A = Green, 54 = Lime, 3B = Yellow, 1E = Orange)
  • 31 00 00 00 03 05 00 00 00 = Set Color to White (is ignored when Lamp is OFF, it does NOT turn the Lamp ON)
  • 31 00 00 00 02 BN 00 00 00 = BrightNess (BN hex values 0x00 to 0x64 : examples: 00 = 0%, 19 = 25%, 32 = 50%, 4B, = 75%, 64 = 100%)
  • Valid List for {ZONE NUMBER}
  • 0x00 All
  • 0x01 Zone1
  • 0x02 Zone2
  • 0x03 Zone3
  • 0x04 Zone4
  • Checksum:
  • RGBW/WW/CW Checksum Byte Calculation is the sum of the 11 bytes before end of the UDP packet. The checksum is then added to the end of the UDP message.
  • take the 9 bytes of the command, and 1 byte of the zone, and add the 0 = the checksum = (checksum & 0xFF)
  • e.g. SUM((31 00 00 08 04 01 00 00 00)(command) 01(zone) 00) = 3F(chksum)
  • EXAMPLES
  • LimitlessLED Wifi Bridge Light ON 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 00 03 03 00 00 00)(cmd) 01(zone) 00 38(chksum) UDP response: (88 00 00 00 03 00 SN 00)
  • LimitlessLED Wifi Bridge Light OFF 80 00 00 00 11 WB 00 00 SN 00 (31 00 00 00 03 04 00 00 00)(cmd) 01(zone) 00 39(chksum) UDP response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 1 ON 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 01(zone) 00 3F(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone1 OFF 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 01(zone) 00 40(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 2 ON 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 02(zone) 00 40(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone2 OFF 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 02(zone) 00 41(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 3 ON 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 03(zone) 00 41(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone3 OFF 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 03(zone) 00 42(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 4 ON 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 04(zone) 00 42(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone4 OFF 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 04(zone) 00 43(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW ZoneALL ON 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 01 00 00 00)(cmd) 00(zone) 00 3E(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW ZoneALLOFF 80 00 00 00 11(length hex) (17 01)(WB1WB2) 00 SN 00 (31 00 00 08 04 02 00 00 00)(cmd) 00(zone) 00 3F(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 1 Link 80 00 00 00 11 WB1 WB2 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 01(zone) 00 46(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 2 Link 80 00 00 00 11 WB1 WB2 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 02(zone) 00 47(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 3 Link 80 00 00 00 11 WB1 WB2 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 03(zone) 00 48(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 4 Link 80 00 00 00 11 WB1 WB2 00 SN 00 (3D 00 00 08 00 00 00 00 00)(link cmd) 04(zone) 00 49(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 1 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 01(zone) 00 47(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 2 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 02(zone) 00 48(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 3 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 03(zone) 00 49(chksum) response: (88 00 00 00 03 00 SN 00)
  • RGBW/WW/CW Zone 4 UnLink 80 00 00 00 11 WB 00 00 SN 00 (3E 00 00 08 00 00 00 00 00)(unlink cmd) 04(zone) 00 4A(chksum) response: (88 00 00 00 03 00 SN 00)
  • Keep Alive Messages
  • KEEP ALIVES (Every 5 seconds) Wifi Bridge 1: D0 00 00 00 02 (WB) 00 (response: D8 00 00 00 07 (AC CF 23 F5 7A D4) 01)
  • KEEP ALIVES (Every 5 seconds) Wifi Bridge 1: D0 00 00 00 02 1D 00 (response: D8 00 00 00 07 (AC CF 23 F5 7A D4) 01)
  • KEEP ALIVES (Every 5 seconds) Wifi Bridge 2: D0 00 00 00 02 7C 00 (response: D8 00 00 00 07 (AC CF 23 F5 7D 80) 01)
  • Click Search for Devices:
  • UDP.Send (255.255.255.255:5987) Bytes: 10 00 00 00 24 02 ee 3e 02 39 38 35 62 31 35 37 62 66 36 66 63 34 33 33 36 38 61 36 33 34 36 37 65 61 33 62 31 39 64 30 64
  • GET ALL WIFI BRIDGE CLOUD KEYS on LAN using UDP
  • UDP.IP = "255.255.255.255"
  • UDP.port = 5987
  • UDP.SEND hex bytes: 10 00 00 00 0A 02 D3 E6 01 (AC CF 23 F5 7A D4)(MAC address)
  • UDP.Response: 18 00 00 00 40 02 (AC CF 23 F5 7A D4)(mac) 00 20 (985b157bf6fc43368a63467ea3b19d0d)(ASCII Tokenkey) 01 00 01 17 63 00 00 05 00 09 (xlink_dev)(ASCII) 07 5B CD 15
  • UDP.SEND hex bytes: 20 00 00 00 16 02 62 3A D5 ED A3 01 AE 08 2D 46 61 41 A7 F6 DC AF D3 E6 00 00 1E
  • UDP.Response: 28 00 00 00 11(LENGTH) 00 02 (AC CF 23 F5 7A D4)(mac) 69 F0 3C 23 00 01 05 00 00
  • UDP.SEND hex bytes: D0 00 00 00 02 05(WB1) 00(WB2)
  • UDP.Response: response: D8 00 00 00 07 (AC CF 23 F5 7A D4) 01)
  • example2: 10 00 00 00 0A 02 FE E7 01 (AC CF 23 F5 7A D4)(MAC address)
  • example3: 10 00 00 00 0A 02 FE 51 01 (AC CF 23 F5 7D 80)(MAC address)

Section 4. Smart Link Setup Services

  • ** Warning only have one wifi bridge powered up at a time when setup using smart link (In case you have more than one in your home) **
  • Smart-link is all about getting your brand new wifi bridge onto your home wifi router network.
  • SmartLink saves the user time during the setup phase, from having to switch to the bridge in the wifi settings to set it up. Instead it is done using a sync button underneath the Wifi Bridge v6 and an app.
  • If you want to build smart-link into your own app.
  • SMART LINK UDP port 49999 Default Password "8888"
  • UDP.IP = "10.1.1.255"
  • UDP.PORT = 49999
  • UDP.Send Whilst Waiting: 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05 05

    Section 5. Cloud Remote Internet access Services

  • If you want to build an app that controls the lights over the internet, more information will be made available here.
  • http://www.xlink.cn/
  • So that enterprises have the power of things. Cloud-to-cloud platform, easily and securely connected devices, rapid development of Internet of things applications,
    In the Internet of Things data extraction value.

  • Default Cloud Server: Amazon Web Services Cloud ec2-52-63-118-215.ap-southeast-2.compute.amazonaws.com [52.63.118.215] cm2.xlink.cn
  • Default Cloud Port: 23778
  • Cloud Server Login TCP.Send: 10 00 00 00 1A 02 4B 4B 59 DB 00 10 32 32 30 66 61 32 61 66 66 65 36 63 61 32 30 30 00 00 3C
    Cloud TCP.Read Login Response: 18 00 00 00 02 00 00

  • Cloud Keep Alive: TCP.Send: D0 00 00 00 00
  • Cloud Keep Alive: TCP.Read: D8 00 00 00 00
  • Cloud TCP sent: A0 00 00 00 07 69 F0 3D F3 00 0B 00
  • Cloud response: A8 00 00 00 13 69 F0 3D F3 00 0B 00 07 00 09 x l i n k _ d e v
  • Cloud TCP sent:
  • Cloud response: 6{"device_id":1777352179,"type":"offline","operator":0} x