weatherbox:firmware:firmware_user_manual

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
weatherbox:firmware:firmware_user_manual [2016/05/05 21:03]
rwalser [Sensor Module Test]
weatherbox:firmware:firmware_user_manual [2021/09/19 21:59] (current)
Line 243: Line 243:
  
 ===== Generation Testing ===== ===== Generation Testing =====
-Verifying that the code compiles does not verify ​that it will work.  Each module ​needs to be tested on each Generation ​to validate ​it'​s ​functionality. ​ However, testing each individual module and confirming that they work, doesn'​t ​not confirm that the modules will work together.  ​Thus, we must also test full integration ​on each generation, the most important test before deployment.+Verifying that the code compiles does not necessarily mean that it will work as intended.  Each module ​should ​be tested on each generation ​to validate ​its functionality. ​ However, testing each individual module and confirming that they work separatelydoes not confirm that the modules will work together.  ​Therefore ​we must also test full integration ​with each generation, the most important test before deployment.
 ---- ----
 ====Sensor Module Test==== ====Sensor Module Test====
Line 251: Line 251:
   * Arduino IDE   * Arduino IDE
   * Arduino board USB   * Arduino board USB
-  * Battery+  * Charged battery
   * Floodlight (for Solar Irradiance & Temperature)   * Floodlight (for Solar Irradiance & Temperature)
 __Test Environment__:​ __Test Environment__:​
Line 257: Line 257:
   - In Arduino IDE, under Tools check:   - In Arduino IDE, under Tools check:
     * Board is set to Arduino UNO     * Board is set to Arduino UNO
-    * Port is set to the USB port with the programmer plugged into it+    * Port is set to the specific ​USB port that the programmer ​is plugged into
     * Programmer is set to AVRISP mkII     * Programmer is set to AVRISP mkII
-  - In config.h verify only the macroAPPLEis defined +  - In config.h verify ​that only macro "APPLE" ​is defined 
-  - Run a test compile to ensure libraries are found and no compile time errors occur+  - Run a test compile to ensure libraries are found and no compile-time errors occur
   - Upload program to board   - Upload program to board
 __Expected Results (Inside SCEL room)__: __Expected Results (Inside SCEL room)__:
-  - Once the upload is complete, open the Serial Monitor (Ctrl-Shift-M) +  - Once the upload is complete, open the Serial Monitor (Ctrl+Shift+M) 
-  - Sensor readings will appear here ~every 6 seconds+  - Sensor readings will appear here every ~6 seconds
   - Use the floodlight to verify that solar irradiance and temperature vary (humidity may be affected as well)   - Use the floodlight to verify that solar irradiance and temperature vary (humidity may be affected as well)
   - Readings:   - Readings:
Line 278: Line 278:
   * Arduino IDE   * Arduino IDE
   * FTDI & cable   * FTDI & cable
-  * Battery+  * Charged battery
   * Floodlight (for Solar Irradiance & Temperature)   * Floodlight (for Solar Irradiance & Temperature)
   * ICSP programmer (if "burn the bootloader"​ wasn't previously run)   * ICSP programmer (if "burn the bootloader"​ wasn't previously run)
Line 293: Line 293:
     - In Arduino IDE, under Tools check:     - In Arduino IDE, under Tools check:
       * Board is set to Arduino 3.3V 8MHz       * Board is set to Arduino 3.3V 8MHz
-      * Port is set to the USB port with the programmer plugged into it+      * Port is set to the specific ​USB port that the programmer plugged into
       * Programmer is set to AVRISP mkII       * Programmer is set to AVRISP mkII
-    - In config.h verify only the macroCRANBERRYis defined+    - In config.h verify ​that only macro "CRANBERRY" ​is defined
     - Run a test compile to ensure libraries are found and no compile time errors occur     - Run a test compile to ensure libraries are found and no compile time errors occur
     - Upload program to board      - Upload program to board 
Line 315: Line 315:
   * Arduino IDE   * Arduino IDE
   * FTDI & cable   * FTDI & cable
-  * Battery+  * Charged battery
   * Floodlight (for Solar Irradiance & Temperature)   * Floodlight (for Solar Irradiance & Temperature)
   * ICSP programmer (if "burn the bootloader"​ wasn't previously run)   * ICSP programmer (if "burn the bootloader"​ wasn't previously run)
