I am a beginner and need help to program from Dragino two controller typ LT-22222.
The eye position:
When an input is switched at controller 1, a relay should be switched at the second controller as long as the input at the first is switched on.
Dragino devices used
one gateway LSP8, 2 controllers LT-22222
Both controllers under one application and online.
That should be only a few program lines, I thought.
Also the online test function at Dragino is not clear to me. How can I switch the outputs on the controller for test purposes?
Are there examples for programming?
I am grateful for any help.
Not a device I am familiar with, but before you start the programming, do you know how many times a day the second controller could be told to switch its relay ?
And perhaps give a description of what the switch and relay are actually doing or controlling.
The LT-22222 isnât normally a programable device - it sends information about the inputs and, subject to legal & Fair Use Policy as implied in the post above, can take a command to switch an output. All of this is done using the commands in the manual / documentation for configuration.
You can program it at a device level if you want to get in to the STM32 code but thatâs not going to help for this instance.
So youâll need to read the TTN documentation on integrations so you can write some code to monitor the uplinks from the first device and then request a downlink for the other device.
But, to go back to the legal & FUP constraints, there are two key issues. First, whilst the sensing device can trigger an immediate uplink, unless you configure the second device for Class C mode, it wonât get the message for the relay until it next uplinks. And in all of this, on TTN you are restricted to 10 downlinks a day.
If both devices are in range of each other it would be simpler to change the code so they communicate directly - cutting out any delay, TTN and the FUP issues all together.
As mentioned above, it would be so much easier to make suggestions if we knew what the sensor & the relay were connected to / doing.
thanks for the quick reply.
The devices are relatively close to each other and can communicate directly. Both devices are class C.
The switching frequency is very low, 1-2 times a day.
There are 2 devices (instantaneous water heaters) interlocked via contactors.
When the first is in operation, the second can not be switched on.
Only the first controller sends a command to the second.
Actually not a complicated thing, electrich seen.
Relatively close depends on perspective - for a chip designer close would be a couple of nanometers, for an astronomer it would be a couple of a light years.
And what are the consequences of failure - either for both to not be running or for both to be running at the same time?
When the input comes to controller 1, the output is to be switched at input two. If this does not work, the second device can switch on and an overload will trigger the fuse.
You are aware LoRaWAN is a lossy network (all radio networks are) where you need to assume up to 25% of packets get lost? That applies to both uplinks and downlinks.
What will happen if unit 1 tells unit 2 to switch off and it doesnât get the message?
A long piece of wire? Two nRF24L01âs? A servo, a piece of string & a switch?
Bear in mind that to make this work with LoRaWAN you have to script something on a server somewhere that sees the uplink and sends a request for a downlink. You could do with with MQTT & Node-RED on a Pi at home or PHP/Python/Java/whatever on an internet server. But you still have to write the code.