1. Home
  2. RN17X Family Help
  3. How to connect HTTP web server and RN17x
  1. Home
  2. Developing a radio node
  3. How to connect HTTP web server and RN17x

How to connect HTTP web server and RN17x

Thank you for purchasing the DEKIST RN17x product.

The RN17x model is a transmitter designed to support HTTP. Therefore, it is possible to build a monitoring environment that links the web server developed by the customer and the transmitter.

This section describes how to configure the Radionode RN171 / RN172 product with a web server developed by the customer. This is the Radionode V2 protocol.

– What a web server developer should do

In order to receive the measurement data of RN17X from the customer's web server, the radio node protocol V2, an application that handles both CHECK-IN and DATA-IN functions, must be implemented in the customer's web server.
The customer must create an application that receives parameters from HTTP GET/POST and stores them in the DB.

  • CHECK-IN: When the device is turned on or in use, the device information (mac address, IP address, etc.) is periodically transmitted and time synchronization is performed.
  • DATA-IN: It performs the function of periodically transmitting the sensor values ​​of all channels along with time information during use. The time information uses UNIX TimeStamp.

To implement the above Radionode Protocol V2 DocumentationPlease refer to The RN400 and RN17X use the same protocol.

Setting server information on RN17X

1.Connect RN17X and PC with a USB cable. No separate power source is required. When the screen displays CONF, the USB setup is ready.

2. Run the Radionode terminal program. If it turns green, it is normal.

3. Enter the password radionode114 and enter the console menu.

4. Enter the “2.System Setup” menu and select “B.Set Destination of HTTP”. Choose “3:CUSTOMER_V2″ from the 2 destinations. You have chosen the destination of your data as a custom server V2.

5. Select “4.HTTP Destination Setup” to set the server address and application. Enter the HTTP server IP or domain address and port number here.

6. Checkin and Datain of the two applications of the server mentioned above are also set in “2.HTTP Destination Setup”. Enter the path of the application file developed by the user in “D.HTTP CHECKIN File”. For example, enter “radionode/checkin.php”. Similarly for “F.HTTP DATAIN File”, enter a custom URL <eg, “radionode/datain.php”> to prepare the RN4X to send data to a specific path on the server.

7. All settings are completed. Rebooting the device will periodically send data to the URL entered by the user. The RN17X offers a choice of transmission cycles from 1 to 60 minutes. The default value is 5 minutes.

8. When disconnected from the network, the RN171 stores the measured data in its internal memory. If there is stored data, the RN171 will retry the data transmission every 1 minute and 30 seconds. When an internet connection is available, the data stored in memory is sent back to the server using the datain method.

Reference

C# example file download

RADIONODE Test Server address that can be entered on the RN17X device

Since it is a TEST SERVER that can check HTTP connections, it is not suitable for long-term testing purposes.
Host: http://52.192.181.203 

Port: 80

Datain URL: /datain.php

Checkin URL: /checkin.php

Check the last value entered into the device:  http://52.192.181.203/cur.php
Check the latest values ​​entered into the device:  http://52.192.181.203/history.php

Precautions

/ (forward slash) is entered by default when entering values ​​in the Datain URL and Checkin URL on the console of the RN17X device. Please be careful not to enter duplicates.

Apache is recommended as the web server to use. In the case of NGNIX server, there is no Content-Length: information in the HTTP header information in the default setting. If there is no Content-Length, RN400 cannot respond normally. Therefore, Content-Length must be added to the HTTP Header information in the application.


You need to pay attention to the encoding method in your code.

python 
self.__connection.write((line.strip() + "\r\n").encode("ASCII"))

C#
//Write the response info
byte[] data = Encoding.ASCII.GetBytes(respData);
resp.ContentType = "text/xml";
resp.ContentEncoding = Encoding.ASCII;
resp.ContentLength64 = data.LongLength;










                    

Updated on January 2023, 7

Was this article helpful?

Related Articles

Leave a Comment