Dragino LT-22222-LT downlink decoder error

Hello Everyone, yesterday I have connected my LT-22222-LT , II would like to turn on a lamp when i send a downlink.

I’ve connected this way

On dragino wiki I’ve this information :

Screenshot (45)

to try to turn on the lamp I’ve tried to send this command.

downlink

am I doing something wrong?

Three things:

  1. You haven’t actually said what does or doesn’t happen so we have no idea what may or may not be wrong
  2. Confirmed downlinks - very very very very bad
  3. Downlinks in general for command & control - are you aware of the Fair Use Policy and what happens if the command doesn’t get through?

Insert long explanation here about the issues of asking for advice about switching mains voltages, explosives, high speed car chases, radioactive material handling etc from total strangers.

In short, if anything goes wrong from advice here, no one here can be held liable.

Relay 1 on 03 01 11 FPort 1
Relay 1 off 03 00 11 FPort 1

Do you see the messages in the application console?

Hello Descartes. the main goal of shared a schema is to identify who have done a similar project, I believe If I’m plugged wrong someone who already did same can give me feedback.

what I want to try to test , is are able turn on or turn off light., i’ve tested as I mentioned on the top without sucess.

what do you mean with

  1. Confirmed downlinks - very very very very bad?

and

Insert long explanation here about the issues of asking for advice about switching mains voltages, explosives, high speed car chases, radioactive material handling etc from total strangers. ?? I cannot understand this comment, asking if the schema is correct , is it wrong ? what is the limits for the questions. I believe i don’t give so much information as I should be, because this is hobby and I’m learning. I’m not expert and that is the reason why I asked before do something.

I can see some information :

It should have switched, did it?

Also add the decoder and you will see the state of the relays in the uplink message.

This is the one I am using

