1 Overview 1.1 Module Introduction RAK411 module is a Wi-Fi module that fully compliant with IEEE 802.11b/g/n wireless standards, with internally integrated TCP / IP protocol stack, supporting numerous protocols such as ARP, IP, ICMP, TCP, UDP, DHCP CLIENT, DHCP SERVER, DNS and other etc. It supports AP mode, Station mode and Ad-hoc and mode.
RAK411 PROGRAMMING MANUAL V1.7 On-board ceramic antenna or U.FL antenna connector Operating voltage: 3.3V 4 kinds power working modes, with minimum power consumption as 1-2uA Small package size: 28.75mmX23.14mmX3.40mm FCC, RoHS and CE compliant 1.3 Key Applications Portable products ...
RAK411 PROGRAMMING MANUAL V1.7 2 Functional Description 2.1 HW Interface Support clock 16MHz Maximum Interface actual throughput up to 2Mbps Four-wire SPI interface, support SPI data interrupt pin 2.2 Wireless Driver Compliant with IEEE 802.11b/g/n standards ...
RAK411 PROGRAMMING MANUAL V1.7 3 SPI Interface RAK411 communicates with the host through a standard 4-wire SPI interface. SPI clock supports maximum 16MHZ and optional SPI-INT pin. The SPI interface configuration diagram is as follows: 3.1 Hardware Connection 3.2 SPI Timing Diagram...
V1.7 3.3 Interrupt Pin RAK411 provides an optional INT pin, so that the host can quickly respond to module data requests via the INT pin. The normal INT pin is low level voltage, when there is abnormal data to be sent, the module pulls INT to high level. After the host receives the rising edge, the module can read the data by sending read frames directly.After reading a package, INT pin goes low.
RAK411 PROGRAMMING MANUAL V1.7 3.4.2 Read Status Description: 1.The Host end loop sends the Head CMD to the module, and the sending process requires a query if there is received ACK (0x85) . 2.If received CMD then stop the current Head ACK send.
RAK411 PROGRAMMING MANUAL V1.7 3.4.3 Read Data Description: 1.The Host end loop sends the Head CMD to the module, and the sending process requires a query if there is received ACK (0x85) . 2.If received CMD then stop the current Head ACK send.
RAK411 PROGRAMMING MANUAL V1.7 3.4.4 Write Data Description: 1.The Host end loop sends the Head CMD to the module, and the sending process requires a query if there is received ACK (0x85) . 2.If received CMD then stop the current Head ACK send.
RAK411 PROGRAMMING MANUAL V1.7 reference "4.2.1 scanning wireless network" and "4.1.2 query software version" command. 3.4.5 Command example Set the network channel command, channel set to 7 1.CMD to fill in the corresponding set channel command code 0xAB. 2.0x97 fixed.
Page 14
RAK411 PROGRAMMING MANUAL V1.7 Description: 1.The Host terminal loop sends the Head CMD to the module of the "set channel" command code 0xAB, sending process requires query whether received ACK (0x85). 2.If received CMD then stop the current Head ACK send.
RAK411 PROGRAMMING MANUAL V1.7 3.4.6 Status Register Description: Here is the byte of status read, the last two bits representative the data type of module feedback. Bit7: SPI_STATUS Bit6: reserve Bit5: reserve Bit4: reserve Bit3: Send_full, Indicates that the module is unable to respond to the command...
RAK411 PROGRAMMING MANUAL V1.7 3.5 Boot RAK411’s reboot time is about 210ms. After a normal start, the host sends the initialization command, and the module will return start information: ASCII------- Welcome to RAK411 HEX-------- 57 65 6C 63 6F 6D 65 20 74 6F 20 52 41 4B 34 31 31 3.6 Power Mode...
3.7 Operational Process RAK411 SPI command operation feature completes a few basic steps of WIFI communication, including network scanning, joining network and obtaining an IP address, and eventually establishing Socket communication. RAK411 provides a variety of convenient operation to implement networking, so that customers can easily complete the network configuration, and concentrate on the management of socket and their own data protocols.
RAK411 PROGRAMMING MANUAL V1.7 rak_socket_close Close an opened socket handle rak_get_tcps Gets the number and the information for the tcp sever to connect to client rak_send_data Send data to an opened socket handle rak_read_data Read command returns / network data /...
RAK411 PROGRAMMING MANUAL V1.7 4.1.2 Checking Software Version Command: rak_get_version Syntax: uint32_tcmd; Parameter: Parameter Bytes Value Description 0xBE,0x00,0x00,0x00 Command Code Parameter: It is used to check module versions, including versions of host and WLAN. Return Value: Parameter Bytes Value Description <CODE>...
RAK411 PROGRAMMING MANUAL V1.7 powermode 0--3 Power mode Parameter: It is used to set module power mode.Detailed reference “3.6 power mode ”. Return Value: N/A 4.1.4 Reading Module Status Command: rak_read_status Syntax: uint32_t cmd; Parameter: Parameter Bytes Value Description 0xA1,0x00,0x00,0x00...
RAK411 PROGRAMMING MANUAL V1.7 Description: Use the command to upgrade the module firmware. A firmware file is required to generate an array of bytes by means of the tool, and then load in the host code (approximately 500KByte). After the host code through this command array data packets are sent into the internal module.
RAK411 PROGRAMMING MANUAL V1.7 Description: It is used to connect an AP/ADHOC network or establish a specified AP Network. Return Value: Parameter Bytes Value Description <CODE> 0xA6,0x00 Response Code <STATUS> Command successful Cannot find the SSID Command failed 4.2.6 Configuring Static IP Address...
RAK411 PROGRAMMING MANUAL V1.7 DHCP CLENT: Parameter Bytes Value Description <CODE> 0xAC,0x00 Response Code <MAC> MAC address <ADDR> IP address <MASK> Subnet mask <GW> Gateway <DNS1> DNS server 1 <DNS2> DNS server 2 <STATUS> Command successful Command failed Get ip information failure 4.2.8 Connecting Network by Easyconfig...
RAK411 PROGRAMMING MANUAL V1.7 Return Value: Parameter Bytes Value Description <CODE> 0xA7,0x00 Response Code Command successful <STATUS> Command failed 4.2.11 Querying module IP information Command: rak_ipconfig_query Syntax: uint32_t cmd; Parameter: Parameter Bytes Value Description 0xAE,0x00,0x00,0x00 Command Code Description:: It is used to get module IP information, including MAC address, IP address, subnet mask, gateway, and DNS server.
RAK411 PROGRAMMING MANUAL V1.7 4.2.12 Getting Network Signal Strength Command: rak_get_rssi Syntax: uint32_t cmd; Parameter: Parameter Bytes Value Description 0xA9,0x00,0x00,0x00 Command Code Description: It is used to get the current signal strength of the network. Return Value: Parameter Bytes Value Description <CODE>...
RAK411 PROGRAMMING MANUAL V1.7 Description: It is used to convert domain to the corresponding IP address, the domain must be configured available DNS server. Return Value: Parameter Bytes Value Description <CODE> 0xAF,0x00 Response Code <ADDR> Ip address <STATUS> Command successful DNS resolution failure 4.2.14 PING...
RAK411 PROGRAMMING MANUAL V1.7 rak_disconnect Syntax: uint32_t cmd; Parameter: Parameter Bytes Value Description 0xB7,0x00,0x00,0x00 Command Code Description: It is used to disconnect the current wireless network. Return Value: Parameter Bytes Value Description <CODE> 0xB7,0x00 Response Code <STATUS Command successful Current network is disconnected 4.3 Socket Operation Commands...
RAK411 PROGRAMMING MANUAL V1.7 Description: Module as a TCP server and create a listening port, if the operation is successful, the module will return a hexadecimal identifier (Socket ID), is used to manage the connection. Establish a TCP server can connect up to seven clients. Establish a TCP server on a different port, allows you to create up to four.
RAK411 PROGRAMMING MANUAL V1.7 local_port 0-65535 Local port number Description: This command is to create a TCP CLIENT and connect with the remote TCP SERVER, if the operation is successful, the module will return a hexadecimal identifier that is used to manage the connection.
RAK411 PROGRAMMING MANUAL V1.7 dest_port 1-65535 Target port number local_port 0-65535 Local port number Description: This command is to create a UDP port on the module and set remote IP address and port number, if you create successful, the module will return a hexadecimal identifier that is used to manage the connection.
RAK411 PROGRAMMING MANUAL V1.7 Description: Returns a hexadecimal after this command is to create a UDP listening locally on the specified port, create success identifier (Socket ID), waiting to receive the remote port data. If the remote port to send data to this port, the received data will be included in each other's IP and port information;...
RAK411 PROGRAMMING MANUAL V1.7 Parameter Bytes Value Description 0xC4,0x00,0x00,0x00 Command code dest_addr 224.0.0.1-239.255.255.255 Target multicast address dest_port 1-65535 Target port number local_port 1-65535 Local port number Description: This command is to create a UDP multicast socket on the module, you can specify the multicast IP multicast, in the group for data communications.
RAK411 PROGRAMMING MANUAL V1.7 0xCD,0x00,0x00,0x00 Command Code tcpsever_flag 8-11 Query corresponding TCP server Description: By identifier corresponding server, TCP server queries the number of client connections,and client information. Return Value: Parameter Bytes Value Description <CODE> 0xCD,0x00 Response Code The maximum number of connections <TCP_NUM>...
RAK411 PROGRAMMING MANUAL V1.7 Description: It is used to close the already opened socket identifier,Close port monitoring or connection. Return Value: Parameter Bytes Value Description <CODE> 0xB5,0x00 Response Code Command successful <STATUS> Specified port does not exist Disable to close 4.3.8 Sending Data...
RAK411 PROGRAMMING MANUAL V1.7 Description: This command is used to send data to the target (port identifier), the maximum data length is 1400, buffer can be data in any format, module will send data without any treatment. If the connection is a TCP connection, then the destination IP and destination port can be omitted, entered with value 0.
RAK411 PROGRAMMING MANUAL V1.7 dummy Null data ip_param IP parameters ap_config AP advanced parameters Description: It is used to save user parameters, including password, SSID, IP address, and scan information. Return Value: Parameter Bytes Value Description <CODE> 0xC0,0x00 Response Code Command successful <STATUS>...
RAK411 PROGRAMMING MANUAL V1.7 Description: It is used to start the embedded WEB service. Module will start the WEB with default parameters,typically in AP mode. When user is added, user can use the browser to configure the module parameters for wireless modules or wireless firmware upgrade.
Page 54
RAK411 PROGRAMMING MANUAL V1.7 <CHANNEL> 0-13 Channel <sec_mode> Network is not encrypted Network is encrypted <dhcp_mode> STA:DHCP client STA:ip static <ssid> Network identifier <psk> Network key <DUMMY> Null data <ip_param> IP parameters <ap_config> AP parameters <STATUS> Command successful Command failed, or timeout Related parameters:...
Page 55
RAK411 PROGRAMMING MANUAL V1.7 Parameter Bytes Value Description 0Xba,0x00,0x00,0x00 Command Code Description: This command is available to save network parameters. Return Value: Parameter Bytes Value Description <CODE> 0xba,0x00 Response Code params Network parameters User_name User name User_psk Network encryption Password <STATUS>...
Page 56
RAK411 PROGRAMMING MANUAL V1.7 parameter Bytes Value Description addr IP address mask Subnet mask Gateway dnssvr1 DNS serve 1 dnssvr2 DNS serve 2 Ap_config parameter Bytes Value Description hidden Network name is visible The network name is not visible countrycode...
RAK411 PROGRAMMING MANUAL V1.7 6 Revision History Version Author Modification Date 2014-03-11 V1.0 Initial Draft Modify draft and release 2014-03-28 V1.1 Modify command returns status, data structure 2014-06-09 V1.2 Update the contact way,Update the document format 2014-08-22 V1.3 1. Add a new command rak_tcpsever_status (check TCP server connections) and description 2.