Home

daVinci: eBox 4864 – Sentalis Fetch CSV Server (Final Draft

image

Contents

1. Microsoft Office E Microsoft Office E Microsoft Office E Microsoft Office E Microsoft Office E Microsoft Office E Figure 4 2 Downloaded CSV Files 4 3 Installation 4 3 1 GParted f Size m 2 KB 1KB 1KB 1KB 30 KB 59 KB 51KB 59 KB 51KB 59 KB 51KB 31KB 20 KB In order to set up the eBox to run Ubuntu we need to format the compact flash card correctly This is done by downloading the latest stable release of GParted 6 Once the Ubuntu Minimal Install image is downloaded we will use UNetBootln 5 in order to flash the ISO to a USB flash Christopher Steiner Florida Gulf Coast University Fall 2011 Page 16 eBox 4864 Sentalis Fetch CSV Server drive at least 1gb capacity The USB flash drive needs to be formatted in Fat32 using the HPDriveKey 8 utility Figure 4 3 HP USB Disk Storage Format Tool V2 1 8 Device SanDisk Cruzer 8 01 3854 MB E File system FAT32 Volume label GParted Format options v Quick Format __ Enable Compression i Create a DOS startup disk using internal MS DOS system files using DOS system files located at Figure 4 3 Format USB flash drive Once the USB flash drive is formatted open up UNetBootin and set to the following settings Figure 4 4 Christopher Steiner Florida Gulf Coast University Page 17 Fall 2011 eBox 4864 Sentalis Fetch CSV
2. V 5BS5D 32236VS5BS5D 3218 amp VS5BS5D 32218V S 5B 5D 3217 amp V 5B 5D 321 9 amp VS5B 5D 3220 amp VS5BS5D 32258VS5BS5D 322 6 amp V 5BS5D 3227 amp VS5BS5D 32 22 byte buf new byte 1024 int len File of new File home sharedavinci csv lutgert monthFormat format month dayFormat format day yearFormat format year csv OutputStream os new FileOutputStream of Get the input stream InputStream is lutgert getWebResponse getContentAsStream Try to read data in and write it to a file while len is read buf gt 0 os write buf 0 len os flush os close is close catch ClassCastException e fetchCSv create backup csv file for lutgert try lutgert TextPage webClient Christopher Steiner Florida Gulf Coast University Page 32 Fall 2011 daVinci eBox 4864 Sentalis Fetch CSV Server getPage https solarems net projects 38 fgcu lutgert data csv date_range amp VS5BS5D 5918 amp VS5BS monthFormat format month a SOR dayFormat format day SOR yearFormat format year 5D 5318 amp V 5B 5D 5919 amp VS5B 5D 3197 amp VS5BS5D 3196 amp V S5BS5D 5316 amp Vs5BS5 D 3195 amp V 5B 5D 3194 amp Vv 5B 5D 3199 amp VS5BS5D 31 98 amp V 5BS5D 3202 amp Vs5BS5D 3200 amp VS5BS5D 3201EV S5BS5D 3213 amp V 5BS5D 3210 amp V 5B 5D 3211 amp V 5BS5D 3208 amp V S5BS5D 3209 amp VS5BS5D 3215 amp
3. format month dayFormat format day yearFormat format year csv OutputStream os new FileOutputStream of Get the input stream InputStream is holmes getWebResponse getContentAsStream Try to read data in and write it to a file while len is read buf gt 0 os write buf 0 len os flush os close is close catch ClassCastException e fetchCSv submit the link for the csv file for lutgert try lutgert TextPage webClient getPage https solarems net projects 38 fgcu lutgert data csv date_range monthFormat format month a SOR dayFormat format day abe Z 2F yearFormat format year amp v 5B 5D 5918 amp v 5B 5D 5318 amp v 5B 5D 5919 amp v 5B 5D 3197 amp v 5B 5D 3196 amp v 5B 5D 5316 amp v 5B3 5 D 3195 amp v 5B 5D 3194 amp v 5B 5D 31994 amp v 5B 5D 3198 amp v 5B 5D 3202 amp v 5B 5D 3200 amp v 5B 5D 3201 amp v 5B 5D 3213 amp v 5B 5D 3210 amp v 5B 5D 3211 amp v 5B 5D 3208 amp v 5B 5D 3209 amp v 5B 5D 3215 amp v 5B 5D 3 2126V 5BS5D 32046VS5B 5D 3214 amp V 5BS5D 3205 amp V S5B 5D 320 6 amp V 5BS5D 3207 amp VS5BS5D 3203 amp VS5B S5D 5930 amp VS5B 5D 5 927 amp VS5BS5D 5 928 amp VS5BS5D 5 925 amp VSE5BS5D 5 92 6 amp VE5BS5D 5 932 amp VS5BS5D 5931 amp V S5BS5D 5 92 9 amp VS5BS5D 5914 amp VS5BS5D 5 958 amp VS5BS5D 5I9226VS5BS5D 5 923 amp VE5BSSD 5924 amp VE5BE5D 5913 amp V 5B 5D 5312 amp VS5BS5D 5308 amp VS5BS5D 5915 amp
4. 30 64 amp VS5BS5D 5164 amp VS5B 5D 3066 amp v 5B 5D 3070 amp V 5B 5D 3059 amp V S5B 5D 30 6 9 amp VS5BS5D 30 60 amp VS5BS5D 3061 amp VS5BS5D 3062 amp V 5B 5D 3058 amp V 5B 5D 597 6 amp V 5BS5D 5 980 amp VS5B 5D 5 977 amp VS5BS5D 3050 amp VS5BS5D 3053 amp VS5BS5D 3049 amp V 5BS5D 3051 amp V 5B 5D 3052 amp V 5B 5D 3055 amp V 5B 5D 3056 amp V 5BS5D 3057 amp VS5BS5D 3054 byte buf new byte 1024 int len File of new File home sharedavinci csv ab7 monthFormat format month dayFormat format day yearFormat format year csv OutputStream os new FileOutputStream of Get the input stream InputStream is ab7 getWebResponse getContentAsStream Try to read data in and write it to a file Christopher Steiner Florida Gulf Coast University Page 29 Fall 2011 Cee eBox 4864 Sentalis Fetch CSV Server while len is read buf gt 0 os write buf 0 len os flush os close is close catch ClassCastException e fetchCSv make backup of csv file for ab7 try ab7 TextPage webClient getPage https solarems net projects 36 fgcu ab7 data csv date_range monthFormat format month a SOR dayFormat format day ps SOF yearFormat format year 6 amp V 5BS5D 5208 amp VS5B 5D 6002 amp V 5BS5D 6003 amp VS5BS5D 3031 amp VS5BS5D 5 95 9 amp VS5BE5D 5999 amp VSE5BE5 D 3029 amp V 5B 5D 3028 amp V
5. 5B 5D 3033 amp V 5BS5D 3032 amp V 5BS5D 303 6 amp V 5B 5D 3034 amp VS5BS5D 3035 amp V 5B 5D 3119 amp V 5B 5D 3114 amp v 5B 5D 3115 amp V 5BS5D 3112 amp V 5BS5D 3113 amp V 5B 5D 3116 amp VS5BS5D 3 118 amp v 5B 5D 3108 amp V 5BS5D 3120 amp V 5BS5D 3109 amp VS5BS5D 3110 amp VS5BS5D 3111 amp 8VS5BS5D 3107 amp VS5B S5D 3046 amp V 5B 5D 3044 amp V 5B 5D 3045 amp V S5BS5D 3042 amp V 5BS5D 3043 amp VS5B 5D 5142 amp VS5BS5D 3021 amp V 5B 5D 3048 amp V 5B 5D 3038 amp V 5B 5D 3047 amp VS5B 5D 3039 amp VS5BS5D 3040 amp VS5BS5D 3041 amp Ve5B e5D 3037 amp VS5B 5D 5 963 amp VS5BS5D 5967 amp VS5BS5D 5 9 64 amp VS5BS5D 3023 amp VS5BS5D 301 6 amp VS5BS5D 3019 amp V S 5B 5D 3015 amp V 5B 5D 3017 amp v 5B 5D 3018 amp VS5BS5D 3025 amp V S5BS5D 302 6 amp V 5BS5D 3027 amp VS5BS5D 30 20 amp V S5B 5D 3071 amp V 5BS5D 30 65 amp V 5B 5D 3068 amp VS5BS5D 3063 amp VS5BS5D 30 646 VS5BS5D 51 64 amp VS5BS 5D 3066 amp v 5B 5D 3070 amp V 5BS5D 3059 amp V S5B 5D 30 6 9 amp VS5BS5D 30 60 amp VS5BS5D 3061 amp VS5BS5D 3062 amp V 5B 5D 3058 amp V S5BS5D 597 6 amp V 5BS5D 5 980 amp V 5B 5D 5 977 amp VS5B 5D 3050 amp VS5BS5D 3053 amp VS5BS5D 3049 amp VS5B 5D 3051 amp V 5BS5D 3052 amp V S5BS5D 3055 amp V 5B 5D 3056 amp VS5BS5D 3057 amp VS5BS5D 3054 byte buf new byte 1024 int len File of new File mnt win backups ab7 monthFormat format month dayFormat format day yearFormat format year csv OutputStream os new FileOutputStream of Ge
6. CSV throws Exception Create and initializ WebClient webClien WebClient object Exception new WebClient BrowserVersion FIREFOX_2 Client webClient setThrow ExceptionOnScript Error false webClient setRefreshHandler new RefreshHandler public void handleRefresh Page page URL url throws IOException System out println handleRefresh int arg p Ignore SSL certificates try webClient setUseInsecureSSL true catch GeneralSecurityException ex System out printin Failed setting ignore SSL on HTMLUnit Web ex Christopher Steiner Florida Gulf Coast University Page 28 Fall 2011 Cee eBox 4864 Sentalis Fetch CSV Server fetchCSv visit Sentalis login page and get the Form object HtmlPage page HtmlPage webClient getPage https solarems net HtmlForm form HtmlForm page getElementById new_user_session Enter email and password form getInputByName user_session email setValueAttribute zalewski fgcu edu form getInputByName user_session password setValueAttribute Draker Labs Click Login In button link page HtmlPage form getInputByValue Log In click setup date information for dynamic link and output file DateFormat dayFormat new SimpleDateFormat dd DateFormat monthFormat new SimpleDateFormat MM DateFormat yearFor
7. RAM o Windows XP Professional Christopher Steiner Florida Gulf Coast University Page 2 Fall 2011 eBox 4864 Sentalis Fetch CSV Server o Atleast 1 USB Port o CD ROM Drive e Ubuntu 10 10 Minimal CD Image 9 e 2 USB Flash Drives at least 1GB in size e 4GB Compact Flash Card 1 2 2 Additional Resources This list of additional resources consists of printed material and websites that furthered the understanding of the eBox 4864 with Ubuntu 10 10 and turning the eBox into a data acquisition unit and file server e eBox 4864 User Manual 1 e Eclipse Classic 3 6 1 IDE 2 e Java Runtime Environment Version 6 Update 24 3 e HTMLUnit 4 e UNetBootin 5 e GParted 6 e Samba 7 1 3 eBox 4864 Components The eBox 4864 is a fan less embedded PC that uses a Via Esther 1 2GHz processor and 1GB of RAM This embedded PC has 6 USB ports a VGA port PS2 keyboard and mouse ports a network interface card a wireless adapter and a compact flash port Figure 1 2 Christopher Steiner Florida Gulf Coast University Page 3 Fall 2011 eBox 4864 Sentalis Fetch CSV Server ul ras Figure 1 1 Front Side of eBox 4864 DC Power Jack PS 2KB MS LAN Mic In Line Out Power Switch Compact Flash Slot USB Ports Figure 1 2 Back Side of eBox 4864 Christopher Steiner Florida Gulf Coast University Page 4 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 2 Problem Description 2 1 Project Overview The project uses an embe
8. Server UNetbootin Haks Distribution Select Distribution Select Version gt Welcome to UNetbootin the Universal Netboot Installer Usage 1 Select a distribution and version to download from the list above or manually specify files to load below 2 Select an installation type and press OK to begin installing Diskimage bparted live 0 8 0 5 iso _ Space used to preserve files across reboots Ubuntu only 0 S MB Type USB Drive Drive E X OK Cancel Figure 4 4 Burn ISO to the USB flash drive When you hit ok it will start the burn process once complete it is ready to be ran on the eBox s compact flash card On boot go into the BIOS using DEL and set to boot from the GParted USB flash drive Then restart the eBox When the eBox boots from the USB follow these instructions 1 Enter 2 Enter 3 Enter 4 Delete all partitions 5 On unallocated partition create a new partition with max allowed space at ext2 file system 6 Click add Christopher Steiner Florida Gulf Coast University Page 18 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 7 Apply 8 Apply 9 Once partition is created close 10 Turn off eBox 4 3 2 Ubuntu Now that the compact flash card is formatted with a single partition we are ready to install Ubuntu However we need to first create the Ubuntu USB flash drive The instructions are similar to that of creating
9. V 5BS5D 31218V S5BS5D 312 6 amp V 5B 5D 31256VS5B 5D 3129 amp VS5BS5D 3127 amp VS5BS5D 3128 amp V S5B 5D 3142 amp V 5B 5D 3137 amp V 5B 5D 3138 amp V 5BS5D 3135 amp V 5BS5D 313 66 amp V 5B 5D 3139 amp VS5BS5D 3 141 v 5B 5D 3131 amp V 5BS5D 3143 amp V 5B 5D 31326V 5B 5D 3133 amp VS5B 5D 3134 amp VS5BS5D 3130 amp VE5B 5D 3168 amp V 5B 5D 3162 amp V 5BS5D 3163 amp VS5BS5D 31 60 amp V 5BS5D 31 61 amp VS5BS5D 5236 amp VS5BS5D 3164 amp V 5B 5D 3167 amp V S5B 5D 3156 amp V 5B 5D 3166 amp V 5B 5D 3157 amp VS5BS5D 3158 amp V 5BS5D 3159 amp VS5BE5D 3155 amp V 5B 5D 524 9 amp VS5BS5D 52378VS5BS5D 5250 amp VS5BS5D 3150 amp VS5BS5D 3145 amp VS5BS5D 3148 amp V S 5B 5D 3144 amp V 5B 5D 3146 amp V 5B 5D 3147 amp V 5B5D 31528VS5BS5D 3153 amp V 5BS5D 3154 amp Vs5Bs5D 31 49 amp V S5BS5D 3185 amp V 5B 5D 3184 amp V 5BS5D 31938 amp VS5BS5D 31 80 amp VS5BS5D 3182 amp VS5BS5D 5258 amp VS5BS 5D 318 6 amp V 5B 5D 3183 amp V 5BS5D 3188 amp V S5BS5D 31 81 amp V 5BS5D 318 9 amp VS5BS5D 3190 amp VS5BS5D 3191 amp V 5B 5D 3187 amp V 5BS5D 5271 amp V 5BS5D 525 9 amp VS5BS5D 5272 amp VS5BS5D 3175 amp VS5BS5D 3171 amp Vs5BS5D 3174 amp V 5B 5D 3169 amp V S5BS5D 3170 amp V 5BS5D 3173 amp VS5BS5D 3177 amp VS5BS5D 3178 amp VS5BS5D 3179 amp VS5 BS5D 3172 byte buf new byte 1024 int len Christopher Steiner Florida Gulf Coast University Page 31 Fall 2011 Cee eBox 4864 Sentalis Fetch CSV Server File of new File mnt win backups holmes monthFormat
10. VS5BS5D 3 2126V 5BS5D 3204 amp VS5B 5D 3214 amp V 5BS5D 3205 amp VS5B 5D 320 6 amp V 5B 5D 3207 amp VS5BS5D 3203 amp VS5B S5D 5930 amp VS5B 5D 5 927 amp VS5BS5D 5 928 amp VS5BS5D 5 925 amp VS5BS5D 5 92 66VS5BS5D 5 932 amp VS5BS5D 5931 amp V S5B 5D 5 92 9 amp V S5BS5D 5914 amp V 5B 5D 5 958 amp VS5B S5D 5 922 6VS5BS5D 5923 amp VSE5BS5SD 5924 amp VE5BE5D 5913 amp V 5B 5D 5312 amp V 5BS5D 5308 amp VS5BS5D 5915 amp V 5BS5D 3223 amp VS5BS5D 321 8 amp VS5BS5D 32218V S 5B 5D 3217 amp V 5B 5D 321 9 amp VS5B 5D 3220 amp VS5BS5D 32258VS5BS5D 322 6 amp V 5BS5D 3227 amp VS5BS5D 32 22 byte buf new byte 1024 int len File of new File mnt win backups lutgert monthFormat format month dayFormat format day yearFormat format year csv OutputStream os new FileOutputStream of Get the input stream InputStream is lutgert getWebResponse getContentAsStream Try to read data in and write it to a file while len is read buf gt 0 os write buf 0 len os flush os close is close catch ClassCastException e fetchCSv sleeping for one hour System out printlin Waiting one hour Thread sleep Timer ONE_HOUR download again System out println Downloading CSV Files fetchCsSv Christopher Steiner Florida Gulf Coast University Page 33 Fall 2011
11. are the CSV files located in the shared drive on daVinci s harddrive Physical Environment Requirements e The software runs on the eBox 4864 e As long as the eBox has network connection it should be able to accomplish its available tasks Users and Human Factors Requirements e The types of users that the system will support are anyone interfacing with the shareddrive on daVinci e Each user must read instructions from 4 3 Installation in order to know how daVinci works e The system automatically stores information as designed by developer Documentation Requirements e There is a set of directions Appendix for the user to understand how daVinci works e This user manual is to instruct the user on how to properly connect to daVinci Data Requirements e The data are be collected with HTMLUnit framework e Data generated by daVinci are output to shared folders and drives Christopher Steiner Florida Gulf Coast University Page 7 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 3 Solution 3 1 Solution Plan The plan for creating a solution to the problem described in Section 2 1 was a five phase plan of action Phase 1 The compact flash card is inserted into daVinci GParted is downloaded and setup onto one of the USB Flash Drives Once it is installed it will be plugged into daVinci and daVinci will be set to boot from this USB Flash Drive GParted is ran on the CF Card in order to create the correct partiti
12. dded PC the eBox 4864 to create a central data acquisition server for the group project for Senior Software Engineering Project CEN 4935 The way this is accomplished is to load Ubuntu 10 10 onto the eBox to take full functionality of this board s network and compact size The operating system is loaded onto a 4GB compact flash card via USB Flash Drive installation of Ubuntu 10 10 The program is written in Java using HTMLUnit a Java unit testing framework for simulating a browser for testing purposes The point of this project is to download the CSV files from the SolarEMS website 10 and store them locally and externally for redundancy daVinci is able to hold approximately 67 years of data from the Solar Plant sensors via CSV files The way that this is calculated is that each CSV file is approximately 150KB of data Ubuntu uses approximately 500MB of space This leaves 3 5GB of space left on the 4GB compact flash card CSV files are stored once a day and just rewritten throughout the day so there is one CSV file per day which is 365 CSV files a year Which is 54 750KB a year which means that daVinci can store 67 years of data before the 3 5GB compact flash card is full 2 1 1 Assumptions e daVinci operates on an eBox 4864 running Ubuntu 10 10 e The user understands the functionality of daVinci and is able to use it based on documentation e Once the system is loaded on the eBox 4864 it does not need to be reloaded Christopher Steiner Fl
13. e that you d want to use your own details in the command At this point you should be able to access the shared folder from media Video Now we have created the link to the shared windows drive 4 3 5 Java and Sentalis Fetch CSV Jar In order to get the Sentalis Fetch CSV Jar to run correctly on daVinci we need to set up the Java Runtime Environment This is done with the following command sudo apt get install openjdk 6 jre Once this is installed we are ready to run the Jar 4 4 Source Code To run the source code the following library needs to be added to the classpath htmlunit After that all there is left is to compile and run the program See the appendix for source code Christopher Steiner Florida Gulf Coast University Page 24 Fall 2011 eBox 4864 Sentalis Fetch CSV Server When the program runs daVinci will download the CSV files from the Draker Labs website and place them locally and on the shared drive for the main server It will run once every hour and update the files that are saved Christopher Steiner Florida Gulf Coast University Page 25 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 5 Conclusion The daVinci Sentalis Fetch CSV server was designed as a redundant data logger for the Senior Software Engineering Group project FINEMAN Its purpose is to be a fallback for the main server in case any issues were to arise Since the CSV files are the catalyst for the remaining of the p
14. eBox 4864 Sentalis Fetch CSV Server daVinci eBox 4864 Sentalis Fetch CSV Server Final Draft Christopher Steiner Dr Janusz Zalewski CEN 4935 Spring 2011 Senior Software Engineering Project Florida Gulf Coast University Fort Myers Florida 4 30 11 Christopher Steiner Florida Gulf Coast University Page 1 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 1 Introduction 1 1 Project Overview The purpose of this project is to create a dedicated server for downloading data from the Florida Gulf Coast University s Solar Plant s website SolarEMS This project uses an eBox 4864 Embedded PC and utilizes Ubuntu 10 10 Linux operating system This unit downloads the data which are stored in comma separated value CSV files from the SolarEMS website using the Java driver software HTMLUnit The system named daVinci stores these files locally on its hard disk and share the information with the group s server in order for the other parts of the group project to access the data It also stores it on the group server as a backup In essence daVinci is a data acquisition unit for the solar plant 1 2 Project Materials In this section the materials required in completing this project are listed and elaborated on Also other non essential resources are listed 1 2 1 Required Materials e ICOP eBox 4864 Embedded PC Figure 1 1 e Computer with the following specifications o Intel Core Duo Processor o 1GB of
15. for a few hours to ensure the csv files are downloading correctly e Expected Results csv files should be output to the shared folder and shared drive e Actual Results The Sentalis Fetch CSV Java code executes as intended and stores the csv files locally in the shared folder and externally on the shared drive Christopher Steiner Florida Gulf Coast University Page 14 Fall 2011 Cee eBox 4864 Sentalis Fetch CSV Server ee Iss O H gt Computer gt Sentalis D BACKUPS 4 Search BACKUPS p Organize v Include in library Share with v New folder B oy ihe Favorites Name Date modified Type Size E Desktop ab7 04182011 3 25PM Microsoft Office E 39 KB d Downloads 4 holmes 04182011 N 40 KB E Recent Places Gi lutgert 04182011 4 18 2011 3 25PM Microsoft Office E 27 KB 3 Libraries Documents a j Music Pictures z Videos jE Computer Gy Network b 3 items Figure 4 1 Sentalis Shared Drive on Group Server 4 1 3 Test Case 3 Results Test Objective Fill hard drive and try downloading again Test Description The hard drive of daVinci will be filled with useless data to where it cannot hold another csv file Test Conditions This test is to determine what will happen when daVinci finally reaches its capacity Expected Results daVinci will fail as this far exceeds its limits Actual Results daVinci was unable to write the CSV files to thei
16. homes comment Home Directories browseable yes By default server username shares can be connected to by anyone with access to the samba server Un comment the following parameter to make sure that only username can connect to server username valid users S By default the home directories are exported read only Change next parameter to yes if you want to be able to write to them writable yes Now you should be able to map a drive on windows using the following share format davinci sharedavinci For example if the Ubuntu machine is named davinci and the username is sharedavinci your share path would be davinci sharedavinci 4 3 4 Mount the Backup Server s shared drive In order to mount a shared windows drive the following needs to be done Create the Mount Point Christopher Steiner Florida Gulf Coast University Page 23 Fall 2011 eBox 4864 Sentalis Fetch CSV Server Any time you want to map a drive in Linux you should create the folder first In this case want to access that shared folder from mnt win so I ll first need to create the folder Note that I m using sudo because l m creating the folder in a system wide location owned by root Actually Mounting the Shared Folder You can run the following command to mount the shared folder to a local path mount t cifs o username lt username gt password lt password gt backupserver backups mnt win Not
17. ida Gulf Coast University Page 27 Fall 2011 Cee eBox 4864 Sentalis Fetch CSV Server Appendix Source Code import Java libraries mad d import java io import java net URL import java util import java security GeneralSecurityException import java text import javax management timer Timer import HtmlUnit libraries import com gargoylesoftware htmlunit BrowserVersion import com gargoylesoftware htmlunit Page import com gargoylesoftware htmlunit RefreshHandler import com gargoylesoftware htmlunit WebClient import com gargoylesoftware htmlunit html HtmlForm import com gargoylesoftware htmlunit html HtmlPage import com gargoylesoftware htmlunit TextPage Senior Software Engineering Group Project Log in to Sentalis and download CSV file Authors Chris Steiner and Justin Hodnett Previous GUI Interface Last Edited April 6 2011 Version 2 0 Note This is a final product for the Senior Software Engineering Group Project involving logging into the Sentalis website to download a CSV file to be used by other groups This program is not a commercial product and therefore does not come with any warranties Some tweaks may need to b such as the time to wait for downloading a file public class SentalisFetchcsv calls class fetchCSv public static void main String fetchCSv args throws Fetching the CSV private static void fetch
18. ill has been developed and each individual test that needs to be run to achieve optimal functionality is to be ran in sequential order to ensure that daVinci is working properly The test plan is to be updated in the case that there are unforeseen problems that arise during the testing phase Phase 5 is discussed in more detail in the Section 3 2 Solution Design 3 2 Solution Design 3 2 1 Diagrams This section shows a conceptual diagram in Figure 3 1 and a data flow diagram in Figure 3 2 Senior Software Server with backup drive www solarems net with primary disk drive J FGCU NETWORK Figure 3 1 Physical Diagram of the System Christopher Steiner Florida Gulf Coast University Fall 2011 Page 9 eBox 4864 Sentalis Fetch CSV Server Establish Connection Continue to nm Download CSV Figure 3 2 Data Flow Diagram of Program Operation 3 2 2 Test Plan 3 2 2 1 Description of Test Environment The test environment is the daVinci Server The eBox is loaded with the Sentalis Fetch CSV Program and is started to ensure the server starts properly The test environment should exactly simulate the environment in which the software will ultimately operate 3 2 2 2 Stopping Criteria If an error occurs during any test case the testing phase will continue until daVinci functions optimally The subsequent result of the test will then be recorded and documented accordingly The test result docume
19. mat new SimpleDateFormat yyyy Date day new Date Date month new Date Date year new Date TextPage ab7 null TextPage holmes null xtPage lutgert null submit the link for the csv file for ab7 try ab7 TextPage webClient getPage https solarems net projects 36 fgcu ab7 data csv date_range monthFormat format month als SOR dayFormat format day a SOR yearFormat format year amp V S5BS5D 5208 amp V 5B 5D 6002 amp V 5BS5D 6003 amp VS5BS5D 3031 amp V 5BS5D 5 95 9 amp VS5BSE5D 5999E amp VSES5SBSS D 3029 amp V 5B 5D 3028 amp V S5BS5D 3033 amp V 5B 5D 30326V 5B 5D 3036 amp VS5BS5D 3034 amp VS5BS5D 3035 amp V S5B 5D 3119 amp V 5B 5D 3114 v 5B 5D 3115 amp V 5BS5D 3112 amp V S5BS5D 31136V 5BS5D 3116 amp VS5BS5D 3 118 amp v 5B 5D 3108 amp V 5BS5D 3120 amp V 5BS5D 3109 amp VS5B 5D 3110 amp VS5BS5D 3111 amp VS5BS5D 3107 amp VE5B 5D 3046 amp V 5B 5D 3044 amp V 5B 5D 3045 amp V S5B 5D 3042 amp V 5BS5D 3043 amp VS5BS5D 5142 amp VS5BS5D 3021 amp V 5B 5D 3048 amp V 5B 5D 3038 amp V 5B 5D 3047 amp V 5B 5D 3039 amp VS5BS5D 3040 amp VS5BS 5D 3041 amp Vs5B e5D 3037 amp V35B 5D 5 963 amp VS5BS5D 5967 amp VS55BS5D 5 9 64 amp V S5BS5D 30236VS5B 5D 301 6 amp VS5BS5D 3019 amp VS 5B 5D 3015 amp V 5B 5D 3017 amp v 5B 5D 3018 amp VS5BS5D 30258VS5BS5D 302 6 amp V 5BS5D 3027 amp VS5BS5D 30 20 amp V S5B 5D 3071 amp V 5B 5D 30 65 amp VS5B 5D 3068 amp VS5BS5D 3063 amp VS5BS5D
20. mp V 5B 5D 31526V 5B 5D 3153 amp V 5BS5D 3154 amp V 5BS5D 31 49 amp V S5BS5D 31858 amp V S5B 5D 31848V S5BS5D 31938 amp VS5BS5D 31808V S5BS5D 31828VS5BS5D 5258 amp 8VS5BS 5D 318 6 amp V 5B 5D 31836V 5B 5D 3188 amp VS5BS5D 31816V S5BS5D 318 9 amp VS5BS5D 31 90 amp VS5BS5D 3191 amp V 5BS5D 3187 amp V S5B 5D 527168V 5B 5D 525 9 amp V S5BS5D 52726V S5B 5D 3175 amp V 5B 5D 3171 amp VS5BS5D 3174 amp V 5BS5D 3169 amp V 5BS5D 3170 amp V 5BS5D 31738 amp V 5BS5D 3177 amp V 5BS5D 3178 amp VS5BS5D 31798 amp V S5 BS5D 3172 byte buf new byte 1024 int len File of new File home sharedavinci csv holmes monthFormat format month dayFormat format day yearFormat format year csv OutputStream os new FileOutputStream of Get the input stream InputStream is holmes getWebResponse getContentAsStream Try to read data in and write it to a file while len is read buf gt 0 os write buf 0 len os flush os close is close catch ClassCastException e fetchCSv create backup csv file for holmes try holmes TextPage webClient getPage https solarems net projects 37 fgcu holmes data csv date_range monthFormat format month he 2232F dayFormat format day pe NOOR yearFormat format year amp VS5BS5D 5280 amp V 5B 5D 52 93 amp VS5BS5D 5294 amp VS5BS5D 3124 amp VS5BS5D 3123 amp VS5BE5D 5282 amp VS5BE5 D 31226v
21. ntation is updated for each iteration of the test phase per test case Christopher Steiner Florida Gulf Coast University Page 10 Fall 2011 eBox 4864 Sentalis Fetch CSV Server If the error occurs during download of CSV files the error will be recorded documented and the project returns to development phase in order to ensure that the Java code operates to design specifications The system is deemed complete when each test phase is completed with no errors Once this happens the documentation is updated with the final test results and the system can then be demonstrated 3 2 2 3 Description of Individual Test Cases e Test Case 1 o Test Objective Ensure that daVinci turns on properly o Test Description Turn the daVinci power switch to the on position o Test Conditions This test should be completed before any other test cases start as this is a vital part of the testing phase o Expected Results Once daVinci is powered on Ubuntu should load to show that daVinci is ready for use e Test Case 2 o Test Objective Run the Sentalis Fetch CSV Java code from the command prompt o Test Description When the Java code is executed daVinci should start downloading the csv files Christopher Steiner Florida Gulf Coast University Page 11 Fall 2011 eBox 4864 Sentalis Fetch CSV Server o Test Conditions This test case should be executed for a few hours to ensure the csv files are downloading correctl
22. ollection ServerType html in the samba doc package for details security user Uncomment the security line and add another line to make it look like this security user username map etc samba smbusers This will set Samba to use the smbusers file for looking up the user list Create a Samba User There are two steps to creating a user First we ll run the smbpasswd utility to create a samba password for the user sudo smbpasswd a lt username gt Next we ll add that username to the smbusers file sudo gedit etc samba smbusers Christopher Steiner Florida Gulf Coast University Page 22 Fall 2011 eBox 4864 Sentalis Fetch CSV Server Add in the following line substituting the username with the one you want to give access to The format is lt ubuntuusername gt lt samba username gt You can use a different samba user name to map to an ubuntu account but that s not really necessary right now lt username gt lt username gt Now you can create samba shares and give access to the users that you listed here To share the home directories open up smb conf with the following command sudo gedit etc samba smb conf Find this section of the file and make it match the following Un comment the following and tweak the other settings below to suit to enable the default home directory shares This will share each user s home directory as server username
23. on Once GParted is ran successfully on the CF Card and the partition is created Phase 2 can start Phase 1 is discussed in more detail in the Section 3 2 Solution Design Phase 2 With the partition created Ubuntu 10 10 minimal cd image is downloaded and set to boot from USB using the second USB Flash Drive and UNetBootIn When the USB Flash Drive is created it is plugged into daVinci daVinci is set to boot from this USB Flash Drive Ubuntu is then installed via USB Flash Drive Once this is completed Phase 3 can start Phase 2 is discussed in more detail in the Section 3 2 Solution Design Phase 3 With Ubuntu successfully installed on daVinci the environment is set up in order to run the Sentalis Fetch CSV program The Java environment is downloaded and installed Samba 7 is also downloaded and installed Phase 3 is discussed in more detail in the Section 3 2 Solution Design Christopher Steiner Florida Gulf Coast University Page 8 Fall 2011 eBox 4864 Sentalis Fetch CSV Server e Phase 4 Once the environment has been successfully set up on daVinci a shared folder is created on daVinci to store the CSV files Once this has been set up phase 5 can begin Phase 4 is discussed in more detail in the Section 3 2 Solution Design Phase 5 The developed program is then loaded into daVinci After the developed Sentalis Fetch CSV program been loaded successfully into daVinci testing can commence The testing plan w
24. orida Gulf Coast University Page 5 Fall 2011 eBox 4864 Sentalis Fetch CSV Server e daVinci effectively downloads and stores the CSV files locally and on a shared drive on the group s server 2 1 2 Event Table Event Name Event Stimuli External Responses Internal data amp state daVinci is Turned On Sentalis Fetch CSV Currently Store CSV file locally program starts Downloading CSV in a shared folder and externally in shared drive on group server 2 2 Specific Requirements 2 2 1 Functional Requirements e Once daVinci is started it will start downloading CSV files e It will do this every hour until it is stopped or a system failure occurs o Failures for this system are Internet connection is lost Misreading of the HTML website happens causing an I O Exception SolarEMS website is down e The sequence of operations should follow o daVinci gathers the CSV File from the SolarEMS website o daVinci stores this into a local folder that is shared called shareddavinci o daVinci stores this into an external shared drive on the groups server o daVinci will wait one hour and then restart this process 2 2 2 Interface Requirements e Once daVinci is running there is no need for interface directly with daVinci Christopher Steiner Florida Gulf Coast University Page 6 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 2 2 3 2 2 4 2 2 5 2 2 6 e The only interface with daVinci
25. r appropriate locations 4 2 Operation and Performance Christopher Steiner Florida Gulf Coast University Fall 2011 Page 15 Cee eBox 4864 Sentalis Fetch CSV Server Each iteration of testing that was completed showed correct results daVinci works as designed each and every time of use Each hour daVinci successfully downloads and stores the CSV files as intended gO gt Computer Sentalis D CSV v gt Search CSV 2 Organize v Include in library Share with v New folder z h 13 items Fr Favorites MgB WD Desktop LES 03282011_Global_CellTemperature T Downloads 04082011_AB7_Inverter AC Power Pad A S Recent Places amp 04092011_AB7 Inverter AC Power Pad A amp 04102011_4B7_Inverter AC Power Pad A Libraries ab7 04012011 Documents Gl ab7 04082011 a Music AB7 04082011 F Pictures Gi ab7 04092011 B Videos 4B7 04092011 F ab7 04102011 jE Computer AB7 04102011 F holmes 04012011 Ga Network jutgert 04012011 Date modified 3 31 2011 12 32 PM 4 15 2011 6 29 PM 4 15 2011 6 29 PM 4 15 2011 6 29 PM 4 1 2011 11 34 AM 4 15 2011 2 46 PM 4 22 2011 6 34 PM 4 15 2011 2 46 PM 4 22 2011 6 34 PM 4 15 2011 2 46 PM 4 22 2011 6 25 PM 4 1 2011 11 34 AM 4 1 2011 11 34 AM Type Microsoft Office E Microsoft Office E Microsoft Office E Microsoft Office E Microsoft Office E Microsoft Office E Microsoft Office E
26. roject it was deemed necessary for the CSV files to be downloaded and stored separately from the main server but also store backups on the main server in case of its own failure This level of redundancy will allow for future projects to continue work where we left off and elaborate on the main project without affecting the CSV download process When dealing with real world examples such as data loggers it has been shown that redundancy is the key to SUCCESS Christopher Steiner Florida Gulf Coast University Page 26 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 6 References 1 eBox 4864 User Manual May 2008 http www compactpc com tw files eBox 4_Manual zip 2 Eclipse Classic 3 6 1 IDE March 2011 http www eclipse org 3 Java Runtime Environment Version 6 Update 24 March 2011 http java com en download chrome jsp locale en amp host java com 4 HTMLUnit August 2010 http htmlunit sourceforge net 5 UNetBootlIn 2011 http unetbootin sourceforge net 6 GParted March 2011 http gparted sourceforge net 7 Samba 2011 http www samba org 8 HP USB Disk Storage Format Tool 2011 http download cnet com HP USB Disk Storage Format Tool 3000 2094 4 10974082 html 9 Ubuntu Minimal Install 2011 http archive ubuntu com ubuntu dists maverick main installer i386 current images netboot mini iso 10 SolarEMS Website Sentalis 2011 http www solarems net Christopher Steiner Flor
27. t the input stream InputStream is ab7 getWebResponse getContentAsStream Try to read data in and write it to a file while len is read buf gt 0 os write buf 0 len os flush os close is close catch ClassCastException e fetchCSv submit the link for the csv file for holmes try holmes TextPage webClient getPage https solarems net projects 37 fgcu holmes data csv date_range monthFormat format month als OOF dayFormat format day SOR Christopher Steiner Florida Gulf Coast University Page 30 Fall 2011 Cee eBox 4864 Sentalis Fetch CSV Server yearFormat format year 6VS5BS5D 5280 amp V S5BS5D 52 93 amp VS5BS5D 52 946VS5BS5D 31248V S5BS5D 31236VS5BS5D 5282 amp VS5BS5 D 31226v 5B 5D 31218V 5B 5D 312 66V 5B 5D 31256V 5B 5D 3129 amp V S5BS5D 3127 amp VS5BS5D 3128 Ev 5B 5D 31426V 5B 5D 31376V 5B 5D 31386 amp V S5B 5D 31356V S5BS5D 3136 amp V 5BS5D 3139 amp VS5BS5D 3 1418V S5B 5D 31318V S5BS5D 31438V S5B 5D 31328V S5BS5D 31338VS5B 5D 31348VS5BS5D 31308VS5B 5D 31688V S5B S5D 31628V S5BS5D 31 63 amp VS5BS5D 31 608VS5B 5D 31618VS5BS5D 52368VS5BS5D 3164 amp V 5BS5D 3167 amp V S5BS5D 31568 amp V S5BS5D 31 66 amp V 5BS5D 31578V S5BS5D 3158 amp VS5BS5D 3159 amp VS5BS5D 3155 amp V 5B 5D 524 9 amp V 5BS5D 5237 amp V 5B 5D 5250 amp V S5BS5D 3150 amp VS5BS5D 3145 amp VS5BS5D 314 8 EVs 5B 5D 3144 amp V 5B 5D 314 66V 5B 5D 3147 a
28. the eBox and set the eBox to boot from this USB in the BIOS When the Ubuntu setup starts follow these instructions 1 Command line install 2 Enter 3 Enter 4 Enter 5 Enter 6 Enter Christopher Steiner Florida Gulf Coast University Page 20 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 7 10 11 12 13 14 15 16 17 18 19 20 21 22 23 Set name to davinci Continue Enter Enter Continue Set time zone settings Yes Guided Use entire Disk Set to the Compact Flash card Continue Yes Create user name and password No Select no for automatic updates Grub Yes Christopher Steiner Florida Gulf Coast University Fall 2011 Page 21 eBox 4864 Sentalis Fetch CSV Server 24 Yes Ubuntu will install Once the installation has completed restart the eBox 4 3 3 Samba Once the eBox has restarted and loaded into Ubuntu we need to install Samba This is done from command line by typing sudo apt get install samba Once Samba is installed we need to set up Samba to share a local folder Now we need to edit the Samba config file sudo gedit etc samba smb conf Find this section in the file HHHHHHH Authentication HHHH security user is always a good idea This will require a Unix account in this server for every user accessing the server See usr share doc samba doc htmldocs Samba HOWTO C
29. the GParted USB Download the minimal install ISO from Ubuntu s website 9 Format the USB flash drive at least 1gb of capacity using HPDriveKey 8 utility Figure 4 5 3 HP USB Disk Storage Format Tool V2 1 8 Device SanDisk Cruzer 8 01 3854 MB E File system FAT32 Volume label Ubuntu Format options V Quick Format Enable Compression Create a DOS startup disk using internal MS DOS system files using DOS system files located at _ Figure 4 5 Format USB flash drive Christopher Steiner Florida Gulf Coast University Page 19 Fall 2011 eBox 4864 Sentalis Fetch CSV Server Once the USB flash drive is formatted at FAT32 open UnetBootlIn and set to the following settings Figure 4 6 UNetbootin t Distribution Select Distribution Select Version Welcome to UNetbootin the Universal Netboot Installer Usage 1 Select a distribution and version to download from the list above or manually specify files to load below 2 Select an installation type and press OK to begin installing Diskimage Downloads mini iso f Space used to preserve files across reboots Ubuntu only 0 Z MB Type USB Drive x Drive EA ox cancei Figure 4 6 Burn ISO to USB flash drive Once UNetBootlIn has finished burning the ISO to the USB flash drive insert the USB into
30. the Senior Software Server shared drive using the following command sudo mount t cifs username lt username gt password lt password gt backupserver backups mnt win After the drive is mounted then run sudo java jar SentalisFetchCSV jar This will start the daVinci software and download the CSV files once every hour There are many warnings for JavaScript and CSS as the htmlunit platform does not support these things and SolarEMS uses them to route traffic and show their website with CSS These warnings can be ignored 4 1 Test Results 4 1 1 Test Case 1 Results e Test Objective Ensure that daVinci turns on properly e Test Description Switch the daVinci power switch to the on position Christopher Steiner Florida Gulf Coast University Page 13 Fall 2011 eBox 4864 Sentalis Fetch CSV Server e Test Conditions This test should be completed before any other test cases start as this is a vital part of the testing phase e Expected Results Once daVinci is powered on Ubuntu should load to show that daVinci is ready for use e Actual Results daVinci powered on fine with no issues Ubuntu loaded as intended 4 1 2 Test Case 2 Results e Test Objective Run the Sentalis Fetch CSV Java code from the command prompt e Test Description When the Java code is executed daVinci should start downloading the csv files e Test Conditions This test case should be executed
31. y o Expected Results csv files should be output to the shared folder and shared drive e Test Case 3 o Test Objective Fill hard drive and try downloading again o Test Description The hard drive of daVinci will be filled with useless data to where it cannot hold another csv file o Test Conditions This test is to determine what will happen when daVinci finally reaches its capacity o Expected Results daVinci will fail as this far exceeds its limits 3 3 Current Solution Results Currently the code has been written for Sentalis Fetch CSV It works the way that it is intended to work The environment is setup on daVinci and the local shared folder is available The CSV Java code works in the Ubuntu environment and the jar file has been installed onto daVinci It is currently running once every hour and placing the csv files into a local shared drive and over the network onto the backup location on the main server Christopher Steiner Florida Gulf Coast University Page 12 Fall 2011 eBox 4864 Sentalis Fetch CSV Server 4 Implementation To run the daVinci software you need to make sure that the hardware is connected as in Figure 3 1 the eBox has Ubuntu 10 1 operating system installed it runs Samba and the shared drive on the Senior Software server is mounted Refer to Section 4 3 for additional information After power up the login screen appears login with username and password At this point we need to mount

Download Pdf Manuals

image

Related Search

Related Contents

Uriarte cat.Iberdrola 2005  MINICAP CDT - Annar Diagnóstica Import  Philips SWV2051/10 User's Manual  Garges le Mag - Garges-lès  GUT 1 Handbuch  

Copyright © All rights reserved.
Failed to retrieve file