Changes for page RS485-LN – RS485 to LoRaWAN Converter User Manual
Last modified by Karry Zhuang on 2025/03/06 16:34
Summary
-
Page properties (1 modified, 0 added, 0 removed)
-
Attachments (0 modified, 0 added, 9 removed)
Details
- Page properties
-
- Content
-
... ... @@ -499,6 +499,7 @@ 499 499 500 500 * (% style="color:#4f81bd" %)**Sensor Related Commands**(%%): These commands are special designed for RS485-LN. User can see these commands below: 501 501 502 + 502 502 === 3.5.1 Common Commands === 503 503 504 504 They should be available for each of Dragino Sensors, such as: change uplink interval, reset device. For firmware v1.3, user can find what common commands it supports: [[End Device AT Commands and Downlink Command>>doc:Main.End Device AT Commands and Downlink Command.WebHome]] ... ... @@ -544,6 +544,7 @@ 544 544 ** if YY>0, RS485-LN will uplink total YY bytes from the output of this RS485 command; Fport=200 545 545 ** if YY=FF, RS485-LN will uplink RS485 output with the downlink command content; Fport=200. 546 546 548 + 547 547 **Example 1** ~-~-> Configure without ask for uplink (YY=0) 548 548 549 549 To connect a Modbus Alarm with below commands. ... ... @@ -572,453 +572,4 @@ 572 572 573 573 [[image:1654159460680-153.png]] 574 574 575 - 576 - 577 -==== **Set Payload version** ==== 578 - 579 -This is the first byte of the uplink payload. RS485-BL can connect to different sensors. User can set the PAYVER field to tell server how to decode the current payload. 580 - 581 -* **AT Command:** 582 - 583 -(% class="box infomessage" %) 584 -((( 585 -**AT+PAYVER: Set PAYVER field = 1** 586 -))) 587 - 588 -* **Downlink Payload:** 589 - 590 -**0xAE 01** ~-~-> Set PAYVER field = 0x01 591 - 592 -**0xAE 0F** ~-~-> Set PAYVER field = 0x0F 593 - 594 - 595 - 596 -==== **Set RS485 Sampling Commands** ==== 597 - 598 -AT+COMMANDx or AT+DATACUTx 599 - 600 -These three commands are used to configure how the RS485-LN polling data from Modbus device. Detail of usage please see : [[polling RS485 device>>||anchor="H3.3.3Configurereadcommandsforeachsampling"]]. 601 - 602 - 603 -* **AT Command:** 604 - 605 -(% class="box infomessage" %) 606 -((( 607 -**AT+COMMANDx: Configure RS485 read command to sensor.** 608 -))) 609 - 610 -(% class="box infomessage" %) 611 -((( 612 -**AT+DATACUTx: Configure how to handle return from RS485 devices.** 613 -))) 614 - 615 - 616 -* **Downlink Payload:** 617 - 618 -**0xAF** downlink command can be used to set AT+COMMANDx or AT+DATACUTx. 619 - 620 -(% style="color:red" %)**Note**(%%): if user use AT+COMMANDx to add a new command, he also need to send AT+DATACUTx downlink. 621 - 622 -Format: AF MM NN LL XX XX XX XX YY 623 - 624 -Where: 625 - 626 -* MM: the ATCOMMAND or AT+DATACUT to be set. Value from 01 ~~ 0F, 627 -* NN: 0: no CRC; 1: add CRC-16/MODBUS ; 2: set the AT+DATACUT value. 628 -* LL: The length of AT+COMMAND or AT+DATACUT command 629 -* XX XX XX XX: AT+COMMAND or AT+DATACUT command 630 -* YY: If YY=0, RS485-BL will execute the downlink command without uplink; if YY=1, RS485-LN will execute an uplink after got this command. 631 - 632 -**Example:** 633 - 634 -(% style="color:#037691" %)**AF 03 01 06 0A 05 00 04 00 01 00**(%%): Same as AT+COMMAND3=0A 05 00 04 00 01,1 635 - 636 -(% style="color:#037691" %)**AF 03 02 06**(% style="color:orange" %)** 10 **(% style="color:red" %)**01 **(% style="color:green" %)**05 06 09 0A**(% style="color:#037691" %)** 00**(%%): Same as AT+DATACUT3=(% style="color:orange" %)**16**(%%),(% style="color:red" %)**1**(%%),(% style="color:green" %)**5+6+9+10** 637 - 638 -(% style="color:#037691" %)**AF 03 02 06 **(% style="color:orange" %)**0B**(% style="color:red" %)** 02 **(% style="color:green" %)**05 07 08 0A **(% style="color:#037691" %)**00**(%%): Same as AT+DATACUT3=(% style="color:orange" %)**11**(%%),(% style="color:red" %)**2**(%%),(% style="color:green" %)**5~~7+8~~10** 639 - 640 - 641 - 642 -==== **Fast command to handle MODBUS device** ==== 643 - 644 -AT+MBFUN is valid since v1.3 firmware version. The command is for fast configure to read Modbus devices. It is only valid for the devices which follow the [[MODBUS-RTU protocol>>url:https://www.modbustools.com/modbus.html]]. 645 - 646 -This command is valid since v1.3 firmware version 647 - 648 -AT+MBFUN can auto read the Modbus function code: 01, 02, 03 or 04. AT+MBFUN has lower priority vs AT+DATACUT command. If AT+DATACUT command is configured, AT+MBFUN will be ignore. 649 - 650 - 651 -**Example:** 652 - 653 -* AT+MBFUN=1 and AT+DATACUT1/AT+DATACUT2 are not configure (0,0,0). So RS485-LN. 654 -* AT+COMMAND1= 01 03 00 10 00 08,1 ~-~-> read slave address 01 , function code 03, start address 00 01, quantity of registers 00 08. 655 -* AT+COMMAND2= 01 02 00 40 00 10,1 ~-~-> read slave address 01 , function code 02, start address 00 40, quantity of inputs 00 10. 656 - 657 -[[image:image-20220602165351-6.png]] 658 - 659 -[[image:image-20220602165351-7.png]] 660 - 661 - 662 - 663 -==== **RS485 command timeout** ==== 664 - 665 -Some Modbus device has slow action to send replies. This command is used to configure the RS485-LN to use longer time to wait for their action. 666 - 667 -Default value: 0, range: 0 ~~ 65 seconds 668 - 669 -* **AT Command:** 670 - 671 -(% class="box infomessage" %) 672 -((( 673 -**AT+CMDDLaa=hex(bb cc)*1000** 674 -))) 675 - 676 -**Example:** 677 - 678 -**AT+CMDDL1=1000** to send the open time to 1000ms 679 - 680 - 681 -* **Downlink Payload:** 682 - 683 -**0x AA aa bb cc** 684 - 685 -Same as: AT+CMDDLaa=hex(bb cc)*1000 686 - 687 - **Example:** 688 - 689 - 0xAA 01 00 01 ~-~-> Same as **AT+CMDDL1=1000 ms** 690 - 691 - 692 - 693 -==== **Uplink payload mode** ==== 694 - 695 -Define to use one uplink or multiple uplinks for the sampling. 696 - 697 -The use of this command please see: [[Compose Uplink payload>>||anchor="H3.3.4Composetheuplinkpayload"]] 698 - 699 -* **AT Command:** 700 - 701 -(% class="box infomessage" %) 702 -((( 703 -**AT+DATAUP=0** 704 -))) 705 - 706 -(% class="box infomessage" %) 707 -((( 708 -**AT+DATAUP=1** 709 -))) 710 - 711 - 712 -* **Downlink Payload:** 713 - 714 -**0xAD 00** **~-~->** Same as AT+DATAUP=0 715 - 716 -**0xAD 01** **~-~->** Same as AT+DATAUP=1 717 - 718 - 719 - 720 -==== **Manually trigger an Uplink** ==== 721 - 722 -Ask device to send an uplink immediately. 723 - 724 -* **AT Command:** 725 - 726 -No AT Command for this, user can press the [[ACT button>>path:#Button]] for 1 second for the same. 727 - 728 - 729 -* **Downlink Payload:** 730 - 731 -**0x08 FF**, RS485-LN will immediately send an uplink. 732 - 733 - 734 734 ==== ==== 735 - 736 -==== **Clear RS485 Command** ==== 737 - 738 -The AT+COMMANDx and AT+DATACUTx settings are stored in special location, user can use below command to clear them. 739 - 740 -* **AT Command:** 741 - 742 -**AT+CMDEAR=mm,nn** mm: start position of erase ,nn: stop position of erase 743 - 744 -Etc. AT+CMDEAR=1,10 means erase AT+COMMAND1/AT+DATACUT1 to AT+COMMAND10/AT+DATACUT10 745 - 746 -Example screen shot after clear all RS485 commands. 747 - 748 - 749 -The uplink screen shot is: 750 - 751 -[[image:1654160691922-496.png]][[image:file:///C:/Users/93456/AppData/Local/Temp/msohtmlclip1/01/clip_image001.png]] 752 - 753 - 754 -* **Downlink Payload:** 755 - 756 -**0x09 aa bb** same as AT+CMDEAR=aa,bb 757 - 758 - 759 - 760 -==== **Set Serial Communication Parameters** ==== 761 - 762 -Set the Rs485 serial communication parameters: 763 - 764 -* **AT Command:** 765 - 766 -Set Baud Rate: 767 - 768 -(% class="box infomessage" %) 769 -((( 770 -**AT+BAUDR=9600** ~/~/ Options: (1200,2400,4800,14400,19200,115200) 771 -))) 772 - 773 -Set UART Parity 774 - 775 -(% class="box infomessage" %) 776 -((( 777 -**AT+PARITY=0** ~/~/ Option: 0: no parity, 1: odd parity, 2: even parity 778 -))) 779 - 780 -Set STOPBIT 781 - 782 -(% class="box infomessage" %) 783 -((( 784 -**AT+STOPBIT=0** ~/~/ Option: 0 for 1bit; 1 for 1.5 bit ; 2 for 2 bits 785 -))) 786 - 787 - 788 -* **Downlink Payload:** 789 - 790 -**A7 01 aa bb**: Same AT+BAUDR=hex(aa bb)*100 791 - 792 -**Example:** 793 - 794 -* A7 01 00 60 same as AT+BAUDR=9600 795 -* A7 01 04 80 same as AT+BAUDR=115200 796 - 797 -A7 02 aa: Same as AT+PARITY=aa (aa value: 00 , 01 or 02) 798 - 799 -A7 03 aa: Same as AT+STOPBIT=aa (aa value: 00 , 01 or 02) 800 - 801 - 802 -== 3.6 Listening mode for RS485 network == 803 - 804 -This feature support since firmware v1.4 805 - 806 -RS485-LN supports listening mode, it can listen the RS485 network packets and send them via LoRaWAN uplink. Below is the structure. The blue arrow shows the RS485 network packets to RS485-LN. 807 - 808 -[[image:image-20220602171200-8.png||height="567" width="1007"]] 809 - 810 -To enable the listening mode, use can run the command AT+RXMODE. 811 - 812 - 813 -(% border="1" style="background-color:#ffffcc; width:500px" %) 814 -|=(% style="width: 161px;" %)**Command example:**|=(% style="width: 337px;" %)**Function** 815 -|(% style="width:161px" %)AT+RXMODE=1,10 |(% style="width:337px" %)Enable listening mode 1, if RS485-LN has received more than 10 RS485 commands from the network. RS485-LN will send these commands via LoRaWAN uplinks. 816 -|(% style="width:161px" %)AT+RXMODE=2,500|(% style="width:337px" %)Enable listening mode 2, RS485-LN will capture and send a 500ms content once from the first detect of character. Max value is 65535 ms 817 -|(% style="width:161px" %)AT+RXMODE=0,0|(% style="width:337px" %)Disable listening mode. This is the default settings. 818 -|(% style="width:161px" %) |(% style="width:337px" %)A6 aa bb cc same as AT+RXMODE=aa,(bb<<8 ~| cc) 819 - 820 -**Downlink Command:** 821 - 822 -**0xA6 aa bb cc ** same as AT+RXMODE=aa,(bb<<8 | cc) 823 - 824 - 825 -**Example**: 826 - 827 -The RS485-LN is set to AT+RXMODE=2,1000 828 - 829 -There is a two Modbus commands in the RS485 network as below: 830 - 831 -The Modbus master send a command: (% style="background-color:#ffc000" %)01 03 00 00 00 02 c4 0b 832 - 833 -And Modbus slave reply with: (% style="background-color:green" %)01 03 04 00 00 00 00 fa 33 834 - 835 -RS485-LN will capture both and send the uplink: (% style="background-color:#ffc000" %)01 03 00 00 00 02 c4 0b (% style="background-color:green" %)01 03 04 00 00 00 00 fa 33 836 - 837 -[[image:image-20220602171200-9.png]] 838 - 839 - 840 -(% style="color:red" %)Notice: Listening mode can work with the default polling mode of RS485-LN. When RS485-LN is in to send the RS485 commands (from AT+COMMANDx), the listening mode will be interrupt for a while. 841 - 842 - 843 -== 3.7 Buttons == 844 - 845 - 846 -(% border="1" style="background-color:#f7faff; width:500px" %) 847 -|=**Button**|=(% style="width: 1420px;" %)**Feature** 848 -|**ACT**|(% style="width:1420px" %)If RS485 joined in network, press this button for more than 1 second, RS485 will upload a packet, and the SYS LED will give a (% style="color:blue" %)**Blue blink** 849 -|**RST**|(% style="width:1420px" %)Reboot RS485 850 -|**PRO**|(% style="width:1420px" %)Use for upload image, see [[How to Update Image>>path:#upgrade_image]] 851 - 852 -== 3.8 LEDs == 853 - 854 -(% border="1" style="background-color:#f7faff; width:500px" %) 855 -|=**LEDs**|=**Feature** 856 -|**PWR**|Always on if there is power 857 -|**SYS**|After device is powered on, the SYS will (% style="color:green" %)**fast blink in GREEN** (%%)for 5 times, means RS485-LN start to join LoRaWAN network. If join success, SYS will be (% style="color:green" %)**on GREEN for 5 seconds**(%%)**. **SYS will (% style="color:green" %)**blink Blue**(%%) on every upload and (% style="color:green" %)**blink Green**(%%) once receive a downlink message. 858 - 859 - 860 -= 4. Case Study = 861 - 862 -User can check this URL for some case studies: [[APP RS485 COMMUNICATE WITH SENSORS>>doc:Main.Application Note \: Communicate with Different Sensors ----- RS485-LN RS485-BL.WebHome]] 863 - 864 - 865 -= 5. Use AT Command = 866 - 867 -== 5.1 Access AT Command == 868 - 869 -RS485-BL supports AT Command set. User can use a USB to TTL adapter plus the 3.5mm Program Cable to connect to RS485-BL to use AT command, as below. 870 - 871 -[[image:1654162355560-817.png]] 872 - 873 - 874 -In PC, User needs to set (% style="color:blue" %)**serial tool**(%%)(such as [[putty>>url:https://www.chiark.greenend.org.uk/~~sgtatham/putty/latest.html]], SecureCRT) baud rate to (% style="color:green" %)**9600**(%%) to access to access serial console of RS485-BL. The default password is 123456. Below is the output for reference: 875 - 876 -[[image:1654162368066-342.png]] 877 - 878 - 879 -More detail AT Command manual can be found at [[AT Command Manual>>||anchor="3.5ConfigureRS485-BLviaATorDownlink"]] 880 - 881 - 882 -== 5.2 Common AT Command Sequence == 883 - 884 -=== 5.2.1 Multi-channel ABP mode (Use with SX1301/LG308) === 885 - 886 -If device has not joined network yet: 887 - 888 -(% class="box infomessage" %) 889 -((( 890 -**AT+FDR** 891 -))) 892 - 893 -(% class="box infomessage" %) 894 -((( 895 -**AT+NJM=0** 896 -))) 897 - 898 -(% class="box infomessage" %) 899 -((( 900 -**ATZ** 901 -))) 902 - 903 - 904 -If device already joined network: 905 - 906 -(% class="box infomessage" %) 907 -((( 908 -**AT+NJM=0** 909 -))) 910 - 911 -(% class="box infomessage" %) 912 -((( 913 -**ATZ** 914 -))) 915 - 916 - 917 -=== 5.5.2 Single-channel ABP mode (Use with LG01/LG02) === 918 - 919 - 920 -(% style="background-color:#dcdcdc" %)**AT+FDR** (%%) Reset Parameters to Factory Default, Keys Reserve 921 - 922 -(% style="background-color:#dcdcdc" %)**AT+NJM=0 **(%%)Set to ABP mode 923 - 924 -(% style="background-color:#dcdcdc" %)**AT+ADR=0** (%%)Set the Adaptive Data Rate Off 925 - 926 -(% style="background-color:#dcdcdc" %)**AT+DR=5** (%%)Set Data Rate 927 - 928 -(% style="background-color:#dcdcdc" %)**AT+TDC=60000** (%%) Set transmit interval to 60 seconds 929 - 930 -(% style="background-color:#dcdcdc" %)**AT+CHS=868400000**(%%) Set transmit frequency to 868.4Mhz 931 - 932 -(% style="background-color:#dcdcdc" %)**AT+RX2FQ=868400000** (%%) Set RX2Frequency to 868.4Mhz (according to the result from server) 933 - 934 -(% style="background-color:#dcdcdc" %)**AT+RX2DR=5** (%%) Set RX2DR to match the downlink DR from server. see below 935 - 936 -(% style="background-color:#dcdcdc" %)**AT+DADDR=26** (%%) 01 1A F1 Set Device Address to 26 01 1A F1, this ID can be found in the LoRa Server portal. 937 - 938 -(% style="background-color:#dcdcdc" %)**ATZ** (%%) Reset MCU 939 - 940 - 941 -(% style="color:red" %)**Note:** 942 - 943 -(% style="color:red" %)1. Make sure the device is set to ABP mode in the IoT Server. 944 -2. Make sure the LG01/02 gateway RX frequency is exactly the same as AT+CHS setting. 945 -3. Make sure SF / bandwidth setting in LG01/LG02 match the settings of AT+DR. refer [[this link>>url:http://www.dragino.com/downloads/index.php?dir=LoRa_Gateway/&file=LoRaWAN%201.0.3%20Regional%20Parameters.xlsx]] to see what DR means. 946 -4. The command AT+RX2FQ and AT+RX2DR is to let downlink work. to set the correct parameters, user can check the actually downlink parameters to be used. As below. Which shows the RX2FQ should use 868400000 and RX2DR should be 5 947 - 948 -[[image:1654162478620-421.png]] 949 - 950 - 951 -= 6. FAQ = 952 - 953 -== 6.1 How to upgrade the image? == 954 - 955 -The RS485-LN LoRaWAN Controller is shipped with a 3.5mm cable, the cable is used to upload image to RS485-LN to: 956 - 957 -* Support new features 958 -* For bug fix 959 -* Change LoRaWAN bands. 960 - 961 -Below shows the hardware connection for how to upload an image to RS485-LN: 962 - 963 -[[image:1654162535040-878.png]] 964 - 965 -**Step1:** Download [[flash loader>>url:https://www.st.com/content/st_com/en/products/development-tools/software-development-tools/stm32-software-development-tools/stm32-programmers/flasher-stm32.html]]. 966 - 967 -**Step2**: Download the [[LT Image files>>url:http://www.dragino.com/downloads/index.php?dir=LT_LoRa_IO_Controller/LT33222-L/image/]]. 968 - 969 -**Step3: **Open flashloader; choose the correct COM port to update. 970 - 971 -(% style="color:#037691" %) Hold down the PRO button and then momentarily press the RST reset button and the SYS led will change from OFF to ON, While SYS LED is RED ON, it means the RS485-LN is ready to be program. 972 - 973 -[[image:image-20220602102605-1.png]] 974 - 975 - 976 -[[image:image-20220602102637-2.png]] 977 - 978 - 979 -[[image:image-20220602102715-3.png]] 980 - 981 - 982 -== 6.2 How to change the LoRa Frequency Bands/Region? == 983 - 984 -User can follow the introduction for [[how to upgrade image>>||anchor="H6.1Howtoupgradetheimage3F"]]. When download the images, choose the required image file for download. 985 - 986 - 987 -== 6.3 How many RS485-Slave can RS485-BL connects? == 988 - 989 -The RS485-BL can support max 32 RS485 devices. Each uplink command of RS485-BL can support max 16 different RS485 command. So RS485-BL can support max 16 RS485 devices pre-program in the device for uplink. For other devices no pre-program, user can use the [[downlink message (type code 0xA8) to poll their info>>||anchor="H3.3.3Configurereadcommandsforeachsampling"]]. 990 - 991 - 992 - 993 -= 7. Trouble Shooting = 994 - 995 - 996 -== 7.1 Downlink doesn’t work, how to solve it? == 997 - 998 -Please see this link for debug: [[LoRaWAN Communication Debug>>doc:Main.LoRaWAN Communication Debug.WebHome]] 999 - 1000 - 1001 -== 7.2 Why I can’t join TTN V3 in US915 /AU915 bands? == 1002 - 1003 -It might about the channels mapping. Please see for detail: [[Notice of Frequency band>>doc:Main.LoRaWAN Communication Debug.WebHome||anchor="H2.NoticeofUS9152FCN4702FAU915Frequencyband"]] 1004 - 1005 - 1006 -= 8. Order Info = 1007 - 1008 -(% style="color:blue" %)**Part Number: RS485-BL-XXX** 1009 - 1010 -(% style="color:blue" %)**XXX:** 1011 - 1012 -* (% style="color:blue" %)**EU433**(%%): frequency bands EU433 1013 -* (% style="color:blue" %)**EU868**(%%): frequency bands EU868 1014 -* (% style="color:blue" %)**KR920**(%%): frequency bands KR920 1015 -* (% style="color:blue" %)**CN470**(%%): frequency bands CN470 1016 -* (% style="color:blue" %)**AS923**(%%): frequency bands AS923 1017 -* (% style="color:blue" %)**AU915**(%%): frequency bands AU915 1018 -* (% style="color:blue" %)**US915**(%%): frequency bands US915 1019 -* (% style="color:blue" %)**IN865**(%%): frequency bands IN865 1020 -* (% style="color:blue" %)**RU864**(%%): frequency bands RU864 1021 -* (% style="color:blue" %)**KZ865**(%%): frequency bands KZ865 1022 - 1023 -(% class="wikigeneratedid" %) 1024 -
- 1654160691922-496.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -109.3 KB - Content
- 1654162355560-817.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -670.0 KB - Content
- 1654162368066-342.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -192.9 KB - Content
- 1654162478620-421.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -158.9 KB - Content
- 1654162535040-878.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -670.0 KB - Content
- image-20220602165351-6.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -10.6 KB - Content
- image-20220602165351-7.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -19.3 KB - Content
- image-20220602171200-8.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -276.1 KB - Content
- image-20220602171200-9.png
-
- Author
-
... ... @@ -1,1 +1,0 @@ 1 -XWiki.Xiaoling - Size
-
... ... @@ -1,1 +1,0 @@ 1 -10.0 KB - Content