Programing for SIF - 1. Creating connection

Tagged:  

This example will show, how to create connection with ConnectOne module. Basics are same for both type of modules (wifi or lan) and only different is because setting SSID and access key with wifimodule.
For first steps and be easy friends with AT+i commands is helpfull to use terminal from example in basics with basic 1
All modules are using modificated AT commads and this command allways start with AT+i followed by some setting and finished by CR string. For more informations, please look to programing manual in download center.

Than, connect your sif, load terminal and we can start

First of all we have to set SIF UART2. Luckily ConnectOne module support auto baud rate detection and than we only need to set data and stop bits in correct way on SIF side. I am using 115200baud, 8bits, 1stop, no parity, RTS/CTS HW flow control. After this setting of UART and SIF we can try to connect to module.

Module is after reset expecting 'a' or 'A' character, by this characted is device detecting speed and this character is also read. Because all comands starts with AT+i we can easy send only this characters followed by CR and if everything is OK modul will reply with I/OK.

If you have response we should adjust HW flow control at module. This will be done by command AT+iFLW=7 and CR. Setting will be confirmed by I/OK and now is module using RTS and CTS flow control.

After this settings we can connect module to our network. LAN module do this automaticaly, but at WiFi module we have to set SSID and security. Than first of all we will scan networks by command AT+iRP11. Modul will reply list of all access points in range by format: "ssid, security,signal". To set SSID in module use command AT+iWLSI=ssid and CR.
If you want to use WEP encryption configure follow parameters
AT+iWLWM=n
   n=0 for no security
   n=1 for 64 bit key
   n=2 for 128 bit key
AT+iWLKI=n where "n" is key index
AT+iWLKn=key where "n" is key index and "key" is your key string
For WPA encryption configure this set of parameters
AT+iWLPP=passhrase where passphrase is your pass-phrase

If you reach this point final task is command AT+iDOWN which will restart module and connect to your network.

Module is in basic setting set to use DHCP and than if you also use DHCP in your network, use command AT+iIPA? and module will reply with current IP adress.
In case od FIX IP address you have to specifi this by command AT+iIPA=xxx.xxx.xxx.xxx where xxx.xxx.xxx.xxx is your requested address and also by AT+iIPG=xxx.xxx.xxx.xxx for default gateway and also by AT+iSNET=xxx.xxx.xxx.xxx for your subnet.
Each command will be confirmed by I/OK and after all settings is neccessary to restart device by AT+iDOWN
If you want to change back to DHCP just change all this setting to 0.0.0.0 and run device restart.

After this points your spectrum should be connected to network and from PC you can ping your computer, or try to open configuration web pages in connect one module from your web browser.

This settings are all what you have to do for get your device connected to network. In next chapter, will be example how to get some http page, open serial tunnel or create FTP connection.