LT-33222-L LoRa I/O Controller - Payload decoder and downlink config


(Zone11) #1

While working with the LT-33222 I found a wrong configuration in the preconfigured device to receive downlink data. Ensure you set the RX2 data rate to SF9/125 with the AT command “AT+RX2DR=3”.

And here is my payload decoder, DIx are inverted to represent the logical state, not the physical one.
Input is 1 when tied to GND (Device LED on).

function Decoder(bytes, port) {
  var decoded = {};
  var inputs = bytes[8];
  
  decoded.ACI1 = ((bytes[0] << 8) + bytes[1])/100;
  decoded.ACI2 = ((bytes[2] << 8) + bytes[3])/100;
  decoded.AVI1 = ((bytes[4] << 8) + bytes[5])/100;
  decoded.AVI2 = ((bytes[6] << 8) + bytes[7])/100;
  decoded.DO1 = inputs & (1 << 0) ? 1 : 0;
  decoded.DO2 = inputs & (1 << 1) ? 1 : 0;  
  decoded.DO3 = inputs & (1 << 2) ? 1 : 0;
  decoded.DI1 = inputs & (1 << 3) ? 0 : 1;
  decoded.DI2 = inputs & (1 << 4) ? 0 : 1;
  decoded.DI3 = inputs & (1 << 5) ? 0 : 1;
  decoded.RO1 = inputs & (1 << 6) ? 1 : 0;
  decoded.RO2 = inputs & (1 << 7) ? 1 : 0;
  
  return decoded;
}

Feel free to use and improve :wink:

  • Christian

The BARGAIN basement part 5
(Arjan) #2

Am I right to assume you’re using ABP?

For ABP one indeed needs to manually configure the network settings, which for TTN implies configuring RX2, at least for EU868. For OTAA, the configuration should be automatic. (So, if you’re using OTAA, you might want to report a bug with Dragino.)


(Zone11) #3

No, I’m using OTAA

Unfortunately the RX2 is not configured correctly in my case.
The controller reports RX2 configured as DR_0 (SF12/125) but my all my gateways are sending downlink with DR_3 (SF9/125).

I’m going to file a bug report.


(Pat Molloy) #4

I’m also using OTAA, all the uplinks are fine, but you have to configure (at present) the downlink manually via a serial connection to the device … AT+RX2DR=3 … once this is done, works just great !


(Profiler64) #5

Hey I have a question about the LT-33222. I want to buy one of these controllers and a 8 Ch Gateway. I. want to control one of the onboard relays. My Question is:
How often can i switch the relay on this Controller, because the downlink limitation from TTN. Can i switch every time the Controller sends data to the network and right after that it can receive the data? Or how does it works? I’m completly New to this topic but i think the Controller is the right thing for me.
Maybe you can help me :slight_smile:


#6

  • for basic controlling lights and things in your house, better use one of these modules and not LoRaWAN / TTN

(Profiler64) #7

Yeah i know. But i dont want to control lights. I want to control like 10 solenoidvalves for a irrigation System on fields. My Main question is how often i can downlink to the Controller.


#8

see