Starting the System
Ensure that you have completed the steps in the Device Setup section before following these instructions.
If you have not already done so, create your free FlowCloud Developer account here. Your account is used to register the devices you are using, and to login to the Linux applications used in this demo.
Wi-Fire
Configuring serial console for Wi-Fire boards
Windows
- Connect the board to your PC using a mini USB cable and wait for the driver installation to complete.
- Install and run any serial terminal program - e.g. Tera Term, minicom, PuTTY, Hyper Terminal etc.
- You will need to identify the COM port that the Wi-Fire board is connected to. To do this open Device Manager and look for "USB Serial Device" in the "Ports" section.
- Configure the serial terminal program to use the port you found in device manager (i.e. COM3); baud rate("speed") of 115200; 8 data bits; 1 stop bit and no parity; hardware control as OFF.
Linux
- Connect the board to your PC using a mini USB cable.
- Install and run any serial terminal program - e.g. Tera Term, minicom, PuTTY, Hyper Terminal etc.
- Navigate to /dev/ and plug/unplug Wi-Fire's usb cable and look for which device is getting added to the list. e.g. /dev/ttyUSB0.
- Configure the serial terminal program to use this port, with: baud rate of 115200, 8 data bits, 1 stop bit and no parity, hardware control as OFF.
Wi-Fire Sensor
Hardware Configuration
- Connect the Grove Arduino Base Shield to the Wi-Fire board.
- Connect the Grove Temperature Sensor to port A2 of the Grove Arduino Base Shield.
- Connect the Grove Temperature and Humidity Sensor to port A1 of the Grove Arduino Base Shield.
To register your Wi-Fire board as a Sensor with this account, you need a Device Registration Key:
- Log in to your FlowCloud account at http://flow.imgtec.com/developers.
- Go to the 'My Devices' page.
- Select the 'Registration' tab.
- From the drop-down list of device types, select ClimateControlDemoSensor.
- Under 'Registration Method B', click the 'Get New Code' button to retrieve your device registration key.
- Take a note of your device registration key.
Using the terminal emulator, enter the following sequence of commands
- set devreg_key - Follow the on-screen instructions and enter the device registration key that you have just generated when prompted.
- set network_config - Follow the instructions for setting up your wireless access point credentials. When prompted whether to force the device into interactive mode next time it reboots, be sure to enter 'y' for yes.
- reboot - This will restart Wi-Fire in Wi-Fi connected mode.
You should see following within the serial console output:
s/w version Type '1.0'[INFO] ---------Initialize ClimateSensor------
...
[INFO] ---------Initialize ClimateSensor Done------
Note that the console output within the initialization process will vary depending on the state of your Climate Control Demo at runtime.
Wi-Fire Actuator
Hardware Configuration
- Connect the Grove Arduino Base Shield to the Wi-Fire board.
- Connect a Grove Relay to port D2.
- Connect a Grove Relay to port D3.
To register your Wi-Fire board as an Actuator with this account, you need a Device Registration Key:
- Log in to your FlowCloud account at http://flow.imgtec.com/developers
- Go to the 'My Devices' page.
- Select the 'Registration' tab.
- From the drop-down list of device types, select ClimateControlDemoActuator.
- Under 'Registration Method B', click the 'Get New Code' button to retrieve your device registration key.
- Take a note of your device registration key.
Using the terminal emulator, enter the following sequence of commands
- set devreg_key - Follow the on-screen instructions and enter the device registration key that you have just generated when prompted.
- set network_config - Follow the instructions for setting up your wireless access point credentials. When prompted whether to force the device into interactive mode next time it reboots, be sure to enter 'y' for yes.
- reboot - This will restart Wi-Fire in Wi-Fi connected mode.
You should see these lines within your console output:
s/w version Type '1.0'[INFO] ---------Initialize Climate Actuator------
...
[INFO] ---------Initialization of Climate Actuator Done------
Note that the console output within the initialization process will vary depending on the state of your Climate Control Demo at runtime.
Ci20 Controller
To register your Ci20 board as Controller you need a Device Registration Key:
- Log in to your FlowCloud account at http://flow.imgtec.com/developers
- Go to the 'My Devices' page.
- Select the 'Registration' tab.
- From the drop-down list of device types, select ClimateControlDemoController.
- Under 'Registration Method B', click the 'Get New Code' button to retrieve your device registration key.
- Take a note of your device registration key in order to add it to the config file detailed below.
Start the Controller app on Ci20 board
If you installed the controller as detailed in "Device Setup" then the controller binary will be in /opt/flowsdk/bin.
The flowclimatecontroller application requires Flow server configuration settings in the flow_controller.cnf file.
- You can create a "flow_controller.cnf" file in the same folder as the binary, else it will ask for all the details on the command line when running the controller for the first time. Once you have provided the details, flowclimatecontroller will be registered to your account on the FlowCloud server.
-
The fields in flow_controller.cnf:
Server_Address=http://ws-uat.flowworld.com
Auth_Key=Ph3bY5kkU4P6vmtT
Secret_Key=Sd1SVBfYtGfQvUCR
Device_Type=ClimateControlDemoController
MAC_Addr=
Serial_Num=FFFFFFFFFFFF
Device_Name=
Devreg_Key=
- Fill in the MAC address of your device (entering "ifconfig" in the terminal will display the "HWaddr" associated with eth0 - this is your MAC address - enter it without colons e.g. A1251B3CC4F2).
- Give the device a name that will allow you to identify it.
- Enter the device registration key generated on the Flow Developer Website.
If this has worked successfully you can run the controller from a terminal by navigating to it's directory (default: /opt/flowsdk/bin) and typing ./flowclimatecontroller.mipsel.bin. If this does not work make sure that the file is marked as "executable". You should see a console output similar to this example:
Flow Interface initialized successfully
[INFO]: ---------Initialize Controller------
Entering Interactive Mode
You can also start the flowclimatecontroller in debug mode to see more detailed console output and debug information. Just run "./flowclimatecontroller.mipsel.bin DEBUG_LEVEL 4".
Linux PC
Controller on Linux PC
If you do not want to use Ci20 to run the controller app, you can run it on the Linux PC instead. If you have already set up the controller on Ci20, skip to "Admin app on Linux PC"
Follow the instructions for Ci20 (including the Device Setup section) except for the following:
To run the controller on 64-bit Linux run ./flowclimatecontroller.x86_64.bin.
To run the controller on 32-bit Linux run ./flowclimatecontroller.i686.bin.
Admin app on Linux PC
Navigate to the pc_app/ folder that was downloaded earlier from GitHub and run the app:
#python climate_control/admin
Log into the app using the FlowCloud Developer account that your devices are registered to.
You can check session logs for the Admin app in climate_control/logs.
Display app on Linux PC
Navigate to the pc_app/ folder from different terminal.
#python climate_control/display
Log into the app using the FlowCloud Developer account that your devices are registered to.
You can check session logs for the Display app in climate_control/logs