User Tools

Site Tools


digix:tutorials:wifi

Setting up the WiFi connection (first time use/new location):

Attach the DigiX to a power source (USB, DC Jack, etc). Note: The DigiX will present itself as a new available wireless network with SSID “DIGIX” or “HF-LPB”.

Note: some USB ports might not provide sufficient current. If things don't work for you try powering the DigiX thru the DC jack.

From a device with a web browser (computer, smartphone, tablet, etc) connect to the “DIGIX” or “HF-LPB” wifi network with DHCP enabled

In browser goto: 10.10.100.254

Username: admin Password: admin

For most browsers the easy way to do this is just put this address into your browser address bar:

http://admin:admin@10.10.100.254

(if you change the username/password just make sure you are using {username}:{password}@10.10.100.254)

If necessary - Select English in the top right

Go to Work Mode Screen

set to AP+STA for best flexibility.

AP Mode - Access Point mode allows the DigiX to function as a Access Point to WiFi client devices STA Mode - Station Mode allows the DigiX to function as a WiFi client to WiFi Access Point AP+STA - Allows the DigiX to function as a Access Point at the same time it is a client to a Access Point

Hit Save before continuing.

When it says to reboot - unless you are completely done, do not reboot but continue do your setup.

STA Setting

Enter network name or scan for it, enter security info (it will attempt to detect encryption settings) Hit Save

When it says to reboot - unless you are completely done, do not reboot but continue do your setup.

AP Setting

Set these to your liking - this is for the Access Point the WiFi module creates (for connecting with Android phones, etc). Make sure it is not on the same channel as the WiFi you selected in STA settings.

Hit Save

When it says to reboot - unless you are completely done, do not reboot but continue do your setup.

Other Settings

Don't change anything here unless you know what you are doing, the library depends on these settings.

Note: you might want to verify the baud setting. After a factory restore it could be at 115200 baud while most of the example code defaults to 9600.

Account

Change the username and/or password to login to this configuration panel.

Hit Save

When it says to reboot - unless you are completely done, do not reboot but continue do your setup.

When everything is set how you would like click on “Restart”

and then “OK”

You may need to power off the DigiX and power it back on the first time you change this or when you change the AP settings. (Eje_G Note: I never discovered any issues when I did my setup, but I did fairly straight forward configuration. Other configuration setups might possibly require a reboot)

Using it in your sketch

See Examples→DigiFi for many usage examples.

The DigiFi library is mostly compatible with the Arduino Ethernet library - http://arduino.cc/en/reference/ethernet

See the EthernetCompatible examples for differences.

See also the Xively library.

The DigiFi Library can also provide a much easier way to post and get URLs - see the DigiFi→BasicClient example

It also has some neat tricks for server usage - see DigiFi → ServerExample

See the SetRTCbyNTP example for how to set the Real Time Clock from a time server.

See DigiFI→EthernetCompatible→WebServerChunked for an example of the integrated Chunked Transfer mode for server use.

The DigiX supports using the WiFi with Serial flow control for faster communications. To enable it you must first set the Flow Control to enabled via the web config, and set a baudrate. Then instead of calling wifi.begin() - call wifi.begin(BAUDRATE, true) where BAUDRATE is the baudrate you set the module to via the web cconfig.

Resources

Datasheet on WiFi module: http://digistump.com/wiki/_media/digix/tutorials/usr-wifi232-g_en.pdf

DigiFi GitHub https://github.com/digistump/DigiFi

See the DigiFi.h and .cpp files for lots of extra functions!

See also: Library Functions

Web Server

See ServerExample for an example of Basic web server usage.

See DigiFi→EthernetCompatible→WebServerChunked for an example of the integrated Chunked Transfer mode for server use.

ToDo - please help!

  1. Add DELETE, PUT commands to library
  2. Add lots of additional error handling
  3. General cleanup, comment, etc of library, example, and this page.
  4. Add more features to library and document on wiki.
  5. Programing over WiFi
  6. Digistump hosted proxy for secure data transfer
  7. Digistump hosted proxy for IFTTT integration

Tips

You can use the solder jumper on the back of the DigiX to connect the WiFi reset to either the DigiX reset button or pin 106 (which would allow you to reset from software) - either of which would make debugging/development on the library much easier since you don't have to worry about the wifi being in a stuck state and having to power off.

Advanced

All AT commands are wrapped with functions, it is highly recommended to check the documentation in the references section before playing with these functions.

Reading/Writing configs:

NOTE: writing a bad or corrupted config could make the wifi module inaccessible, the module can be reset via a pin on the module. See the datasheet for details.

There are AT commands for reading and writing the config of the wifi module, these are in the latest library as readConfig and writeConfig. readConfig has been tested and is working but writeConfig has not. readConfig takes a pointer to a buffer (Should be atleast 1kb) and returns the length of the resulting config data. writeConfig accepts a pointer to a byte array and a length.

Some other config functions exist also, readFactoryDef() and makeFactory() readFactoryDef works just like readConfig, except it reads from a usually non changing config. on a new DigiX this config is empty and will not read. This is where makeFactory comes in, it copies the current config as a factory default. this allows you to use readFactoryDef to retrieve it at a later date.

It is currently unknown if the wifi uses this factory default through the web ui or factory reset AT command. I do not think it does as its undefined by default.

digix/tutorials/wifi.txt · Last modified: 2014/03/07 09:13 by schnapp