function decodeUplink(input) {
  var port = input.fPort;
  var hardware= (input.bytes[10] & 0xC0)>>6;
  var mode0= input.bytes[10] & 0xff;
  var mode= input.bytes[10] & 0x3f;
 var data = {};
switch (input.fPort) {
  case 2:

  if(hardware=='0')
  {
    data.Hardware_mode="LT33222";
    data.DO3_status=(input.bytes[8] &0x04)? "L":"H";
    if(mode0=='1')
	 {
    	data.DI3_status= (input.bytes[8] &0x20)?"H":"L"; 
		    }
  }
  else if(hardware=='1')
  {
    data.Hardware_mode= "LT22222";
  }

  if(mode!=6)
  {
    data.DO1_status= (input.bytes[8] &0x01)? "L":"H";
    data.DO2_status= (input.bytes[8] &0x02)? "L":"H";
    data.RO1_status= (input.bytes[8] &0x80)? "ON":"OFF";
    data.RO2_status= (input.bytes[8] &0x40)? "ON":"OFF";
    if(mode!=1)
	  {
      if(mode!=5)
	   {
       data.Count1_times= (input.bytes[0]<<24 | input.bytes[1]<<16 | input.bytes[2]<<8 | input.bytes[3]);
	      }
      data.First_status= (input.bytes[8] &0x20)? "Yes":"No";
    }
	 }

  if(mode=='1')
  {
    data.Work_mode= "2ACI+2AVI";
    data.AVI1_V= parseFloat(((input.bytes[0]<<24>>16 | input.bytes[1])/1000).toFixed(3));
    data.AVI2_V= parseFloat(((input.bytes[2]<<24>>16 | input.bytes[3])/1000).toFixed(3));
    data.ACI1_mA= parseFloat(((input.bytes[4]<<24>>16 | input.bytes[5])/1000).toFixed(3));
    data.ACI2_mA= parseFloat(((input.bytes[6]<<24>>16 | input.bytes[7])/1000).toFixed(3));
    data.DI1_status= (input.bytes[8] &0x08)? "H":"L";
    data.DI2_status= (input.bytes[8] &0x10)? "H":"L"
  }
  else if(mode=='2')
  {
    data.Work_mode= "Count mode 1";
    data.Count2_times= (input.bytes[4]<<24 | input.bytes[5]<<16 | input.bytes[6]<<8 | input.bytes[7]);
  }
  else if(mode=='3')
  {
    data.Work_mode= "2ACI+1Count";
    data.ACI1_mA= parseFloat(((input.bytes[4]<<24>>16 | input.bytes[5])/1000).toFixed(3));
    data.ACI2_mA= parseFloat(((input.bytes[6]<<24>>16 | input.bytes[7])/1000).toFixed(3));
  }
  else if(mode=='4')
  {
    data.Work_mode= "Count mode 2";
    data.Acount_times= (input.bytes[4]<<24 | input.bytes[5]<<16 | input.bytes[6]<<8 | input.bytes[7]);
  }
  else if(mode=='5')
  {
    data.Work_mode= " 1ACI+2AVI+1Count";
    data.AVI1_V= parseFloat(((input.bytes[0]<<24>>16 | input.bytes[1])/1000).toFixed(3));
    data.AVI2_V= parseFloat(((input.bytes[2]<<24>>16 | input.bytes[3])/1000).toFixed(3));
    data.ACI1_mA= parseFloat(((input.bytes[4]<<24>>16 | input.bytes[5])/1000).toFixed(3));
    data.Count1_times= input.bytes[6]<<8 | input.bytes[7];
  }
  else if(mode=='6')
  {
    data.Work_mode= "Exit mode"; 
    data.Mode_status= input.bytes[9] ? "True":"False";
    data.AV1L_flag= (input.bytes[0] &0x80)? "True":"False";
    data.AV1H_flag= (input.bytes[0] &0x40)? "True":"False";
    data.AV2L_flag= (input.bytes[0] &0x20)? "True":"False";
    data.AV2H_flag= (input.bytes[0] &0x10)? "True":"False";   
    data.AC1L_flag= (input.bytes[0] &0x08)? "True":"False";
    data.AC1H_flag= (input.bytes[0] &0x04)? "True":"False";
    data.AC2L_flag= (input.bytes[0] &0x02)? "True":"False";
    data.AC2H_flag= (input.bytes[0] &0x01)? "True":"False";   
    data.AV1L_status= (input.bytes[1] &0x80)? "True":"False";
    data.AV1H_status= (input.bytes[1] &0x40)? "True":"False";
    data.AV2L_status= (input.bytes[1] &0x20)? "True":"False";
    data.AV2H_status= (input.bytes[1] &0x10)? "True":"False";   
    data.AC1L_status= (input.bytes[1] &0x08)? "True":"False";
    data.AC1H_status= (input.bytes[1] &0x04)? "True":"False";
    data.AC2L_status= (input.bytes[1] &0x02)? "True":"False";
    data.AC2H_status= (input.bytes[1] &0x01)? "True":"False";   
    data.DI2_status= (input.bytes[2] &0x08)? "True":"False";
    data.DI2_flag= (input.bytes[2] &0x04)? "True":"False";
    data.DI1_status= (input.bytes[2] &0x02)? "True":"False";
    data.DI1_flag= (input.bytes[2] &0x01)? "True":"False";   
  }

  if(input.bytes.length==11)
   {
 
   return {
      data:data,
     }
	 }
	break;
	case 5:
	  {
	    var decode = {};
		var freq_band;
		var sub_band;
		
		if(input.bytes[0]==0x01)
			freq_band="EU868";
		else if(input.bytes[0]==0x02)
			freq_band="US915";
		else if(input.bytes[0]==0x03)
			freq_band="IN865";
		else if(input.bytes[0]==0x04)
			freq_band="AU915";
		else if(input.bytes[0]==0x05)
			freq_band="KZ865";
		else if(input.bytes[0]==0x06)
			freq_band="RU864";
		else if(input.bytes[0]==0x07)
			freq_band="AS923";
		else if(input.bytes[0]==0x08)
			freq_band="AS923_1";
		else if(input.bytes[0]==0x09)
			freq_band="AS923_2";
		else if(input.bytes[0]==0x0A)
			freq_band="AS923_3";
		else if(input.bytes[0]==0x0F)
			freq_band="AS923_4";
		else if(input.bytes[0]==0x0B)
			freq_band="CN470";
		else if(input.bytes[0]==0x0C)
			freq_band="EU433";
		else if(input.bytes[0]==0x0D)
			freq_band="KR920";
		else if(input.bytes[0]==0x0E)
			freq_band="MA869";
		
		if(input.bytes[1]==0xff)
		  sub_band="NULL";
		  else
		  sub_band=input.bytes[1];

		  var firm_ver= (input.bytes[2]&0x0f)+'.'+(input.bytes[3]>>4&0x0f)+'.'+(input.bytes[3]&0x0f);
		  
		  var tdc_time= input.bytes[4]<<16 | input.bytes[5]<<8 | input.bytes[6];
		  
		  }
  default:
 return {
   errors: ["unknown FPort"]
 }
}
}

But you hadn’t told us clearly what you see that tells you that there has not been success - so we’d just be guessing.

Confirmed downlinks can end up in a perpetual loop if a device glitches and can cause issues for the local network.

I’m not sure why you’d think having strangers advising you on switching mains power is appropriate. I’m saying is that this forum can not provide advice that may impact your personal safety and that if you have any doubts you should contact a qualified electrician.

Just to confirm , the schema was correct , but the downlink I’ve shared on the top does not work with my device.

using those commands it worked well.

3.4.2.14 Relay – Control Relay Output RO1/RO2

RO2
ON - 030001
OFF 030000

RO1
ON 030100
OFF 030000

Thank you for you tried to help.

It is not clear at all what you mean by this.

But I suspect you’ve discovered that putting an uplink decoder in to the downlink decoder causes issue and by removing it, the downlink just gets passed through without issue.

You are setting the state of both relays at the same time, you need to send 11 for the state not to change.

With doing it this way you only change the state of relay 1 and relay 2 state stays the same.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.