Line 331: Line 331:
       * Port is set to the USB port with the programmer plugged into it       * Port is set to the USB port with the programmer plugged into it
       * Programmer is set to AVRISP mkII       * Programmer is set to AVRISP mkII
-    - In config.h verify only the macroDRAGONFRUITis defined+    - In config.h verify ​that only macro "DRAGONFRUIT" ​is defined
     - Run a test compile to ensure libraries are found and no compile time errors occur     - Run a test compile to ensure libraries are found and no compile time errors occur
     - Upload program to board      - Upload program to board 
Line 345: Line 345:
     * Temp decic = ~26 (Compare to actual temperature)     * Temp decic = ~26 (Compare to actual temperature)
     * Pressure pa = ~101000     * Pressure pa = ~101000
 +
 ---- ----
 ====Transmit Module Test==== ====Transmit Module Test====
 ===Apple=== ===Apple===
 __Necessary Components__:​ __Necessary Components__:​
 +  * Apple board 
 +  * Arduino IDE 
 +  * FTDI & cable 
 +  * XCTU software 
 +  * Charged battery 
 +  * XBee breakout board and USB 
 +  * Two properly configured XBees *See "​Configuring XBees" under "​Resources"​ 
 +  * ICSP programmer (if "burn the bootloader"​ wasn't previously run)
 __Test Environment__:​ __Test Environment__:​
 +  * If the bootloader was not burnt 
 +    - Connect the ICSP device to the computer and board 
 +    - Open Arduino IDE 
 +    - Select the board Arduino UNO 
 +    - Select the correct programmer (AVRISP mkII) 
 +    - Burn the bootloader 
 +  * With the bootloader burnt  
 +    - Plug the battery and the Xbee(Router) into the Apple board 
 +    - Attach the Xbee(Coordinator) to the Xbee breakout board and plug that into your computer using the USB cable 
 +    - Open XCTU on your computer 
 +      * Click "Add Device"​ and select the corresponding USB port that your XBee is plugged into 
 +      * Switch to the "​Console"​ and "​Connect"​ the Xbee to the network 
 +      * Observe the Console log for packets to be received 
 +    - Connect the Apple board to the computer using the USB 
 +    - In Arduino IDE, under Tools check: 
 +      * Board is set to Arduino UNO 
 +      * Port is set to the specific USB port that the programmer is plugged into 
 +      * Programmer is set to AVRISP mkII 
 +    - In config.h verify that only macro "​APPLE"​ is defined 
 +    - Run a test compile to ensure libraries are found and no compile-time errors occur 
 +    - Upload program to board
 __Expected Results__: __Expected Results__:
 +  * Console log should display "​Received Packet"​ in red font ever ~5 seconds 
 +  * UART should contain the string "test yes" 
 +  * BINARY should contain: 
 +    * Some API packet coding identification 
 +    * Schema number: 01 
 +    * Hex code for the Microcontroller address 
 +    * Hex code for up time of the program 
 +    * Hex code for overflow (if occurred) otherwise: 00 
 +    * Hex code for n count: 0A 
 +    * Hex code for Battery mV: 01 
 +    * Hex code for Panel mV: 02 
 +    * Hex code for Pressure: 04 
 +    * Hex code for Temperature:​ 05 
 +    * Hex code for Humidity: 06 
 +    * Hex code for Solar Irradiance: 03
 ===Cranberry=== ===Cranberry===
 __Necessary Components__:​ __Necessary Components__:​
 +  * Cranberry board 
 +  * Arduino IDE 
 +  * FTDI & cable 
 +  * XCTU software 
 +  * Charged battery 
 +  * XBee breakout board and USB 
 +  * Two properly configured XBees *See "​Configuring XBees" under "​Resources"​ 
 +  * ICSP programmer (if "burn the bootloader"​ wasn't previously run)
 __Test Environment__:​ __Test Environment__:​
 +  * If the bootloader was not burnt 
 +    - Connect the ICSP device to the computer and board 
 +    - Open Arduino IDE 
 +    - Select the board Arduino 3.3V 8MHz 
 +    - Select the correct programmer (AVRISP mkII) 
 +    - Burn the bootloader 
 +  * With the bootloader burnt  
 +    - Plug the battery and the Xbee (Router) into the Cranberry board 
 +    - Turn on the Cranberry board by flipping the switch to "​ON"​ 
 +    - Attach the XBee (Coordinator) to the XBee breakout board and plug that into your computer using the USB cable 
 +    - Open XCTU on your computer 
 +      * Click "Add Device"​ and select the corresponding USB port that your XBee is plugged into 
 +      * Switch to the "​Console"​ and "​Connect"​ the XBee to the network 
 +      * Observe the Console log for packets to be received 
 +    - Connect the FTDI programmer to the computer and board 
 +    - In Arduino IDE, under Tools check: 
 +      * Board is set to Arduino 3.3V 8MHz 
 +      * Port is set to the specific USB port that the programmer plugged into 
 +      * Programmer is set to AVRISP mkII 
 +    - In config.h verify that only macro "​CRANBERRY"​ is defined 
 +    - Run a test compile to ensure libraries are found and no compile time errors occur 
 +    - Upload program to board 
 __Expected Results__: __Expected Results__:
 +  * Console log should display "​Received Packet"​ in red font every ~5 seconds 
 +  * UART should contain the string "test yes" 
 +  * BINARY should contain: 
 +    * Some API packet coding identification 
 +    * Schema number: 01 
 +    * Hex code for the Microcontroller address 
 +    * Hex code for up time of the program 
 +    * Hex code for overflow (if occurred) otherwise: 00 
 +    * Hex code for n count: 0A 
 +    * Hex code for Battery mV: 01 
 +    * Hex code for Panel mV: 02 
 +    * Hex code for Pressure: 04 
 +    * Hex code for Temperature:​ 05 
 +    * Hex code for Humidity: 06 
 +    * Hex code for Solar Irradiance: 03
 ===Dragon Fruit=== ===Dragon Fruit===
 __Necessary Components__:​ __Necessary Components__:​
 +  * Dragon Fruit board 
 +  * Arduino IDE 
 +  * FTDI & cable 
 +  * XCTU software 
 +  * Charged battery 
 +  * XBee breakout board and USB 
 +  * Two properly configured XBees *See "​Configuring XBees" under "​Resources"​ 
 +  * ICSP programmer (if "burn the bootloader"​ wasn't previously run)
 __Test Environment__:​ __Test Environment__:​
 +  * If the bootloader was not burnt 
 +    - Connect the ICSP device to the computer and board 
 +    - Open Arduino IDE 
 +    - Select the board Arduino UNO 
 +    - Select the correct programmer (AVRISP mkII) 
 +    - Burn the bootloader 
 +  * With the bootloader burnt  
 +    - Plug the battery and the XBee (Router) into the Dragon Fruit board 
 +    - Turn on the Dragon Fruit board by flipping the switch to "​ON"​ (Switch should be flipped towards the battery) 
 +    - Attach the XBee (Coordinator) to the XBee breakout board and plug that into your computer using the USB cable 
 +    - Open XCTU on your computer 
 +      * Click "Add Device"​ and select the corresponding USB port that your XBee is plugged into 
 +      * Switch to the "​Console"​ and "​Connect"​ the XBee to the network 
 +      * Observe the Console log for packets to be received 
 +    - Connect the FTDI programmer to the computer and board 
 +    - In Arduino IDE, under Tools check: 
 +      * Board is set to Arduino UNO 
 +      * Port is set to the USB port with the programmer plugged into it 
 +      * Programmer is set to AVRISP mkII 
 +    - In config.h verify that only macro "​DRAGONFRUIT"​ is defined 
 +    - Run a test compile to ensure libraries are found and no compile time errors occur 
 +    - Upload program to board 
 __Expected Results__: __Expected Results__:
 +  * Console log window should display "​Received Packet"​ in red font every ~5 seconds
 +  * UART should contain the string "test yes"
 +  * BINARY should contain:
 +    * Some API packet coding identification
 +    * Schema number: 01
 +    * Hex code for the Microcontroller address
 +    * Hex code for up time of the program
 +    * Hex code for overflow (if occurred) otherwise: 00
 +    * Hex code for n count: 0A
 +    * Hex code for Battery mV: 01
 +    * Hex code for Panel mV: 02
 +    * Hex code for Pressure: 04
 +    * Hex code for Temperature:​ 05
 +    * Hex code for Humidity: 06
 +    * Hex code for Solar Irradiance: 03
  
 ---- ----
- 
 ====Full Integration Test==== ====Full Integration Test====
 +This test should only be done once both the sensor module and transmit modules tests have been completed and the results verified. ​ This also assumes that the "burn the bootloader step" has already been executed.
 ===Apple=== ===Apple===
 __Necessary Components__:​ __Necessary Components__:​
 +  * Apple board 
 +  * Arduino IDE 
 +  * FTDI & cable 
 +  * XCTU software 
 +  * XBee breakout board and USB  
 +  * Two properly configured XBees *See “Configuring XBees” under "​Resources"​ 
 +  * Charged Battery 
 +  * Floodlight (for Solar Irradiance & Temperature)
 __Test Environment__:​ __Test Environment__:​
 +  - Plug the battery and the Xbee(Router) into the Apple board 
 +  - Attach the Xbee(Coordinator) to the Xbee breakout board and plug that into your computer using the USB cable 
 +  - Open XCTU on your computer 
 +    * Click "Add Device"​ and select the corresponding USB port that your XBee is plugged into 
 +    * Switch to the "​Console"​ and "​Connect"​ the Xbee to the network 
 +    * Observe the Console log for packets to be received 
 +  - Connect the Apple board to the computer using the USB 
 +  - In Arduino IDE, under Tools check: 
 +    * Board is set to Arduino UNO 
 +    * Port is set to the specific USB port that the programmer is plugged into 
 +    * Programmer is set to AVRISP mkII 
 +  - In config.h verify that only macro "​APPLE"​ is defined 
 +  - Run a test compile to ensure libraries are found and no compile-time errors occur 
 +  - Upload program to board
 __Expected Results__: __Expected Results__:
 +  * Using XCTU: 
 +    - In the Console log, verify that a packet is being received 
 +    - Examine the data within the received packet 
 +      * Data will be in Hexadecimal 
 +      * Requires conversion 
 +    - Data (within the REIS room) should be similar to the expected results of the Sensor Module Test 
 +  * With decryption script (XBee (Router) is connected to a computer with the decryption script running): 
 +    - Verify that a packet is being recieved 
 +    - Examine the converted data 
 +    - Data (within the REIS room) should be similar to the expected results of the Sensor Module Test
 ===Cranberry=== ===Cranberry===
 __Necessary Components__:​ __Necessary Components__:​
 +  * Cranberry board 
 +  * Arduino IDE 
 +  * FTDI & cable 
 +  * XCTU software 
 +  * XBee breakout board and USB  
 +  * Two properly configured XBees *See “Configuring XBees” under "​Resources"​ 
 +  * Charged Battery 
 +  * Floodlight (for Solar Irradiance & Temperature)
 __Test Environment__:​ __Test Environment__:​
 +  - Plug the battery and the Xbee (Router) into the Cranberry board 
 +  - Turn on the Cranberry board by flipping the switch to "​ON"​ 
 +  - Attach the XBee (Coordinator) to the XBee breakout board and plug that into your computer using the USB cable 
 +  - Open XCTU on your computer 
 +    * Click "Add Device"​ and select the corresponding USB port that your XBee is plugged into 
 +    * Switch to the "​Console"​ and "​Connect"​ the XBee to the network 
 +    * Observe the Console log for packets to be received 
 +  - Connect the FTDI programmer to the computer and board 
 +  - In Arduino IDE, under Tools check: 
 +    * Board is set to Arduino 3.3V 8MHz 
 +    * Port is set to the specific USB port that the programmer plugged into 
 +    * Programmer is set to AVRISP mkII 
 +  - In config.h verify that only macro "​CRANBERRY"​ is defined 
 +  - Run a test compile to ensure libraries are found and no compile time errors occur 
 +  - Upload program to board 
 __Expected Results__: __Expected Results__:
 +  * Using XCTU: 
 +    - In the Console log, verify that a packet is being received 
 +    - Examine the data within the received packet 
 +      * Data will be in Hexadecimal 
 +      * Requires conversion 
 +    - Data (within the REIS room) should be similar to the expected results of the Sensor Module Test 
 +  * With decryption script (XBee (Router) is connected to a computer with the decryption script running): 
 +    - Verify that a packet is being recieved 
 +    - Examine the converted data 
 +    - Data (within the REIS room) should be similar to the expected results of the Sensor Module Test
 ===Dragon Fruit=== ===Dragon Fruit===
 __Necessary Components__:​ __Necessary Components__:​
 +  * Dragon Fruit board 
 +  * Arduino IDE 
 +  * FTDI & cable 
 +  * XCTU software 
 +  * XBee breakout board and USB  
 +  * Two properly configured XBees *See “Configuring XBees” under "​Resources"​ 
 +  * Charged Battery 
 +  * Floodlight (for Solar Irradiance & Temperature)
 __Test Environment__:​ __Test Environment__:​
 +  - Plug the battery and the XBee (Router) into the Dragon Fruit board 
 +  - Turn on the Dragon Fruit board by flipping the switch to "​ON"​ (Switch should be flipped towards the battery) 
 +  - Attach the XBee (Coordinator) to the XBee breakout board and plug that into your computer using the USB cable 
 +  - Open XCTU on your computer 
 +    * Click "Add Device"​ and select the corresponding USB port that your XBee is plugged into 
 +    * Switch to the "​Console"​ and "​Connect"​ the XBee to the network 
 +    * Observe the Console log for packets to be received 
 +  - Connect the FTDI programmer to the computer and board 
 +  - In Arduino IDE, under Tools check: 
 +    * Board is set to Arduino UNO 
 +    * Port is set to the USB port with the programmer plugged into it 
 +    * Programmer is set to AVRISP mkII 
 +  - In config.h verify that only macro "​DRAGONFRUIT"​ is defined 
 +  - Run a test compile to ensure libraries are found and no compile time errors occur 
 +  - Upload program to board 
 __Expected Results__: __Expected Results__:
 +  * Using XCTU:
 +    - In the Console log, verify that a packet is being received
 +    - Examine the data within the received packet
 +      * Data will be in Hexadecimal
 +      * Requires conversion
 +    - Data (within the REIS room) should be similar to the expected results of the Sensor Module Test
 +  * With decryption script (XBee (Router) is connected to a computer with the decryption script running):
 +    - Verify that a packet is being recieved
 +    - Examine the converted data
 +    - Data (within the REIS room) should be similar to the expected results of the Sensor Module Test
  
 ---- ----
- 
 ===== Unit Testing & Error Library ===== ===== Unit Testing & Error Library =====
 Unit testing and the error code library go hand in hand.  We will apply unit testing to test and improve each small unit of our firmware. ​ With each test we will have an associated error code that can be used to indicate if that test failed during full operation. Unit testing and the error code library go hand in hand.  We will apply unit testing to test and improve each small unit of our firmware. ​ With each test we will have an associated error code that can be used to indicate if that test failed during full operation.
Line 423: Line 639:
   * **DO NOT** try to cascade unit tests with one execution/​run of the code   * **DO NOT** try to cascade unit tests with one execution/​run of the code
   * **Must be verified on each generation**   * **Must be verified on each generation**
 +
 +** General Notes for Unit Testing **
 +  * Unit Testing is separate from manual testing/​integration
 +    * Unit testing is generally used to describe the behavior of your programs
 +    * Manual testing/​integration testing is used to find bugs
 +  * It is generally extremely beneficial for programmers to have a good "​suite"​ of unit tests
 +  * The programmer designs the pre-conditions for the test
 +      * Observe how the program behaves with the given pre-conditions
 +      * Downfall to this method, won't detect problems triggered by pre-conditions you didn't anticipate
 +  * If a unit's behavior changes, the unit tests for that specific unit must also change, vice-versa.
 +  * Unit tests should not contain any knowledge or assumptions about the other parts of code, such that changes to other parts of the code does not make other unit tests fail/give bad results; make each test independent of others
 +  * Any given behavior should be specified in one and only one unit test
 +  * Only observe the core behavior of each unit
 +  * Generally, unit tests are a design specification of how a certain behavior should work, NOT a list of observations of everything the code happens to do
 +  * The overall architecture of your code should support testing units before using unit tests
  
 ---- ----
Line 456: Line 687:
  
 ---- ----
- 
- 
  • weatherbox/firmware/firmware_user_manual.1462482227.txt.gz
  • Last modified: 2021/09/19 21:59
  • (external edit)