Intuit

Neptune

Mar 12th, 2017
249
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. http://wiki.rakwireless.com/doku.php?id=iot-product:rak413
  2. CRC16 / CCITT
  3.  
  4. ---- SEARCH DEVICE ----
  5. broadcast UDP port 6350 DATA: [0x02] [T] [Q] [I] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
  6. see RAKInfo.java in http://wiki.rakwireless.com/lib/exe/fetch.php?media=easyconfig_tool_for_android_sdk.zip
  7.  
  8. ANSWER:
  9. [0-5]
  10. [6-7] Device
  11. [8-10] Version
  12. [11-28] MAC
  13.  
  14. ---- READ SETTINGS  ----
  15. unicast TCP port 6350 DATA: [0x02] [T] [Q] [R] [0x00] [0x00] [CRC16_lo] [CRC16_hi] ([0x02 0x54 0x51 0x52 0x00 0x00 0x2A 0x45])
  16.  
  17. ANSWER:
  18. [3] = [R]
  19. i==6
  20. while (i < ANSWER_LENGTH)
  21. {
  22.     if [i] = [I] //Information
  23.     {
  24.         i+=3
  25.         [(i)-(i+1)] Type of device
  26.         [(i+2)-(i+4)] Version
  27.         i+=5
  28.     }
  29.     else if [i] = [N] //Name
  30.     {
  31.         i+=2
  32.         [i] NAME_LENGTH
  33.         i++
  34.         [i - (i+NAME_LENGTH)] Name UTF-8
  35.         i+=NAME_LENGTH
  36.     }
  37.     else if [i] = [M]  //MAC
  38.     {
  39.         i+=3
  40.         [(i)-(i+17)] MAC
  41.         i+=17
  42.     }
  43.     else if [i] = [A]  //Access
  44.     {
  45.         i+=3
  46.         [i] Access TRUE/FALSE
  47.         i++
  48.     }
  49.     else if [i] = [S]  //Sensor settings
  50.     {
  51.         i+=4
  52.         [i] Valve settings TRUE/FALSE
  53.         i++
  54.         [i] SENSORS_COUNT
  55.         i++
  56.         [i] RELAYS_COUNT
  57.         i++
  58.         [i] Dry TRUE/FALSE
  59.         i++
  60.         [i] Cl flag valve
  61.         i++
  62.         [i] Line in config mode
  63.         i++
  64.         [i] Background status
  65.     }
  66.     else if [i] = [s]  //Status
  67.     {
  68.         i+=4
  69.         [i] Battery
  70.         i++
  71.         [i] Line 0 status
  72.         i++
  73.         [i] Line 1 status
  74.         i++
  75.         [i] Line 2 status
  76.         i++
  77.         [i] Line3 status
  78.         i++
  79.         [i] Attention!
  80.     }
  81.     else
  82.     {
  83.         i++
  84.     }
  85. }
  86.  
  87. ---- GET SENSOR NAMES  ----
  88. unicast TCP port 6350 DATA: [0x02] [T] [Q] [N] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
  89.  
  90. ANSWER:
  91. [3] = [N]
  92. SENSORS_COUNT
  93. i=6
  94. FOR (s  = 0 -> SENSORS_COUNT)
  95. {
  96.     [(i+s*21) - (i+(s+1)*21)] Sensor name Cp1251
  97.     i+=21
  98. }
  99.  
  100. ---- GET SENSOR STATUS ----
  101. unicast TCP port 6350 DATA: [0x02] [T] [Q] [S] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
  102.  
  103. ANSWER:
  104. [3] = [S]
  105. i=7
  106. FOR (s  = 0 -> SENSORS_COUNT)
  107. {
  108.     [i] Sensor[s] signal
  109.     i++
  110.     [i] Sensor[s] line
  111.     i++
  112.     [i] Sensor[s] battary
  113.     i++
  114.     [i] Sensor[s] Attention!
  115.     i++
  116. }
  117.  
  118. ---- GET COUNTER VALUES ----
  119. unicast TCP port 6350 DATA: [0x02] [T] [Q] [C] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
  120.  
  121. ANSWER:
  122. [3] = [C]
  123. i=6
  124. FOR (s  = 0 -> 4)
  125. {
  126.     [(i)-(i+4)] Counter value 32BIT Unsigned
  127.     i+=5
  128. }
  129.  
  130. ---- GET COUNTER NAMES ----
  131. unicast TCP port 6350 DATA: [0x02] [T] [Q] [c] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
  132.  
  133. ANSWER:
  134. [3] = [c]
  135. SENSORS_COUNT
  136. i=6
  137. FOR (s  = 0 -> 4)
  138. {
  139.     [(i+s*21) - (i+(s+1)*21)] Counter name Cp1251
  140.     i+=21
  141. }
  142.  
  143. ---- GET BACKGROUND STATUS ----
  144. unicast TCP port 6350 DATA: [0x02] [T] [Q] [B] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
  145.  
  146. ANSWER:
  147. [3] = [B]
  148. [6] Background status (0 -> -4)
  149.  
  150. ---- WRITE NAME ----
  151. unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+3] [N] [0x00] [] .. NAME < 80 .. [] [CRC16_lo] [CRC16_hi]
  152.  
  153. ---- WRITE SENSOR NAME ----
  154. unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+4] [n] [0x00] [NAME_LENGTH+1] [NUM_SENSOR] [] .. NAME < 21 Cp1251 .. [] [CRC16_lo] [CRC16_hi]
  155.  
  156. ---- WRITE COUNTER NAME ----
  157. unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+4] [c] [0x00] [NAME_LENGTH+1] [NUM_SENSOR] [] .. NAME < 21 Cp1251 .. [] [CRC16_lo] [CRC16_hi]
  158.  
  159. ---- WRITE COUNTER VALUE ----
  160. unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [0x17] [C] [0x00] [0x14] [VALUE_COUNTER1 4BYTE] [STEP_COUNTER1] [VALUE_COUNTER2 4BYTE] [STEP_COUNTER2] [VALUE_COUNTER3 4BYTE] [STEP_COUNTER3] [VALUE_COUNTER4 4BYTE] [STEP_COUNTER4] [CRC16_lo] [CRC16_hi]
  161.  
  162. ---- WRITE SETTINGS ----
  163. ---
  164.  
  165. ---- WRITE WI-FI NAME ----
  166. unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+3] [W] [0x00] [] .. NAME .. [] [CRC16_lo] [CRC16_hi]
  167.  
  168. ---- WRITE WI-FI PASS ----
  169. unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [NAME_LENGTH+3] [P] [0x00] [] .. PASS.. [] [CRC16_lo] [CRC16_hi]
  170.  
  171. ---- RECONNECT ----
  172. unicast TCP port 6350 DATA: [0x02] [T] [Q] [W] [0x00] [0x03] [R] [0x00] [0x00] [CRC16_lo] [CRC16_hi]
  173.  
  174. ---- FIRMWARE ----
  175. ---
Add Comment
Please, Sign In to add comment