In the next step,




Configuration of a soil moisture sensor CWT on Dragino RS485-BL completely via downlinks.
The lines marked with *** represent the downlinks that were actually sent.
http://wiki.dragino.com/xwiki/bin/view/Main/User Manual for LoRaWAN End Nodes/test/
per Downlink:
http://wiki.dragino.com/xwiki/bin/view/Main/User Manual for LoRaWAN End Nodes/test/#H3.5ConfigureRS485-BLviaATorDownlink
In TTN eingerichet
Join akezepted
AT+FDR
04FE
Factory Defaults
(wohl unnötig)
AT+TDC=180000
3 Minuten Intervall
AT+TDC=60000
(60=003C)
0100003C ***
AT+MOD=1
0A01 ***
Set to support RS485-MODBUS type sensors
AT+BAUDR=4800
A7010030 ***
HEX 30 = DEC 48
BaudRate
AT+COMMAND1=01 03 00 00 00 03,1
01 03 00 00 00 03 ,1
Slave 01 03(Read) Start Register How much Register (03) Add CFG
AF MM NN LL XX XX XX XX YY
MM 01 (AT+COMMAND1)
NN 01 (ADD CRC)
LL 06 (Length of AT Command) (01 03 00 00 00 03)
01 02 03 04 05 06
XX MODBUS Command (01 03 00 00 00 03)
YY Length of Uplink Answer (00 no answer)
AF01010601030000000300 ***
AF 01 01 06 010300000003 00
AT+Command 01 ADD_CRC Lenght_MdCmd MdCmd No_Answer
AT+5VT=3000
07010BB8 ***
HEX 0BB8 = DEC 3000
V5 VCC Vorlauf in ms
AT+MBFUN=1
A901 ***
Start Modbus
ATZ
04FF ***
Reset
Intervall auf 20 Min
20Min = 01 00 04 B0 ***
function Decoder(bytes, port) {
var decoded ={};
// 00 01 02 03 04 05 06 07 08 09 10 11 12 Byte
// 0D 4E 01 03 E8 00 BD 01 66
// Batt Mois Temp Condu
// Test payload 0D4E0103E800BD0166
// Time Interval Einstellung: Messaging, Downlink, Port 1, replace Downlink, Bytes
// 3 Std = 01 00 2A 30
// 1 Std = 01 00 0E 10
// 20Min = 01 00 04 B0
// andere Zeiten Sekunden in HEX umwandeln und hinter 01 00 hängen
if( port == 2 ){
decoded.port = port;
//Battery
decoded.volt = (bytes[0]<<8 | bytes[1]) /1000;
// Soil Sensor
decoded.soilmoisture = (bytes[3]<<8 | bytes[4]) /10;
decoded.soiltemperature = (bytes[5]<<8 | bytes[6]) /10;
decoded.soilconductivity = (bytes[7]<<8 | bytes[8]) ;
}
//if( port == 21 )
//decoded.port = port;
// decoded.voltage = uint16_BE (bytes[1]<<8 | bytes[2]) / 1000;
return decoded;
}

For potted plants with lots of flowers, we recommend fertilizing with a good NPK ratio: 10-05-15 (NPK = nitrogen, phosphorus, potassium)
https://www.dypcn.com/uploads/A02-Output-Interfaces.pdf
VCC Red 3-5V DC
Minus Black
White A
Yellow B
Read real time distance
01 03 01 01 01
Read temperature
01 03 01 02 01
Both
Send
01 03 01 01 02
Received
01 03 04 08 AC 00 F8
08AC = 2220mm (222 cm)
00F8 = 248 (24,8 Grad)
Dragino DL Config
Intervall 1 Min:
0100003C ***
Modbus RS485 true:
0A01 ***
Baud Rate 9600
A7010060 ***
////////////////////////////////////////////////////////
// AT Command1 01 03 01 01 00 02
AT+COMMAND1
01 03 01 07 01 02,1
AF MM NN LL XX XX XX XX YY
MM 01 (AT+COMMAND1)
NN 01 (ADD CRC)
LL 06 (Length of AT Command) (01 03 00 00 00 02)
XX MODBUS Command (01 03 00 00 00 03)
YY Length of Uplink Answer (00 no answer)
AF 01 01 06 01 03 01 01 00 02 00
////////////////////////////////////////////////////////
// AF01010601030016000200
AF01010601030101000200 ***
AT+5VT=3000
07010BB8 ***
HEX 0BB8 = DEC 3000
V5 VCC Vorlauf in ms
Start Modbus
A901 ***
Reset
04FF ***
Intervall 5 Min (300 SEC)
0100012C ***