Home

IT2901 - Informatikk prosjektarbeid II μC Software - Lab

image

Contents

1. E If you do not see your device in the screen click Add device to add a device manually or Browse shop to browse without connecting a device gt 653 Co a b Figure D 2 D 2 a The device list with Bluetooth devices D 2 b The device list when connected to a device To connect to a device simply press the appropriate device in the list and a connection will be established Some devices require a password in order for connection to be made In this case will selecting this device trigger a password input prompt A dialog box will show whether or not the connection was sucecssfully established The background of the now connected device in the list will turn green to indicate that it is connected 93 D 3 DEVICE LIST Chapter D D 3 1 Adding Device Pressing the Add device button will give you a choice of how you want to add or connect to a device You can attempt to connect to a device using either a QR Code or input a serial adress laz Add device Click to connect with your bluetooth device by scanning its QR code Click to insert the MAC address of your bluetooth device Figure D 3 The options for adding devices D 3 1 1 QR Code In order for you to connect with a QR Code an app external app for scanning QR Codes must first be installed on the Android device This will allow you to scan a QR Code which will automatically connect to an Arduino device if valid connection informati
2. Hide show incompatible appli cations As the functionality for hiding incompatible apps already had been implemented in the GUI at this point it was decided to keep it there to illustrate the functionality In the final version of the application the Hide incompatible option hides the empty 23 4 4 USE CASES Chapter 4 illustration apps from the user A standard for microcontrollers was written This standard describes how filtering could be implemented A document of this standardization can be found in Appendix C 4 3 2 Additions STK500 protocol As of midterm implementing the STK500v1 protocol in Java was added to the requirements Standard for defining uC Software Store compatible microcontroller based de vices As FR04 Hide show incompatible applications was removed from the functional requirements a proposal for an implementation of this requirement were to be specified instead This document were to contain a standard for how this functionality could be designed and implemented in future work 4 4 Use cases The following illustrations and tables were the foundation for the iterations in the devel opment process Enters Google Play Downloads Android and installs phone uCSS Owner Figure 4 1 Use case 1 The user opens Google Play and finds and installs the uC Software Store application The first use case describes how an Android owner can browse Google Play to install the uC Softwa
3. Test ID ST08 Test name Change connected device Test descrip tion Test that it is possible to first connect to one Arduino then another thus changing which device the Android application is connected to Precondition Two available Arduinos with Bluetooth enabled Test steps e Start program e Connect with Arduino 1 e Connect with Arduino 2 Success con dition Both connections are successful and the Android device is connected with Arduino 2 7 3 Test results In this section the results of all the tests performed will be presented In each subsection the result of the given type of test will be shown 7 3 1 Unit testing All written Robotium tests run without encountering errors This indicates that the units tested work properly and correct values are obtained throughout the testing A decision was made to not write any more tests as time was of the essence and resources were needed elsewhere 7 3 2 Integration testing When different units of the product were ready to be sewn together integration testing was performed If bugs and errors were encountered the person currently responsible for the integration testing would fix it 63 7 3 TEST RESULTS Chapter 7 7 3 3 System testing The system testing was performed according to the description of the tests in section 7 2 In table 7 9 the results of each test is shown These tests were performed when both unit t
4. Action overflow menu When the user clicks on the action overflow menu he will expect some sort of settings That is why this menu contains settings If the user will hide or show incompatible application to his Arduino this menu will toggle the preference as shown in Figure 6 17 54 6 3 DATABASE IMPLEMENTATION Chapter 6 6 2 3 Changes to the design In this section the changes made in the design guide will be presented The final design of the application can be viewed on an Android device Browse shop In the Browse shop screen shown in Figure 6 12 the swiping function was removed due to usability issues Peer reviews indicated that it would be more user friendly to have this as a separate screen instead of a fragment as shown in the design guide Application view Due to lack of time some simplifications were made to this screen It was decided to remove the images and functionality for adding comments was not im plemented Action overflow menu Several different options were added to the Action overflow menu It is convenient to show different options in this menu depending on which screen the user is on so the content of the menu changes throughout the application Add device manually The Bluetooth button in Figure 6 10 was removed as it was unnecessary Welcome screen The Welcome Screen was added as the start screen This makes it easier to navigate between Devices and Browse Shop It
5. e Exit Android application completely e Start Android application When the Arduino device is in range When the Arduino device is out of range off Success con dition When the last connected Arduino device is on and in range the Android device should connect to it immediately when the Android application is started and give feedback to the user If the Arduino device is out of range or off proper feedback should be given Table 7 6 Browse apps test Test ID ST06 Test name Browse apps Test descrip tion Browse apps in the Android application in a random fashion Precondition Database is populated Test steps Start program Choose a category Choose an app Go back and choose different app Swipe left or right to browse different sorting Success con dition User is able to browse apps 62 7 3 TEST RESULTS Chapter 7 Table 7 7 Install application on Arduino device Test ID ST07 Test name Install application on Arduino device Test descrip tion Choose a desired application to install on a connected Arduino device Precondition Android and Arduino device is connected via Bluetooth Test steps e Start program e Select desired app e Press Install e Press Confirm Success con dition Arduino app is installed on the connected Arduino device Table 7 8 Change connected device
6. 2 How to wire the hard reset using the HC 05 7 Work hours in each iteration throughout this project 2 Example of activity plan for the weeks 6 and7 Example of a wiring diagram scheme ooa o o o The welcome screen of the wC Software StOT8 o 000 D 2 a The device list with Bluetooth devices D 2 b The device list when connected to a device e The options for adding devices o e D 4 a The device list with Bluetooth devices D 4 b Screenshot from the shop with all apps shown 000002 eee eee App View showing information about a single app Change settings in the serial monitor in the Arduino IDE to configure the Bluetooth module ee Standard wiring of Bluetooth module E 2 a To configure the Bluetooth module through the Arduino wire the module like this E 2 b 78 Bibliography 1 electronicdesign com N P Web May 01 2013 lt http electronicdesign com communications what s difference between bit rate and baud rate gt 2 Kroll P and P Kruchten The rational unified process made easy A practitioner s guide to the rup Boston MA Addison Wesley Professional 2003 eBook 3 Scrum org N P Web Mar 13 2013 lt bhttp www scrum org Resources What is Scrum gt 4 Sommerville lan Software Engineering 9th ed Boston Pearson Custom Publishing
7. 2 3 Screen la Device list as shown in Figure 6 9 shows the list of available Arduino devices In the final design the list of devices fills the whole screen and the buttons and description text have switched places When a device is pressed a progress bar appears and stays on the screen until a valid Bluetooth connection with the chosen device is made 47 6 2 DESIGN OF THE ANDROID APPLICATION Chapter 6 Figure 6 9 The design for the device list of the discovered Bluetooth devices Screen 1b Add device manually as shown in Figure 6 10 appears after pressing the Add device button in Screen la It was chosen to remove the Bluetooth settings button as it proved unnecessary In the final design this screen contains only the QR Code button and Input serial button with a short description of the functionality of the button between them 48 6 2 DESIGN OF THE ANDROID APPLICATION Chapter 6 Figure 6 10 The design for alternative methods to add devices Screen 1b i Input serial as shown in Figure 6 11 appears when the Input serial button is clicked Figure 6 11 The design for Input serial box 49 6 2 DESIGN OF THE ANDROID APPLICATION Chapter 6 Screen 2a Browse shop as shown in Figure 6 12 is a screen for browsing all the apps for Arduino in the shop More categories have been added The user can swipe to the left or right to sort the available applications in diff
8. 6 12 groups the apps in different categories making it easier for the user to browse for apps When a category is chosen a new screen containing the apps in that category is created In this screen is it possible for the user to swipe left and right to change the way the apps is sorted This swiping was implemented because it easily and quickly selects what to show Top hits and All were chosen because the database is currently small and it is not necessary with a large amount of sort by tabs Other tabs could be easily implemented if need be Application view The application view as shown in Figure 6 14 should show all the details and information about an application that is useful and interesting to the user Rating description developer and application name were selected for trying to keep a standard Meaning that both Google Market and AppStore uses these elements and are expected to be familiar to most Android users When the Install button is clicked a confirmation box will pop up as shown in Figure 6 15 This is because the user might have clicked the button by accident or is not informed about what device he or she is connected to The device name will therefore be shown in this dialog box A progress bar will pop up when the user have confirmed the installation This is because the application should give an indicator on when the application is complete and when its safe to close the application
9. Android device using device list Goal Connect the Arduino device to the Android application with the use of device list Actors Arduino device owner Precondition Actor on Devices screen Prerequisite Installed wCSS End requirement The Arduino device is connected to the phone via Blue tooth Main flow 1 User presses the device list button 2 System opens the list of available Bluetooth devices 3 The user presses the device to connect to 4 The system pairs with the Arduino device Alternative flow None Parent UC 1 Child UC 7 Jacket owner Selects Arduino device Selects category Figure 4 5 Use case 5 The user selects a category and browses the applications The fifth use case describes how the user can browse apps in the CSS and filter them on categories Browsing of apps can be done both with or without pairing of an Arduino device 30 4 4 USE CASES Chapter 4 Table 4 5 Use case 5 ID 5 Name Browse apps Actors Arduino device owner Prerequisite Installed wCSS Precondition Actor on Device list End Requirement None Main Flow 1 The user selects an Arduino device 2 The user selects category One category is named all 3 The user browses apps Alternative Flow l a The user does not select Arduino device but browses anyway Parent UC 1 Child UC 7 Presses action overflow but
10. Bei 2 OVERVIEW 10 hike od A See le a hehe a 5 E 86 C Standard for defining uC Software Store compatible microcontroller based devices 87 Cal Introduction esia fas iy cay ton da BS Rls Bp tea ae Deed oh Me aad 87 C2 BASICS AA cate tora tnt eats Wt Pein ty Be tank Hee te ae ob oa hee Pe Sin eae don e 87 CEA A A tage cas deal Pees te Bed 88 GA Examples sa shook eos A A We Bods See 89 D uwCSS User manual 91 DEN SIOtro dUCHOM tr ta ad ob ee Be oe oe ei Be oa oe ee oo ip ee he A 91 D 2 Welcome Screen ooa a a 00 92 DSa DEVICE St ts la ot Panes Oke tne Be epost th sae co ee DONS Te te den attests 93 D 3 1 Adding Device s i p astera np E aai pasar 0002 aae ada ee eee 94 DITE QR Code ai a a Pale a BE ay 94 D32 Serials e eo ee eee eee a a ads Oe ees 94 DA The Shop 3 6204 a h e of a ahd ir ee de BE ae yh Eye do ee 95 DAL Searching Sur niie tek oe Ae ot ae ee ER a Oe A OS 95 Db APP VIEW ee aa a eir ia a ae a Ge E ee Y 96 D60 Settings ena a ad ele eB p eden ee ae aioe eee 97 E Installation guide 98 E 1 Upload the first application 2 2 e 98 Bald Arduino IDE p s tareh siah dee ee ee ee BO oe ape iD es 98 E 1 2 Configure Bluetooth module 0 0 200 98 E 1 3 Supported Bluetooth modules 2 00 100 E31 RNA sek ete ate A Pe AE ROY BG ce Beets G 100 CONTENTS Chapter 0 E 2 E 3 E 4 Bel 3 2 HOOI semi a mes e bi 100 E 1 4 Upload supported application o a 101 Andro
11. Goal Connect the Arduino device to the Android application with the use of QR Code Actors Arduino device owner Precondition Actor on Add device screen Prerequisite Installed wCSS Installed predefined QR reader End requirement The Arduino device is connected to the phone via Blue tooth Main flow 1 User presses the button indicating that he wants to pair with the Arduino device using QR Code 2 The system opens the QR reader application 3 The QR reader application reads the QR Code and returns the information it contains 4 The system pairs with the Arduino device Alternative flow 2 a The user does not have the a QR Code reader installed 2 b The system prompts the user if he wants to install a QR Code reader 2 c If no stop 3 a The QR reader is unable to read the QR Code 3 b Try again or stop Parent UC 1 Child UC 7 26 4 4 USE CASES Chapter 4 User uCSS System Presses Serial button lt includes gt Opens serial input Enters MAC address Connects Arduino device to phone Figure 4 3 Use case 3 The user connects to the Arduino by manual input of MAC address The third use case describes how the user can connect to an Arduino device trough the uC Software Store by inputting the MAC address of the device CSS determines whether or not this is a valid MAC address and attempts to pair the Android with the Arduino If the MAC address i
12. N P Web Apr 19 2013 lt http www sintef no gt Figure 1 1 b in section 1 3 N P Web Apr 19 2013 lt http www ntnu no gt Figure 2 2 in section 2 2 1 N P Web Mar 13 2013 lt http droidtrends com wp content uploads 2012 07 Google Play Store APK 3 7 15 jpg gt Figure 2 3 in section 2 2 2 N P Web Apr 19 2013 lt http getpebble com gt Figure 2 4 in section 2 3 N P Web Apr 19 2013 lt http fritzing org gt Figure 2 1 in section 2 1 1 N P Web Apr 19 2013 lt http www c3ns com c3nsservices_3 html gt 80 A Project documents Documents produced in relation to the project will be presented in this section Both status reports and activity plans were to be created and delivered to the supervisor every other week A 1 Status report example Below is a copy of a status report made by the group for the supervisor This status report encompasses both week 6 and 7 1 Introduction These two weeks were the first weeks of project work since little could be done prior to meeting the customer During the first week there was one member missing 2 Progress summary In this two week period we have completed on average 68 of the work scheduled on the activity plan We believe that we still are on schedule The work that was done was in general related to the design of the final product and making sure we have all the required libraries licenses and other factors that need to be in order before we s
13. N P Web Mar 13 2013 lt http msdn microsoft com en us library aa292128 v vs 71 aspx gt 19 Wikipedia org N P Web Mar 13 2013 lt http en wikipedia org wiki Functional_testing gt 20 Android com N P Web May 5 2013 lt http developer android com design gt 21 http git scem com N P Web May 12 2013 lt http git scm com book en 79 BIBLIOGRAPHY Chapter 9 22 23 24 25 26 27 28 Git Branching What a Branch Is gt http www websequencediagrams com N P Web May 12 2013 lt http www websequencediagrams com gt Arduino cc N P Web Feb 6 2013 lt http arduino cc en Main Software gt Github com N P Web May 9 2013 lt https github com Prosjekt2 09arduino ArduinoStore tree master Arduino ComputerSerial gt Arduino cc N P Web Mar 24 2013 lt http arduino cc en Guide Libraries gt Sparkfun com N P Web Feb 28 2013 lt https www sparkfun com datasheets Wireless Bluetooth rn bluetooth um pdf gt Elecfreaks com N P Web Feb 28 2013 lt http elecfreaks com store download datasheet Bluetooth HC 0305 20serail 20module 20AT 20commamd 20set 202011047 20revised pdf gt Arduino cc N P Web Mar 24 2013 lt http arduino cc en Tutorial HomePage gt Source of images This section containts the all the sources for all the images used in the report The images and sources that are not listed here is made by the project team Figure 1 1 a in section 1 3
14. T2901 Informatikk prosjektarbeid II uC Software Store Project Report 09 Arduino Jeppe Eriksen Bjgrn Arve Fossum Stale Semb Hauknes Wilhelm Walberg Schive Nina Margrethe Smorsg rd Robin Tordly May 12 2013 Abstract In cooperation with IDI at NTNU SINTEF was the contracting customer for this project hiring the group consisting of six students on the course IT2901 The project s aim was to expand the usability of existing Arduino devices and simplify the process of installing new functionality This report is an overview of the project of developing the system to do so and how the work of the developer team evolved alongside the demands and needs of the customer The base idea was to create an easily operable system running on Android based devices for installing compatible applications to the cus tomers existing Arduino device This was done by implementing the STK 500v1 protocol for communication with Arduino devices and creating a market application for Android This application handles connection via Bluetooth and data transfer over that protocol as well as containing the market for browsing of available apps The development of both the protocol and the Andriod application was done in Java as both were designed to run on Android devices Implementing and integrating the protocol proved to be among the most time consuming tasks in the project Contents 1 Introduction LV ERG OUPSE nyi e a oe ya Oe Bl
15. ac aaa Ve aah Se ote 1 2 The groupa iinu ea a Oe i AE Re igs a oie BO 1 3 The Gustomer ss eremi Sod ee ek Ae Rb ae ee oh a a 1 4 Problem description a ds Bera A a is a lios HCHO Oa x tdo a a is tii LG Definitions 4 ca a a a ead ay BS 1 6 1 Registered trademarks 02000000002 2 ae 2 Prestudy 2 1 Development methods a 2 1 1 Rational unified process 02000 00000 eee ee De MED CTU seh Sse cess NN 2 13 Waterfall model eee eee 2A Spiral model as oe ae ra eo ew ede ees 2 1 5 Lean software development 00202004 2 27 EXISTIDO Solutions aen a ee OS a e 8 2 2 1 Market applications 0 0 a 222 Pebble ice fac hee BAR E 2 3 Over the air transfer e 3 Project management 3 1 Development method e 3 1 1 Changes to description 2 2 20 0200 0000 eee ee 352 Team Toles si ad aot Be ek ok ae a EG ec At 3 2 1 Role description o 3 2 2 Division of labor 206 214 e Ee 3 3 Communication ui oe os a A E ae lek A A ote 3A Project plannings DIA Bee he ts Bie i Be oo a 3 4 1 Work breakdown structure WBS SAAC Gantt charti 022 ee diese Ses Gee RG Oy Seow Cowie ee 3 4 1 2 Work breakdown structure table WBS table 3 4 1 3 Work breakdown structure tree WBS tree 34 2 Editions t WBS acne ae ee a he a aoe ee dio Riskianalysis 424 sare ata gE nk RA oe a ee a ah
16. also provides an option checkbox that allows the user to choose whether or not they will automatically reconnect the next time the application is started Figure 6 18 shows a simple connection between the reconnect option and the welcome screen S WelcomeScreen onCreate Bundle void Reconnect onResume void onPreExecute void reconnect void dolnBackground Void Boolean setActivityTitle void onPostExecute Boolean void createDialog String Dialog Figure 6 18 The Welcome Screen will reconnect to last connected device if the user have this option enabled When the user clicks on Devices or Browse Shop a new activity is started 6 3 Database implementation SQLite was used as database language because it is integrated with Android and have much functionality that makes it easy to use in an Android application Because of changes to priorities the group and the customer agreed to drop the sync adapter and only use a local database 59 6 3 DATABASE IMPLEMENTATION Chapter 6 6 3 1 Database model In Figure 6 19 the database is shown as an ER Diagram Established appstore features like ratings and application pictures were not important to the customer Because of this the pictures table was not used appid oe rating sd binaryfileid developerid 1 1 1 1 appid category file description requirementid 0 n appHasPictures 1 1 0 n 1 1 pictureid deve
17. computer with a USB cable connected to the Arduino board USB is used because it offers a stable connection and a standard ized cable This project s main goal was to use Bluetooth instead of a wired connection to program an Arduino device To connect to the Arduino via Bluetooth it was wired as shown in Figure 2 4 11 2 3 OVER THE AIR TRANSFER Chapter 2 TX RX IGITAL 22 aa Ar lt ino v vw arduino cc ANALOG IN e 012006 A WER nd Vin Made with E Fritzing org Figure 2 4 How a Bluetooth piece is connected on an Arduino device An extended prestudy concluded with the Bluetooth module RN 42 6 being a well docu mented and promising component for the purposes of over the air installation T he proto col to upload new code to the microcontroller is quite advanced The uploading must be done without any errors and at the correct baud rate 12 3 Project management The following sections details the project management decisions of the project This in cludes choice of development method team member responsibilities communication chan nels and risk analysis 3 1 Development method Based on the customer requirement of short iterations it was decided early on to adapt an iterative and incremental development method for the project By working in an iterative manner it was possible to present prototypes and work done to the customer every week and at the same time receive feedback In this fa
18. devices As part of the assignment the group was supposed to implement filtering of apps that is incompatible with the connected device As mentioned in section 4 3 1 this requirement was omitted due to lack of time Instead of implementing the actual filtering into the application it was decided that the group should produce a standard for defining uC Software Store compatible microcontroller based devices This standard can be viewed in appendix C Future work should encompass implementing this or a similar standard into the uC Software Store Allowing users to filter apps according to compatibility with the connected device will empower the application and increase its usability 8 1 3 Performance Given more time the group would have had a higher focus on the performance of the uC Software Store Although the performance is satisfactory it is possible to enhance it Fu ture work on this issue should encompass profiling the application to identify non optimized sections in the code Optimization of battery usage should also be looked into 8 1 4 GUI The Android developer design guide teaches the developers of Android applications how to design applications that fits the Android platform Further work on the uC Software Store should make sure that the application follows the design guidelines provided by the Android Developer Guide 20 This implies correct use of colours scaling of the application to fit different screen sizes use o
19. for the project stated that each group member should work approximately 20 hours each week which meant at least three full days of work per group member each week As described in Chapter 3 3 interaction outside group meetings was mainly done by e mail or on Skype In Table 9 1 the total work hours for the group on every iteration is listed The reduction of hours in iteration 4 was due to the Easter holidays Regarding interaction between the group members no major issues were encoun tered All team members were minded to work at least the suggested amount of hours each week and deliver a finished product at delivery date To prevent potential conflicts rules and roles were established at an early stage of the project By establishing this at the beginning of the project the group might have avoided larger discussions and disagreements at a later stage Based on this it is believed that the preventive measures taken by the group in the initiation phase has played a major role in the avoidance of conflicts and disagreements throughout the project Table 9 1 Iterations and time spent Iteration Hours Iteration 1 Week 6 7 186 hours Iteration 2 Week 8 9 257 hours Iteration 3 Week 10 11 233 hours Iteration 4 Week 12 13 129 hours Week 14 15 195 hours Iteration 5 Week 16 17 248 5 hours Week 18 19 438 hours Iteration 6 Iteration 7 73 9 4 LESSONS LEARNED Chapter
20. have to think for themselves instead of simply following detailed steps The preface of these tasks was that the test subjects had bought a jacket with an Arduino device fitted in it This jacket was called an iJacket and they had just downloaded the yCSS in order for them to check what other applications they could install on the device 1 Select your jacket 2 Browse applications 3 Install the chosen application After the tests the test subjects were to be asked if at any point during the test they got stuck or confused at any task The feedback from the test subjects were to be recorded 7 1 4 User acceptance testing User acceptance testing was to be performed with the customer in order to ensure that requirements were met and to check whether or not the customer was satisfied This test was to be done in much the same way as the usability A phone with the application was given to the customer in order for him to get first degree experience with the application The tester was then asked to perform the same cases as in the usability tests while a group member recorded his reactions to the application 59 7 2 SYSTEM TESTING Chapter 7 There were also expert reviews held during a presentation at the offices of SINTEF The think aloud protocol was also used here These testers had much experience within development but not much knowledge about the task They were therefore given a brief presentation beforehand about the pr
21. having a wiring diagram schema Example in Figure C 1 87 C 3 TECHNICAL Chapter C Figure C 1 Example of a wiring diagram scheme All components used needs to be registered with the correct model number and the name of the producer see Table C 1 Table C 1 Example of component information XML document Category Model Producer Screen LCD 0025 SparkFun In addition a list of the component pins and which pins these are connected to on the device is required like in the following example in Table C 2 Table C 2 Example of pin setup XML document Component pin Device pin 0 6 1 7 C 3 Technical The serial number will be stored in the microcontroller s EEPROM When a bluetooth connection between the Android application and the microcontroller is established the serial number is sent from the microcontrollers EEPROM to the Android application The Android application will lookup the serial number towards a remote database and retrieve an XML document with information about components and how the pins are connected If the microcontroller does not have a serial number or the serial number does not exist in the remote database no application filtering can be performed 88 C 4 EXAMPLE Chapter C This XML document will be converted to an object that is easier to handle Every uC application in the database also has a corresponding XML document that is also converted to a
22. in the shop you can start a search for an app you want It doesn t matter how old or what buttons you have on your Android device 1t is possible to start a 95 D 5 APP VIEW Chapter D search from all buttons and devices The search results will show after pressing the search button and if there are no results you will be back at the shop screen with a toast telling you there were no results D 5 App View Upon selecting an app in the shop you will be taken to the app view This view displays more information about the app you selected like required hardware pictures developer and most importantly an install button Application PlayWithPlayers Robin AAA A Install his describes this amazing life changing app yey Figure D 5 App View showing information about a single app Upon pressing the Install button as long as you are connected to an Arduino device you will be first asked to confirm the action If you do the install will begin If however you are not connected to a device a dialog will open with the options of either going back to the app view or go directly do the device list to connect to a device 96 D 6 SETTINGS Chapter D D 6 Settings The settings available in uC Software Store are as follows Hide Show incompatible Allows you to hide show all apps not compatible with the currently connected device Connected device Shows the currently connected device Automatically reconnec
23. keeps track of differences between versions of files and allows for offline commits and branch creation as this is done locally first before pushing the updates to a repository There are various terminal and front end solutions available including a GUI ver sion from GitHub and Eclipse plugins Past experiences with Git plugins for Eclipse led to the decision to use terminal software as the GitHub program lacked advanced functionality regarding branching 21 among others Another benefit with that solution was that the VCS then was IDE and platform independent and that there was no need to use the IDE for working with the report repository 5 1 2 2 GitHub GitHub hosts repositories for use with the Git VCS They also provide basic issue tracking and social features such as following other developers or projects Paying customers can elect to hide their code while free users have to share their code with everyone one user can however keep one hidden project as long as he is the sole developer The customer required source code to be uploaded to GitHub and also recommended use of GitHub for requesting assistance using issues a recommendation that was followed 5 2 Project management tools The tools mentioned here were tools used in general management of the project This in cludes elements such as the planning of meetings writing and sharing information between group members 5 2 1 Google Docs Google Docs is a free to use onli
24. lt Java Class gt gt lt lt Java Interface gt gt STK500v1 lt lt Java Class gt gt no group09 stk500_v1 G BaseState bi no group09 stk500_w1 STK500v1 OutputStream InputStream Logger bytel YY RESULT_END_OF_STREANH int cetProtocolState ProtocolState SF RESULT_NOT_DONE int active boolean getProgress int SO TIMEOUT_BYTE_RECEIVED int activated boolean bake R abort boolean programUsingOptiboot boolean int boolean O BaseState Reader EReaderState wasCurrentStateActivated boolean hasStateBeenActivated boolean 0 execute void isReadingAllowed boolean O getState EReaderState read TimeoutValues int getResult int getEnum EReaderState forget void S Hex byte Logger lt lt Java Enumeration gt gt O getDataSize int ProtocolState getChecksumStatus boolean no group09 stk500_v1 O getHexLine int int byte SO INITIALIZING ProtocolState bytes ToHex byte String SY READY ProtocoiState oF oneByteToHex byte Sting Y CONNECTING ProtocoiState So WRITING ProtocolState 0 1 lt lt Java Interface gt gt lt lt Jawa Enumeration gt gt Logger no group09 stk500_v1 Reader InputStream Logger O wasCurrentStateActivated boolean O forget void O makeToast String void 0 1 O getState EReaderState O getResult int read TimeoutValues int O stop boolean O start boolean requestCompleteStop void O run void O s
25. mode After you have successfully connected to the Bluetooth module just write AT and press 100 E 2 ANDROID APPLICATION Chapter E enter You should get AOK back when you entered programming mode To change baud to 115200 type AT UART 115200 0 0 You should now get AOK back Other supported commands can be found in the datasheet 27 E 1 4 Upload supported application Open one of the example applications included in the ComputerSerial library using the Arduino IDE 23 File Examples ComputerSerial Examples Upload by clicking the Upload button E 2 Android application To be able to install the Android application on your device you have to allow installation of applications from unknown sources on the device On Android 4 x this option can be found in the security settings on the device In the security menu check the box next to Unknown sources To install the application on your device you have to transfer the uCSoftwareStore apk file to the device This file can be found the provided CD Once the file is transferred press the file to install the application and follow the on screen instructions E 3 Recover If the programming failed the Arduino needs to be reconfigured from a computer 1 Unplug the Bluetooth module 2 Plug a USB cable from your computer to the Arduino 3 Upload application as described in Section E 1 4 E 4 Develop your own apps To lea
26. on develop the Android application 84 B 5 ITERATION 5 Chapter B B 5 Iteration 5 Week 14 and 15 B 5 1 Summary Made good progress and much was done The group was more optimistic about the im plementation of the protocol and the development of the application was almost complete The group was now split into two where one group was writing the protocol and the other group was writing Unit tests and polishing the last parts of the application Use cases 4 5 and 7 were in focus during this iteration B 5 2 Overview e Added storage of hex files to content provider Wrote Robotium unit tests Wrote STK500 protocol in Java Android Finishing of the Android application except for the STK500 part Meeting with customer B 6 Iteration 6 Week 16 and 17 B 6 1 Summary Unexpected issues with programming the Arduino nearly caused the implementation to fail requiring a meeting with the customer Suggestions for alternate solutions were presented and it was decided to work in parallel on some of them The customer was to attempt to ask some experts in the field for some code review Shortly after the meeting the problem was resolved B 6 2 Overview e Meeting on protocol implementation problems e Problem resolution e Implement the STK500 to the Android application B 7 Iteration 7 Week 18 and 19 B 7 1 Summary These were the last two weeks scheduled for the project A new wrapper was created to solve the problem enco
27. participants are available for meeting Doodle was used to schedule the first meetings the group had before regular meetings were established 5 2 10 Fritzing Fritzing is a tool that lets the user draw circuit boards and wiring diagrams This makes simple diagrams that are easy to understand and easy to reproduce for users that do not understand electronics This tool is often used with the Arduino platform because usually the users of this platform have no experience with electronics Most of the standard electronic equipment used with the Arduino are included in this tool Fritzing was used to create the wiring diagram of the Bluetooth wiring and the iJacket clone 5 2 11 OmniGraffle OmniGrafHe is a software used to draw diagrams and charts This program makes it easy to draw tidy diagrams and charts OmniGraffle was used to create the ER diagram and use cases for the documentation 5 3 Test management The tools mentioned here were used for preparation and creation of tests for the project 5 3 1 Robotium Robotium is a JUnit based framework for the creation of automatic unit testing in Android It automates the created tests by going through the Android application as described in the tests This shows the tester each step and simulated click on the Android application allowing the tester to see if a mishap is due to the test itself being wrong or an error in the code 38 6 Design and implementation In this chapter the desi
28. the decision of the group will be presented in Chapter 3 1 2 1 1 Rational unified process Rational Unified Process RUP is an iterative and incremental software development pro cess model It is a process model that aims to capture the best practices in modern software development and present them in a tailorable form 2 Each iteration in this model results in an increment which is a release of a prototype and an improvement of the previous iteration Most of the iterations will in addition to work on prototypes also contain work on requirements design implementation and testing A feature of this model is that it is use case driven Every iteration takes a set of use case scenarios from the requirements and use those for the content of the iteration The model also requires the team to focus on the critical risks of the project early in the de velopment process This ensures that problem areas and uncertainties is dealt with before severe problems arise An illustration of the model is shown in Figure 2 1 The model consists of four phases e Inception e Elaboration e Construction e Transition Inception phase The inception phase is the smallest phase and should cover the work on identifying risks creating use cases establishing boundaries and so on Cost estimates are calculated in the inception phase This phase should result in a document that states 2 1 DEVELOPMENT METHODS Chapter 2 the core of the product with
29. to demonstrate the feasibility of the finished product 1 5 The goal The goal of the project task was to make Arduino easier to use for ordinary people by allowing easy browsing sharing and installation of applications on Arduino boards By developing an application for over the air installation of applications the finished product should ease the process of both installing and updating PUls on an Arduino 1 6 Definitions This is a list of terms and abbreviations used throughout the project report in order to clarify and explain their meaning 1 6 DEFINITIONS Chapter 1 uCSS uC refers to microcontroller and wCSS refers to Microcontroller Software Store which is the name of the Android application developed Activity In Android development an activity provides a user interface for a single screen in your application Action overflow In Android development actions that does not fit in the action bar menu bar on the top are moved automatically to the action overflow Android An operating system for mobile devices based on the Linux operating system It is developed by Google and the Open Handset Alliance Applications for Android devices are written in Java and all the software is open source released under the Apache License Apache A software foundation focused on open source and community driven software Arduino A tool for making Physical User Interfaces PUIs It is an open source physical computing plat
30. to present what the group was working on B 1 Iteration 1 Week 6 and 7 B 1 1 Summary These were the first two weeks of the project and the first group meeting was arranged Meeting with the customer to get the requirement specification and understanding of the projects goal was done Required libraries licenses and other factors was taken in account before the group could start developing No use cases were generated in this iteration as basic research and planning had to be done before scenarios could be generated B 1 2 Overview e Confirmed the understanding of the task e Ideas for identifying the capabilities of an Arduino device and how to communicate these to the store client Investigate potential solutions to facilitate over the air installation of Arduino appli cations e Started the design of the GUI for the Android application e Researched on Apache licenses e Meeting with customer B 2 Iteration 2 Week 8 and 9 B 2 1 Summary Architectural work and design of the user interface of the Android application Positive feedback on the GUI was received from the customer Design of use cases and further research was performed 83 B 3 ITERATION 3 Chapter B B 2 2 Overview Planned architectural design Designing of GUI Research on over the air implementation Research Ubicollab libraries Use iJacket generic application Bluetooth connection code Implemented a first sketch of the content provider Meeting w
31. with each piece building upon previously created pieces The use of Scrum requires the team to be divided into specific roles where each role has its own responsibility The following are the core roles of the Scrum team 3 4 2 1 DEVELOPMENT METHODS Chapter 2 Product owner The product owner represents the stakeholders in the project and is the voice of the customer It is the product owner s responsibility to ensure that the Scrum team at all times is working with the right things seen from a business perspective Scrum master The scrum master should act as a buffer between the development team and distracting influences so that the development team can deliver potentially ship pable products at the end of each sprint The scrum master should keep the devel opment team focused at all times Development team The development team is made up from three to nine persons with cross functional skills This team does all the actual work including development testing designing and so on 2 1 3 Waterfall model The waterfall model is among the first process models to be introduced In this model each phase in the development must be completed before one can advance to the next phase At the end of each phase in the development a review takes place In this review it is determined if the project is on the right path and if it should continue or not The phases in the development do not overlap 4 2 1 4 Spiral model The spir
32. 2011 Print 5 Poppendieck M and T Poppendieck Lean software development an agile toolkit Addison Wesley Professional 2003 Print 6 Sparkfun com N P Web Feb 21 2013 lt https www sparkfun com products 10393 gt 7 Iteadstudio com N P Web Feb 21 2013 lt ftp imall iteadstudio com Modules 1M120723009 DS_IM120723009 pdf gt 8 Microsoft com N P Web Mar 13 2013 lt http msdn microsoft com en us library aa292191 v vs 71 aspx gt 9 Microsoft com N P Web Mar 13 2013 lt http msdn microsoft com en us library aa292197 v vs 71 aspx gt 10 GeoSoft no N P Web Mar 13 2013 lt http geosoft no development unittesting html gt 11 Android com N P Web Mar 13 2013 lt http developer android com tools testing testing_android html gt 12 Nielsen Jakob Why you only need to test with 5 users NNgroup com N P Mar 19 2000 Web 16 Apr 2013 lt http ww nngroup com articles why you only need to test with 5 users gt 13 Atmel com N P Web Feb 8 2013 lt http www atmel com Images doc2591 pdf gt 14 Google com N P Web Mar 25 2013 lt https code google com p stkboot gt 15 Google com N P Web Mar 25 2013 lt https code google com p uos embedded gt 16 Atmel com N P Web Mar 26 2013 lt http www atmel com Images doc2525 pdf gt 17 Buzzle com N P Web Marl3 2013 lt http www buzzle com articles validation testing html gt 18 Microsoft com
33. 9 An associated chart diagram of the work hours is shown in Figure 9 1 Hours 450 7 P Chart Area 400 Y 350 Y 300 Y 250 7 i 200 Y E Hours 150 Y 100 Y 50 Y o a n 4 Iteration Iteration Iteration Iteration Iteration Iteration Iteration 1 2 3 4 5 6 7 Figure 9 1 Work hours in each iteration throughout this project 9 4 Lessons learned This section describes the most important lessons learned by the group throughout the project 9 4 1 Prestudy As mentioned in Section 9 1 2 it was originally assumed that an existing implementation of the STK500 protocol could be utilized A more thorough prestudy would have revealed this assumption to be false at a considerably earlier stage This would have allowed for more time to plan implement and test the implementation of the protocol The lesson learned from this is to do a thorough prestudy early in the project to back up every assumption with facts 9 4 2 Project management Based on the fact that every member of the group were used to different methods of communications during projects the communication exceeded the expectations This was because all members regularly checked Skype channel for messages The lesson learned was that Skype proved to be an effective channel of communication within the group As described in Chapter 5 1 2 2 GitHub was used for version control It is also possible to create issues highlighting what needs
34. Ba da 24 Use Case Zi e ae hee he bE dhe OU Sed 25 Us Cas a hte Ss Oh ode a Pe tie AR hoe RAS 27 Use cast x ote A Set te Pha Tart OF Wat et A A he AN 29 WserCase Si eid tb dees o ke PE we ee ee ee els 30 Use Case G ices kee dete a BR eo Se ee ee ek da 31 USE ICA MRS Sef citys tes tae Ahh ieee Be ee line Baie Neste St ctl 32 Use CaserBicge 2 As ee lie Stade das to lve Ue al eld te els AO iB 33 BT connection in service a a ao e 40 Over The Air Architecture oaoa aaa a 41 system Architecture oesi eni oe BO AR a a a a 42 UML AddDeviceScreen a a 42 UMEL Catesories s 2 2 4 tas 402 au a a ed Be T o o didan 43 UME Main GUT sae od es ae Besta oP hee Yeah bE ep Gol nee ob taa 44 UME Protocol uc A See betel Ae Me We E etd 45 Sequence diagram for programming 2 00282004 46 Screen la Device list o 48 Screen 1b Add device manually e 49 Screen 1b 1 Input serial o o a 49 Screen 2a Browse Shop o 50 Screen 2b Browse shop by category o o e e 50 Screen 3a Application view o o 51 Screen 3a i Installation confirmation 52 Screen 3a ii Progress of installation o a 53 Screen Xa Action overflow o 53 UML Welcome Screen aoaaa 55 ER Diagrams to a ad Se y ai tate y N 56 TT 8 1 9 1 Al C 1 D 1 D 2 D 3 D 4 D 5 E 1 E
35. Bluetooth connection with the Arduino There should be a connection with the Arduino at all times when its in range and it should automatically try to connect to the last connected device when the Android application starts up FRO5 Hide Show incompatible applications The Android application should be able to hide Arduino applications in uC Software Store which are incompatible with the connected Arduino device FROG Different ways to connect the Android to the Arduino It should be possible to connect to the Arduino with QR Code manual input of MAC address and from a list of discovered devices 22 4 2 NON FUNCTIONAL REQUIREMENTS Chapter 4 4 2 Non functional requirements NFRO1_ Usability People of all ages should be able to understand how to use the Android application and install applications on an Arduino NFRO2 Reliability The Android application Bluetooth connection should be stable NFRO3 Open source The project is under European R amp D project SOCIETIES All source code related to the Android application should be open source under Apache 2 0 license NFRO4 Platform compatibility CSS should be compatible with Android 2 3 and newer versions NFRO5 Extensibility It should be easy to add features and extend this product later The system should therefore be modular to simplify further development 4 3 Changes to requirements It was discovered that the over the air transfer of PUI apps to an Arduino device proved to be more de
36. CSS Arduino device connected to CSS Precondition Actor on Device list End requirement The application is installed on the Arduino device Main flow 1 The user selects the desired application 2 The user presses the install button 3 The user confirms the installation 4 The application is installed at the Arduino device Alternative flow 3 a The user cancels Parent UC 1 2 3 4 5 6 Child UC None Android phone Owner Enters device list Figure 4 8 Use case 8 When the user starts the application this screen will be shown where the user can choose to select device list or browse the shop The eighth use case is the welcome screen which shows every time wCSS is opened 33 4 4 USE CASES Chapter 4 Table 4 8 Use case 8 ID 8 Name Welcome screen Goal Open the application Actors Android application owner Prerequisite Installed wCSS Precondition None End requirement The application is opened Main flow 1 The user selects the wCSS application 2 uCSS is opened and the welcome screen is displayed Alternative flow None Parent UC 1 Child UC 2 3 4 5 6 7 34 5 Development environment In this chapter the different tools and resources used in relation with the project will be presented A general requirement for a tool to be used was that it was multi platform as three different operating systems wer
37. E 0123 gt POWER 35 Gnd Vin Ar luino L TX RX Made with EJ Fritzing org Figure 8 1 How to wire the hard reset using the HC 05 7 8 2 2 Security Bluetooth itself provides security measures through channel encryption and pairing devices In the case of critical devices additional security might be needed A simple way to incorporate this would be to store a key in the EEP ROM of the Arduino The ComputerSerial library would then require authentication based on this key before allowing the initial soft reset A QR code this should not be plainly visible could contain both the MAC address of the device and the required security details for ease of use though a manual input method should also be available This could easily be integrated with the regular connection management present in the application However this implementation is vulnerable to hard resets if the device restarts on a Bluetooth connection the security scheme is pointless Because of this the hard reset feature would have to be disabled on such devices meaning the added security is at the expense of ease of use This presents a second problem without a way to be sure of automatic error recovery even authenticated programming poses a risk to critical devices 69 8 2 STK500 AND OVER THE AIR INSTALLATION Chapter 8 Therefore where more than paired device security is required regular cabled programming is the safest way to go 8 2 3 Protoco
38. Green LED COM 09592 SparkFun Warn BT Module T9J RN42 SparkFun Require Speaker COM 09151 SparkFun Warn Potentiometer U 103 Sharma Require gt The user selects hide incompatible 89 C 4 EXAMPLE Chapter C The system Android application is doing a check of which applications should be hid den visible as illutrated in Table C 6 Table C 6 Comparison between two XML objects Connected Device Example uC app Model Producer Model Producer gt Example pC application will be hidden because it requires more functionality than the current connected microcontroller can offer 90 D uCSS User manual D 1 Introduction This is the user manual for the uC Software Store application It contains all the infor mation needed regarding common use and options uC Software Store is an application for the Android platform made as an app store containing applications for Arduino based projects You can browse different applications for Arduino projects and install them through a Bluetooth connection It is assumed that wC Software Store and optionally a QR Code reader is installed on an Android device and that a properly configured Arduino project with Bluetooth is nearby 91 D 2 WELCOME SCREEN Chapter D D 2 Welcome Screen The first screen encountered when entering uC Software Store for the first time is the welcome screen This screen offers the choice between going directly to
39. It detects the model of the phone in use and only shows applications supported by that phone This functionality is similar to the requirements for the Android application in the project Since Android users most likely are used to this user interface shown in Figure 2 2 it was desirable to emulate this user interface 2 2 EXISTING SOLUTIONS Chapter 2 EI Apps Q titan i Asphalt 7 Heat GAMELOFT Y titanium backup King Fighter III Caller Location ng INDIA PPS wks Free ANA Free Tanso Download Songs SS d Manager Fk m servi i L l titanium backup kkhk Free kiki Free 2MB 1 36GB amp Titanium Backup root FVD Free Video Hindu Calendar SE Jownloader kM n kihk Free AAA Installed titanium a Contra PiPo g Crime City 3 hdr un etd 26 Jul 2012 titanic games kiir Free AAA Free 1 3668 cv si a f Indian TV Live E Magic touch Heat TOP DEVELOPER t yuiop A water splash 33 C Allow automatic updating A Free Adi Free asdf g h j k 1 es Free Hindi Movies Car Racing Game RATE amp REVIEW a 2 zx cVvibnim Fok Free AAA Free DESCRIPTION f Bottle Shoot 2G to 3G Speed xy id Herm Broweer Hit the speed of heat in the newest fastest most eo Je vienallu etunninn aditian nf tha famad Acnhalt carios Figure 2 2 Screenshots from the Google Play Store showing their graphical user interface throughout the application Google Play fits the assignment in the way that it is a market applic
40. ON Chapter 6 Figure 6 16 The progressbar that will shop up during the installation over the air Screen Xa Action overflow as shown in Figure 6 17 is a screen that appears when the Action overflow button is clicked This menu is available from all the screen in the application with the exception of the preferences screen Figure 6 17 The menu bar that contains settings and properties 53 6 2 DESIGN OF THE ANDROID APPLICATION Chapter 6 6 2 2 Design decisions This section explains the reasoning behind the different aspects of the design Device list It should be simple and fit as many devices as possible even on the smaller cell phones As shown in Figure 6 9 it was decided to use discovered Bluetooth devices as a primary method of connecting to an Arduino The less frequently used methods for connecting to an Arduino like QR codes and serial input were put in another screen as shown in Figure 6 10 Because of license compatibility issues it was necessary to use external QR Code readers To give the user more flexibility it is therefore possible for the user to select the optimal QR reader from his application list When Serial input is clicked it was decided to open a dialog box for the input string as shown in Figure 6 11 This is because it clearly gives the user feedback on what is happening and it does not add unnecessary clutter to the GUI Browse shop The category selection as shown in Figure
41. S completely First of all a lot of unplanned work arose in connection with the implementation of STK500v1 in Java The result of this was that not all group members were able to move to the closeout phase at the same time as there still was unfinished work on the protocol 3 5 Risk analysis The risk analysis as shown in Table 3 4 states risks identified by the team The importance of a risk is calculated by multiplying likelihood and impact Higher numbers means higher importance for the project Table 3 4 Risk analysis eee a Likeli Tey Impor Preventive Remedial P hood P tance Action Action Good Increase communication FOr onI Illness 7 2 14 A and exchange and effective use tasks and of GitHub etree responsibilities Project 6 5 30 Don t take on Cut down the complexity too much work demands Agreement with Use the Customer 1 5 5 customer and original issues weekly feedback requirement from customer specification Avoid q ee Discover other i integrating License implementations eN ve 7 49 components i incompability DARA z or implment with incopatible from scratch licenses K Group A Contact h contact to avoid conflicts or f supervisor and 3 3 9 surprises disagree make an Leader takes q ments appointment action Have multiple Detail what alternative was attempted Over the air 8 8 64 solutions and as well as why complexity keep close it couldn t be
42. TING Chapter 7 Table 7 3 Connect with device using serial Test ID ST03 Test name Input serial connect Test descrip tion Connect with an Arduino device using serial Precondition Arduino device is switched on with Bluetooth enabled Test steps e Start program e Press Device list from Action overflow e Press Add device e Press Input serial O Enter MAC address Success con dition Android and Arduino device are connected via Bluetooth Table 7 4 Search for desired app Test ID ST04 Test name Search Test descrip tion Search for a specific app Precondition Database is populated Test steps e Start program e Press search icon e Type search string Success con dition Search result is shown with matching apps 61 7 2 SYSTEM TESTING Chapter 7 Table 7 5 Connect to last connected device on application startup Test ID ST05 Test name Last connected Test descrip tion Test that the Android application connects to the last connected Ar duino device when the application is started and gives proper feedback to the user The application should only reconnect when this option is selected Precondition Available Arduino device with Bluetooth Test steps e Check option Automatically try to reconnect to last connected device e Connect with an Arduino
43. Table requirements This table contains the requirements for the application requirementid integer auto increment primary key for the requirement name varchar 160 name of the requirement description varchar 200 description of the requirement compatible int 10 integer that is converted to boolean when retrieved from database Compatible is an integer of 1 or 0 This indicates if the application referred to is compatible with pagers or not 6 3 2 5 Table appusespins This table contains the information about which pins on the Arduino that the application is using appid int 10 foreign key to the application that uses this rule requirementid int 10 foreign key to the associated requirement 57 T Testing This chapter contains a description of the testing performed during the project Tests were performed in order to ensure product quality and that the product met the requirements The first sections describe how the tests should be performed followed by the execution and results of the tests 7 1 Testing strategy The ways in which testing was performed is detailed in this section Unit testing was performed initially followed by the integration testing Following the completion of the Android application usability testing was executed User acceptance testing was then performed by the customer after the significant parts were completed 8 7 1 1 Unit testing For testing of the Android application Robotium wa
44. a a 4 Requirements 4 1 Functional requirements 13 13 13 14 14 15 15 15 16 16 17 19 20 20 22 CONTENTS Chapter 0 4 2 Non functional requirements oa 23 4 3 Changes to Tequirements a ee 23 ABA Removals bucal Bete e Set Baie Pe ny hee a ES 23 A432 Additions dui RR eae Pk ee A e a 24 AA VWSO CASES eon bib A RS ele a ean Bode sche Li 24 5 Development environment 35 5 1 Development tools e 35 5 1 1 Integrated development environments IDEs 35 BAVA sBelipse 4 ues Sek ee oe hn a a ae Ss ne cS 35 5 1 1 2 ArduinoIDE o o 2 20208 36 5 1 2 Codebase management and versioning 36 5 1 2 1 Git version control software 36 22 HITO Ds txt dey he hs e ela 36 5 2 Project management tools oaoa a 36 SAL Google Dees ari gd ae at aE ee be a ee 36 5 2 2 Microsoft Word 2s ata a a A nd e on ere ee Beh a 37 IZ MAPEX A ae eye ee nas ie ah ld tate dais ENA a 37 5 2 4 Google Calendar 2 2 a ea eed 37 9 2 9 DropbOX es au vs toe heck ee RR OR EE ee wae a 37 5 2 6 TextMate and Sublime Text 2 0 e 37 5 2 7 Web sequence diagrams o 37 b 2 8 WunderlSt eds aia rr rs di a bis 37 529 Doodles oa e e A e eda 38 5210 Britzine ceca rra a oe BM eed eae 38 5 2 11 OmniGratile nedarai ea aada G ia AE AR e aga 38 5 3 Test management 0 0 ee ee 38 DIL Robotiuim seswa Bee dhe b
45. a preliminary overview of the architecture requirements use cases and risks Elaboration phase In the Elaboration phase the team is expected to filter out the majority of the system requirements and validate the system architecture A detailed overview of the product should be established in this phase and the project plan should be developed The documentation produced in this phase is essential for the work done in the Construction phase Construction phase The Construction phase is the largest phase in the model In this phase all the remaining features of the product are developed and integrated and thoroughly tested At the end of this phase the finished product should be ready to be presented to the customer Transition phase The Transition phase is where the system is deployed to the target users Feedback from the customer might result in further refinements and new versions of the product Elements in this phase are beta testing and training of the users Analysis amp Design Implementation Test Deployment Configuration amp Change Mgmt Project Management Environment Iterations Figure 2 1 Illustration of the Rational Unified Process The waves indicates where the focus and work is taking place in each phase 2 1 2 Scrum Scrum is an iterative and incremental development framework for development of complex information systems When using Scrum the development of the product is developed in small pieces
46. al model is a software development model intended for large and complicated projects It combines elements from the waterfall model and prototyping models and uses an iterative approach Based on this it allows for incremental releases of the product as prototypes 4 2 1 5 Lean software development Lean is an agile software development methodology that is defined by seven principles 5 Eliminate waste Everything that does not add any value to the customer is considered a waste Amplify learning The development environment should the designed so it amplifies the learning process of the developers Defects should be prevented by running tests as soon as the code is written Decide as late as possible By delaying decisions as much as possible better results can be achieved There is always uncertainty associated with software development and delaying options as much as possible results in more flexibility later Deliver as fast as possible The sooner the product is delivered the sooner feedback can be received Empower the team The managers are taught how to listen to the developers so they can explain better what actions could be taken and give suggestions for improve ments 2 2 EXISTING SOLUTIONS Chapter 2 Build integrity The customer needs to have influence and inspection of the project and an overall experience of the system to be developed See the whole Decompose the system into smaller parts and find and el
47. ations where one can download applications This was useful for the development of the product since it was possible to use the same principles in the assignment Google Play is not open source and could therefore only be used as a source of inspiration for the project It was not possible to reuse the code or other parts of the application in the development 2 2 2 Pebble Pebble is a watch shown in Figure 2 3 that offers over the air transfer of applications The main differences between this watch and a standard Arduino is that Pebble have written a custom operating system and contains different hardware than an Arduino Pebble is also using a microcontroller that is significantly faster and contains a lot more memory which means that it is much easier to develop an operating system for it To transfer a new application to the watch the user connects the mobile phone to the watch using Bluetooth The user can then open the Pebble application store and upload applications made for this watch 10 2 3 OVER THE AIR TRANSFER Chapter 2 Figure 2 3 Pebble Watches with different applications changing the watch faces The principles are quite similar to what we planned to develop but this platform is not made to expand to other platforms There was very little documentation on the Pebble website so the potential for reuse in this project appears minimal 2 3 Over the air transfer Usually when you program the Arduino you use a
48. by listening to the Bluetooth API on the Android This happens in the MyBroadcastReceiver which works like a listener When this listener gets notified with a device as input the discovered device will be put in a list in Devices If the user choose to connect to a device from the list of discovered devices a service BtArduinoService will be created This service will create the BluetoothConnection that manages the connection between the Android device and a Bluetooth device The service uses STK500v1 for transferring data over the BluetoothConnection to the connected device To add support for other microcontrollers than Arduino only few changes to Devices would have to be made Another service and a protocol communicating with a desired device must be implemented If the added protocol s should coexist with STK500v1 support for multiple simultaneous services must also be implemented as well Since this project only considered connections between Android and Arduino only the STK500v1 protocol and one service was implemented The overall design solution for multiple connections is described in Figure 6 2 40 6 1 SYSTEM ARCHITECTURE Chapter 6 STK500 protocol Service A Arduino Service Raspberry Pi INSTALLATION MODULE Service 2 Service Figure 6 2 The installation module is a class that manages all the services that the application may support Each service has a protocol for installing soft
49. cal part of the project was concluded and it was therefore decided to let this activity run through the larger part of the project In the closeout phase work on the final report was to be prioritized 3 4 1 Work breakdown structure WBS The WBS is a view on what work packages the project encompasses It helps with com municating the work and processes to easily execute the project The duration time show how much estimated time one task requires and gives an assessment on how much effort is needed to complete the task 3 4 1 1 Gantt chart The Gantt chart in Figure 3 1 is showing the initial work breakdown structure created in the project 2013 Activity Task Name jan 28 2013 feb 4 2013 feb 11 2013 feb 18 Days StartDate Finish Date feb 25 2013 mar 4 2013 mar 11 2013 mar 18 2013 mar 25 2013 apr 1 2013 apr 8 2013 apr 15 2013 apr 22 2013 apr 29 2013 mal 6 2013 mai13 2013 mai 20 2013 mal 27 2013 Project Management Planning Execution Testing Closeout 53 jan28 13 apr10 13 13 jan28 13 1eb 13 13 33 feb 14 13 apr 13 A 32 mar1 13 apr 15 13 29 apr16 13 mai26 13 Figure 3 1 Gantt chart Milestones are marked using vertical lines 16 3 4 PROJECT PLANNING Chapter 3 3 4 1 2 Work breakdown structure table WBS table Table 3 2 is showing a detailed overview of all the tasks to be preformed in each of the milestones The WBS code of each task is used
50. caller and the Arduino is a programmable microcontroller 46 6 2 DESIGN OF THE ANDROID APPLICATION Chapter 6 6 2 Design of the Android application One of the purposes of the Android application was to ease the process of installing PUIs on an Arduino for non technical users As described in section 4 2 one of the requirements for the project was that people of all ages were supposed to understand how to use the application This requirement put pressure on the design as one has to make sure everyone were able to understand the different functions of the application 6 2 1 Design guide Before the programming of the Android application was started a complete design guide was created In this section the complete design of the application is presented This guide was made primarily for two reasons e Presentation for the customer With a complete design guide it was possible to present the user interface of the application to the customer before it was pro grammed This allowed for input from the customer at an early stage when it was easier to change the design e Avoid confusion A design guide reduces the amount of confusion and discussion re garding the appearance of the user interface Because the design of the user interface was settled on before the programming had started there was less need to discuss this along the way During the project some changes were made to the design These changes can be viewed in Section 6
51. contact with solved in the customer final report Continued on next page 20 3 5 RISK ANALYSIS Chapter 3 Continued from previous page We ae Likeli Teese Impor Preventive Remedial P hood P tance Action Action Keep in touch d st Not much ieee f updated In case Personal preventative z 8 5 40 you still can do matters action can be a Eia tasks claim one and tell the others 21 4 Requirements This chapter describes the functional and non functional requirements of the system to gether with use cases At the end of the chapter Chapter 4 3 during the project will be described The requirements of the project will be kept high level and vague to facilitate making choices as late as possible 4 1 Functional requirements FRO1 Over the air installation The Android application and the Arduino device should communicate over Bluetooth and install an arbitrary application from the Arduino Store in a simple two step process FRO2 Easy to use interface The Android application should be easy to use and easy to understand It should not be necessary to do anything on the Arduino except for starting it On startup it should search for nearby Bluetooth connections with paired devices FRO3 Example PUIs To demonstrate the Arduino Store on Android over the air installation and the application in action on an Arduino the group should create at least two example PUIs FRO04 Reliable
52. d need to be hard coded into the Android application With more time available the group would have implemented a remote database that would contain all the apps that would be offered through uC Software Store Content providers and sync adapters provided by Ubibazaar could be used to achieve this 8 1 1 1 Uploading interface Although outside the scope of the assignment given for the project future work should encompass implementing an interface for easy uploading of apps to the uC Software Store A possible solution for this could be something like the system used by Google Play Here registered users easily can submit and upload their own application through a web interface provided by Google Play Allowing users to upload their own apps would enrich the product greatly opening for a much wider user group It is envisioned that the use of a separate web site for uploading of apps would be best for this solution On this web site the users should be able to view the existing apps in the database as well as submitting their own much like http play google com Security Allowing individual developers to upload their own apps to the database would require an administrator or moderator to review the submitted apps This is important to 67 8 2 STK500 AND OVER THE AIR INSTALLATION Chapter 8 avoid uploading of malicious apps and duplicates in the system 8 1 2 Standard for defining wC Software Store compatible microcontroller based
53. demarks that are owned by the Bluetooth SIG and licensed out for use to companies that are incorporating Bluetooth wireless technology into their products 1 6 DEFINITIONS Chapter 1 Doodle Doodle is a trademark of Doodle AG Dropbox M Dropbox is a trademark of Dropbox Eclipse TM Eclipse is a trademark of the Eclipse Foundation Fritzing T M Fritzing is a trademark of the Friends of Fritzing e V Google Google Google Calendar Google Docs and Google Play are trademarks of Google Inc Microsoft Microsoft and Microsoft Word are trademarks of Microsoft Corp OmniGraffle OmniGraffle is a trademark of Apple Inc Raspberry Pi Raspberry Pi is a trademark of the Raspberry Pi Foundation TexMate TextMate is a trademark of Allan Odgaard SQLite SQLite is a trademark of Hwaci QR Code QR Code is a registered trademark of Denso Wave 2 Prestudy A thorough study of the problem area existing solutions development methods etc is important to gain the knowledge needed to make good decisions concerning the project In this chapter the research performed in the first phase of the project will be presented 2 1 Development methods Several development methods were examined in the beginning of the project to ensure that a suitable model was chosen In the following section the research performed on different development methods will be presented Regarding the choice of development method
54. der are automatically kept in sync across different devices It is also possible to share folders with other users and with the world at large The basic service is free but comes with limited storage space Dropbox was used for sharing various files within the group such as compiled versions of the report data sheets for Arduino components and so on 5 2 6 TextMate and Sublime Text 2 These tools are sophisticated text editors that can be used for coding markup and regular text editing In the project they were used for editing of the report and coding for Arduino While TextMate is for OS X only Sublime Text is cross platform 5 2 7 Web sequence diagrams Web sequence diagrams is an online tool for generating sequence diagrams based on text markup It provides both a paid solution and a free offering with a limited feature set 22 5 2 8 Wunderlist Wunderlist is a free to do list tool supporting shared lists It supports sharing tasks between the participants of a to do list with reminders and notes Wunderlist was used to serve reminders for other non coding related tasks like scheduling meetings or booking rooms 37 5 3 TEST MANAGEMENT Chapter 5 5 2 9 Doodle Doodle is a free online tool for scheduling events It allows a user to create an event and aims to simplify scheduling of events by polling the participants when they are available When the participants of the event have answered one can easily view when all
55. device on application startup 62 BrOwSserapps test omi Se oy Ghee ep ae ae hades a a Bae 62 Install application on Arduino device o e e o 63 Change connected device ooo a a a e 63 System test results e e a eaii 64 Functional requirements a 65 Iterations and time spent 2 2 2 o 73 Example of component information XML document 88 Example of pin setup XML document o 88 Serial number to connected microcontroller 89 The XML document for current connected device 89 he XML document for an example uC application The Warn or require field specify whether or not the component has to be present or if the application CAM Tin without ae a a de A se ee 89 Comparison between two XML Objects o a 90 76 List of Figures 1 1 2 1 2 2 2 3 2 4 3 1 3 2 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 6 1 6 2 6 3 6 4 6 5 6 6 6 7 6 8 6 9 6 10 6 11 6 12 6 13 6 14 6 15 6 16 6 17 6 18 6 19 Customer 1 1 a SINTER 1 1 b NTNU wt va 2 Rational Unified process Model oaoa aa a 7 Google Play fn sac a ee RS e Sw 10 P bbleswatehl o A Ah ly ce Et Nee MB tN 11 Wiring Diagram for BT module o e 12 A A O E ity Nee tet 16 WBS tree showing a more detailed overview of the different tasks in each of the five milestones 0 0 e 19 Usec T a A a nee eB le SE
56. dy to send commands to the Bluetooth module mw eoo dev tty usbmodem1421 No line ending M Autoscroll Newline D 115200 baud 3 Carriage return Both NL amp CR Figure E 1 Change settings in the serial monitor in the Arduino IDE to configure the Bluetooth module 99 E 1 UPLOAD THE FIRST APPLICATION Chapter E 1 w arduino ce v w arduino cc TD ER ANALOG IN e o FN ER ANALOG IN Cid Vn 012345 B5 Cid Vin 012345 Made with J Fritzing org Made with J Fritzing org a b Figure E 2 Standard wiring of Bluetooth module E 2 a To configure the Bluetooth module through the Arduino wire the module like this E 2 b E 1 3 Supported Bluetooth modules You can use any Bluetooth module you want but these are the modules that have been tested Remember to power off the modules after they are reprogrammed to activate the new configuration When the Bluetooth module is programmed turn the power off and on again to restart the module E 1 3 1 RN 42 To enter programming mode type and press enter You should get AOK back when you entered programming mode To change baud to 115200 write SU 11 and press enter You should now get AOK back Other supported commands can be found in the datasheet 26 E 1 3 2 HC 05 Make sure you connect the KEY pin to 3 3v 5v depending on which model of this module you have before powering it up This will allow you to enter the programming
57. e customer were met As described in the Table 7 11 some of the requirements were omitted during the project as some tasks proved more time consuming than expected As a result of this not all the initial requirements have been met Regarding the non functional requirements it is difficult to summarize to what de gree some of these requirements have been met As a result of this not all the non functional requirements are included in the table below Table 7 11 Functional requirements ped acer Result Comment code The Android application is communicating with the Arduino device and it is possible to install all the apps FRO1 Passed f me we featured in the Android application on the Arduino over the air Usability testing was performed at SINTEF FRO2 Passed ne pus workshop and in the hallway at NTNU FROS Passed Five example PUIs were made to prove the function ality of the product A valid Bluetooth connection stays active even if the Android application is minimized When the applica ERM Posed tion is killed and restarted it will connect to the last connected Arduino device if in range FRO5 Invalid In agreement with the customer this requirement was omitted The user of the Android application can connect with an Arduino using QR Code reader manually input a Hoe Ea MAC address or choose from a list of available Blue tooth devices NFRO2 Passed The Android application is stable and the Blue
58. e eee eR ER ee ed 38 6 Design and implementation 39 6 1 System architecture 2 e 39 6 1 1 Browse shops erase se 56 ba Bo a OU ees 43 6 12 STKOO0WE a te Be A Bee RAG GL A ae 44 6 2 Design of the Android application 0 0200 47 6 2 1 Desien pide vaina a a a a A 47 6 2 2 Design decisions e 54 6 2 3 Changes to the design 0 0 000000 ee eee 55 6 3 Database implementation 0 0 0 000000 eee ee 55 6 3 1 Database model 0 0 20000000 a 56 6 3 2 Database details ooe srra gy bee ra ewe eee eet 56 63 241 Fable app s sae ds ae Oy ee ee 56 6 3 2 2 Table binaryfiles o 57 6 3 2 3 Table developer o o 57 6 3 2 4 Table requirements 2 2 200 57 6 3 2 5 Table appusespins 2 0000 57 7 Testing 58 Gall Vestine Strategy i sta Rs OO ek OE ee eS 58 Gell A Unit testinta co Sree ee ee oe Gr a Ee ee 58 1 62 Integration testing gt fn a isi a ee a be re at et ees 58 CONTENTS Chapter 0 7 1 3 Usability testing 6 ops aoe ke eee eh Se Se Be tes CARB Te Tasks aa Ade Joho AS AD ES 7 1 4 User acceptance testing 00 0000 00 2 eee 1 27 Syst m testing sidre sok eb ba Pk e ee Peds West results n fcc recy Stare 2 eo eg Phe ek A ek RO Ue AE a Goode nite testings aa Bo E Bot a BR 7 3 2 Integration testing 2 0 0 0 0 ee ee 13 37 oystem testing oi esca be ei
59. e in use within the group It was also preferable for the tool to be free since this is a project that does not generate income 5 1 Development tools These are tools used in the development of the project They have contributed to the technical aspects of development 5 1 1 Integrated development environments IDEs An IDE is used by programmers to develop and program applications An IDE typically include a source code editor build automation tools and a debugger These are the IDEs that were used during the project 5 1 1 1 Eclipse Eclipse is a free IDE implemented in Java It has extensive plugin support and anyone can publish a plugin to support another programming language versioning software or new program features altogether Eclipse provides useful time saving functionality to developers such as an extensive live debugging suite in addition to checking code syntax and providing auto completion of method calls Eclipse was chosen for Android development due to previous experience with the software and good plugin support for targeting different versions of the Android API Using a plugin for Arduino support was also considered but the functionality of the available plugin was found lacking and therefore not used Mylyn is a plugin meant to integrate with other plugins that provide access to task issue and bug tracking repositories Issues can be referenced or created quickly from the Eclipse IDE while coding and the plugi
60. erent ways See next paragraph Figure 6 12 Design for category selection in the shop Screen 2b Browse shop by category as shown in Figure 6 13 is a screen that shows a list of all applications in the chosen category Category All is chosen Figure 6 13 Design for the list of application that belongs to the selected category 50 6 2 DESIGN OF THE ANDROID APPLICATION Chapter 6 Screen 3a Application view as shown in Figure 6 14 provides an overview of a chosen application Small changes were needed as the comments field and reviews were given a lower priority at mid term Figure 6 14 The design for application view This is the screen you see when you look at the details about an application Screen 3a i Installation confirmation as shown in Figure 6 15 is a screen that appears when the Install button in Screen 3a is pressed Shows the name of the chosen device ol 6 2 DESIGN OF THE ANDROID APPLICATION Chapter 6 Figure 6 15 When the user click install this box will show up to warn and confirm the users choice Screen 3a ii Progress of installation as shown in Figure 6 16 is a screen that shows the progress of the installation The progress bar cannot be dismissed so the Android application is locked until the installation is complete or has failed The user is warned not to move the Android device out of range of the Arduino 52 6 2 DESIGN OF THE ANDROID APPLICATI
61. esting and integration testing had been done to ensure that the product met the requirements set by the customer Table 7 9 System test results Test ID Result Comment If the Arduino device is on and within range the An STO1 Passed droid application successfully connects to it via Blue tooth using the Device List If the Arduino device is on and within range and the QR Code is correct the Android application success fully connects with it via Bluetooth using optional QR reader ST02 Passed If the Arduino device is on and within range the An droid application ST03 Passed successfully connects with it via Bluetooth by provid ing the correct MAC address of the device to the An droid application It is possible to perform searches for apps in the ST04 Passed Android application Apps that fit the search criteria is presented to the user The application automatically tries to reconnect to the last connected device when this option is selected It iP pase gives proper feedback to the user containing the result of the connection attempt STG Passed It is possible to browse apps in the Android application in a random fashion without problems It is possible to install an app on an Arduino device PEN Fasten through Bluetooth STOS Passed It is possible to change the connected device without disconnecting first 7 3 4 Usability testing The results of the usability testing were po
62. etCurrentState IReaderState void printToConsole String void O logcat String String void SO RESULT_READY EReaderState Sof TIMEOUT_OCCURRED EReaderState Sof STOPPING EReaderState Sof STOPPED EReaderState Sof FAIL EReaderState Figure 6 7 The most important classes used for programming In Figure 6 8 a simplified view of the programming process is shown Here the Ar duinoStore is a representation of any application requesting an app to be uploaded to the Arduino The Arduino represents a microcontroller to be programmed Note that the Reader has already been instantiated before the starting call and that stopping doesn t destroy the object Most of the simplification occurs within the programming loop as several different types of commands are sent to the device depending on the responses received for details on this communication see the AVRO61 documentation 16 Communication details with the Hex class and Reader related classes have also been reduced slightly in the diagram 45 6 1 SYSTEM ARCHITECTURE Chapter 6 Programming sequence simplified Programming request Parse program Checksum result _ ems reader Decide next move A Program next batch of bytes recover communications etc ArduinoStore STK500v1 www websequencediagrams com Figure 6 8 Sequence diagram of the programming process The three classes in the middle are in the protocol library ArduinoStore represents an outside
63. f patterns etc 8 2 STK500 and over the air installation This section focuses on the areas of improvement regarding the implementation of the STK500 protocol and over the air installation of apps on Arduino Although the functional requirements set by the customer were met and it is possible to install apps on an Arduino using the uC Software Store there are still some areas of improvement 8 2 1 Hard reset There was not enough time to fully implement neither the hardware nor the software implementations of hard reset The former due to soldering difficulties and lacking docu mentation and the latter had to wait for the former though sections in the code where the feature should be enabled was identified 8 2 1 1 How to hard reset Both Bluetooth devices experimented on RN 42 6 and HC 05 7 provide pins that can be used for detecting when it makes a connection Passing the output to the reset pin of the microcontroller coupled with a transistor to make it able to coexist with the soft reset will 68 8 2 STK500 AND OVER THE AIR INSTALLATION Chapter 8 then cause it to reset as shown in Figure 8 1 The group has confirmed that this will work Triggering a hard reset is then as simple as disconnecting from the Bluetooth device and then reconnecting again Timing is important however as the protocol code must com municate with the boot loader before the latter attempts to start the installed app e E i oe e
64. form based on a simple micro controller board AVRDude This is a tool to upload programs to micro controllers from the Unix command line This software has a lot of features such as reading and writing to the micro controller s memory over a serial connection This software can also compile your C code into an Intel Hex file a file full of binary information that can be sent to the Arduino with the STK500v1 protocol Normally this is done with a cable between a computer and the microcontroller Baud rate Baud rate refers to the number of signal or symbol changes that occur per second A symbol is one of several voltage frequency or phase changes 1 Bootloader A bootloader is a computer program that loads the main operating system or runtime environment for the computer after completion of the self tests Commit In relation to version control software a commit is the act of recording changes to repository Content provider Standard way for Android applications to share information between applications and services Customer Refers to SINTEF with Babak Farshchian as their representative Lesser GPL GNU public licence is a licence geared towards supporting open source software The lesser additions Lesser GPL also allows for inclusion in proprietary software 1 6 DEFINITIONS Chapter 1 JUnit A unit testing framework specifically written for Java Intent In Android development an intent is an abstract descr
65. gn and system architecture of the product will be presented The reader will learn how the different components of the product are put together and how the design of the application was planned 6 1 System architecture The design was divided into several modules e Bluetooth connection between the Android and the Arduino e Synchronization with the local SQLite database e Android application view General user interface e A service that contains the protocol for installing over the air The system design was implemented such that further development should be as modular and easy as possible Therefore it was designed as a plugin like system where you easily can implement your own protocols against a desired device e g Raspberry Pi Currently the application only supports the STK500v1 protocol and therefore only connections with Arduino devices With some work compatibility with other STK500 based devices can implemented be The design for the connection to other devices was done as shown in Figure 6 1 39 6 1 SYSTEM ARCHITECTURE Chapter 6 d Devices O initializeDeviceList O isMyServiceRunning isConnected connectionHasF Sof ERROR_PARSE_HEX ProtocolState Sof ERROR_ CONNECT ProtocolState Figure 6 1 The Bluetooth connection is stored and managed in a service that provides the STK500 protocol Devices as shown in Figure 6 1 is an activity that manages the discovered Bluetooth devices A device is discovered
66. h were implemented or not had to be done by trial and error or investigating the source The latter is designed to be very compact to fit in the 512kB threshold which if exceeded would make the bootloader occupy 1024kB Communicating with the Arduino proved fairly straightforward but dealing with false positives was an issue The Arduino would report that writing took place successfully but writing would for example occur only in partial sections of the memory areas requested The only way erroneous writing could be discovered was to afterwards use an external program to read the written memory to verify its content These issues prolonged the development of the system by a considerable amount and had a major impact on the project Some of these issues could have been avoided by more careful initial investigation while others would not have been apparent prior to implementing the protocol 9 1 3 Hard reset Due the development of the protocol there were major problems programming the device without errors and it was needed a way to reset the Arduino to recover the programming A lot of research were done to find out how the Arduino could be reset without using the excisting soft reset using the ComputerSerial library The hard reset feature was intended to provide the final fall back this would be the only way to automatically recover from serious communication problems during programming 72 9 2 INTERACTION WITH THE CUSTOMER Cha
67. hd A Seow Pete 3A Usability testing i co gid es ee Re Se Ee 7 3 5 Expert reviews eee 7 3 6 User acceptance testing 0 000000 eee ee Tacte SOUND de 8 Roadmap for further development 8 1 The uC Software Store application a e BALL Database aii is a A eee hte eg 8 1 1 1 Uploading interface a 8 1 2 Standard for defining uC Software Store compatible microcontroller basedsdeyiGes ce itt AAA hon het Says A 8 1 3 Rerformantes 42 259 44 oe a Ee A Oe hd B SAL GUR ek enn BADR Be Re e EE ee a BO ee ee ee 8 2 STK500 and over the air installation 2 0 ees 8 21 A E A a a E O Bdimene 8 2 1 1 How to hard reset 0 0 00 2 epee ee 82 2 Security os wee rs a a a BM ees A 2 2 ah Ap hehe BO ee A Ge a Oy A BO eS 9 Evaluation Oil Challeriges 2 0 eed dae ate Gok bod amp pee amp a Ate Eada tet adan IN es oe god Sse Sa ashe A AO wate ls aeons aaga O12 Protocol bowel ok oe Me We A e y ian 9 103 Hard reset gt use wh san ee a te oe da OM eet 9 2 Interaction with the customer 0 ee 93 Group interaction 02 44 ae a n a ardi eee a ee a gA Lessons learned cai Gp ee ke a Ge cd OAT Pr study aia ke BAe EG ote ek ke ee eee ae 9 4 2 Project management 0 0000 eee ee ee 9 4 3 Design and Implementation 2200 4 E A TOS tne tds oe A 9 52 Conclusione 0 Jia A hen bo ar we ee ES ee List of Tables List of Figures Bibliography Append
68. hosen the content in All and TopHits are filtered by only showing applications that belongs to the selected category SearchResults is a class that contains a list of search results uC applications from a search This class is an activity that has a list like the other fragments and therefore uses the same list adapter as All and TopHits When a specific uC app is chosen a new activity is started App View This class contains the information about the chosen app and presents it to the user From this screen the user can choose to install the app on the connected Arduino 6 1 2 STK500v1 In Figure 6 7 the general design of the protocol component is shown The STK500v1 class handles most of the logic and actual programming this is the class called upon by the application when an app is to be uploaded The Constants class holds important commands and responses used when communicating with the Arduino The Her class 44 6 1 SYSTEM ARCHITECTURE Chapter 6 deals with interpreting and verifying the app to be programmed It provides the raw bytes requested by the protocol class The rest are for abstracting and dealing with reading from the Bluetooth connection the current implementation allows for avoiding blocking by only reading buffered bytes The Reader behaves differently while reading or during timeouts based on a state pattern implementation As shown the different states are both states and readers lt
69. id application ee 101 RECOVED Lota stat o id A di la data a 101 Develop your own Apps 101 1 Introduction This document is the report required by the course IT2901 at the Norwegian University of Science and Technology NTNU written during spring 2013 The goal of this report is to give the reader an overview of the project The task was to develop a market application on Android for Arduino programs and installing those applications over Bluetooth For users looking for help to use the resulting software see the installation guide Appendix E or the user manual Appendix D 1 1 The course IT2901 Informatikk Prosjektarbeid II is the course in which this project was carried out It is commonly taken the last semester of a bachelor in informatics This report is written for the customer supervisor and teachers of this course 1 2 The group The group consisted of six students from Computer Science at NTNU each possessing different technical skills All were third year students in the Informatics Bachelor pro gram Bj rn Arve Fossum Experience with Java MySQL PHP and C Jeppe Eriksen Experience with Java MySQL and basic Android development Nina Margrethe Smgrsgard Experience with Java MySQL ATFX and basic Android development Robin Tordly Experience with Java Android MySQL PHP and SQLite Stale Semb Hauknes Experience with Java MySQL PHP and Arduino Wilhelm Walberg Schive Experience
70. id application they were to be tested in pairs and not all at once Integration testing identifies problems that occur when different units of the product are combined These test were to be performed when units of the product were put to gether 18 Just as in unit testing Robotium was to be used for integration testing as well 7 1 3 Usability testing As the intent of the product was to ease the use and setup of physical user interfaces usability tests were crucial in the testing aspects The decision was made to perform a hallway test where random test subjects followed the tasks detailed in Section 7 1 3 1 To ensure that the test subjects had a proper understanding of the product the think aloud protocol was to be used meaning the subject was supposed to be talking about their actions during the test All test subjects filled out a System Usability Scale SUS form in order to create a score 0 100 which gave us a comparable score with other systems Concerning the amount of subjects tested five users has been recognized as the proper amount According to Nielsen 85 of the problems with a system will be found by these five users thus testing more would increase the time spent watching the same problems resurface 12 7 1 3 1 Tasks These were the tasks given to each tester The tasks were created with the use cases mentioned in Chapter 4 4 as a basis Each task was meant to have a vague description This way test subjects would
71. iminate defects 2 2 Existing solutions This is a summary of existing solutions similar to the project assignment This section is divided in two subsections one for the market application and one for the over the air transfer The existing products were evaluated on the following criteria e To what degree the product fits the assignment e Can the product or parts of it be reused for the assignment Can it lead to licensing issues 2 2 1 Market applications UbiBazaar is a prior project which created an universal app store in PHP This project had potential for serving as a back end but this was later discarded The idea of a website for uploading applications was the primary idea for the project Upon revising the project it was deemed too unstable and incomplete to properly function for our intended use The project used an outdated version of PHP which caused numerous bugs which would take up too much time to attempt to fix properly It did have a way for developers to follow each other which would help creating a commu nity for the developers For further development of wCSS UbiBazaar would also be able to support the development of applications aimed at for example Raspberry Pi This was not included as the goal of our project and therefore discarded Google Play is the market application for Android provided by Google It is an appli cation that allows for easy browsing and installation of applications on Android devices
72. iption of an operation to be performed Over the air Refers to wireless transfer of data over Bluetooth PUI An acronym for Physical User Interface A PUI is a user interface which interacts with digital information through the physical environment Repository A structured and indexed storage location for code STK500 This is a standard protocol used by many microcontrollers to upload and download memory including the Arduino Sync adapter A link between the content provider and server updating either of the two to be in sync with the other Version control software VCS Software for maintaining and keeping track of different versions of content Wrapper A coding pattern which handles reading availability and blocking 1 6 1 Registered trademarks Android TM Android is a trademark of Google Inc The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3 0 Attribution License Apache Apache is a trademark and service mark by ASF Projects for community developed open source software products Arduino Arduino is a trademark of Arduino team Atmel Atmel AVR 061 and AVR 062 are registered trademarks or trademarks of Atmel Corporation or its subsidiaries in the US and or other countries Bluetooth The Bluetooth word mark figure mark combination mark and Bluetooth Smart and Bluetooth Smart Ready marks are all tra
73. ith customer B 3 Iteration 3 Week 10 and 11 B 3 1 Summary Focus on Bluetooth connection and over the air implementation was prioritized these weeks The application was taking form and the bugs were beginning to show up Use cases 2 3 4 and 5 were in focus during this iteration There were some issues with over the air because of incompatible licenses and much work was put into research The Android application was estimated to be 50 complete B 3 2 Overview e Researched Ubicollab libraries Finished design of the GUI Established a Bluetooth connection between Android and Arduino Implemented last draft of the content provider Meeting with customer B 4 Iteration 4 Week 12 and 13 B 4 1 Summary This iteration became critical when 1t was discovered that existing implementations of the STK500 protocol were either incompatible with the required Apache v 2 license or not compatible with Android An emergency meeting with the customer took place and it was decided to implement the STK500 protocol in Java Developing the Sync Adapter was removed from the requirements and the focus was moved to implementing the protocol as a library Use cases 2 3 and 4 were in focus during this iteration B 4 2 Overview e Emergency meeting with customer Not possible to use existing solutions of STK500 protocol Agreement on implementing the STK500 in Java ourselves as a library e Researched STK500 e Unit test sketches e Continued work
74. ixes A Project documents A 1 Status report example e 67 67 67 67 68 68 68 68 68 68 69 70 71 71 71 71 72 73 73 74 74 74 79 79 79 76 76 78 81 81 CONTENTS Chapter 0 A 2 Activity plan example 2 2 2 0 0 0000 eee ee ee 82 B Iterations 83 Bl eration al ot Be ot Sth a a taa tri BAR Paes te Se 83 Ble Summary so ear al ae Gas ee Rane on ae ce ape Wi ho 83 Bul Overview os ce a ae ee dee ae we ae ee vy hse ee fh we ch de 83 Bi2 eration Gi ef Bae Ree A Sn etek eet BO Ae BE es 83 B 2 1 Summary jek oie ee a ee bE eee 83 B212 OVERVIEW sikh atin a ie A ie Bok Ge AOE A GRAD e ROS 84 B3 iteration 3 i Ss LA Peis Bet ek er A GB AOR ae a en Se 84 B 3 1 Summary avis ad Boe bw ae Pbk ee Re ee ee ee eee 84 BZ OVERVIEW tt 4 Shy Bd aod ek cb Bk ee Rk das Bed oe 84 BA Iteration da ED th he ht ath ee ee ae td et Tee E a 84 BAT Summary te ab Oo ee a ae ee NS ee 84 BAD Overview Lia ds Ge dy Ta eh OO Ee EO ee Bs 84 B 57 Iteration Dit Ae cern o e tS he OD we A BS ee A Bhs te 85 Biol SUA a ets an eth PA ae dg Pen ee tet a 85 B 6 2 Overview na Bo ee nt a hide ee oe 85 B0 iteration O nsan Sa is e AA ue Reb a BA eg os heen erie sat G 85 BGI SUMMARY 6 he o eR ee a Pe eee nw ane as 85 BO OVERVIEW ta e Sobre we AEE Soe she ee ee 85 Bar SIGORALION ai ersen A OR shat te Me teak Be Hevea Siz Se PS Th Seeds dee ce 85 BLA Summary pad Saeco hse ge ob het rd a li tr 85
75. l were unsuccessful 9 1 2 Protocol There were several difficulties related to programming the Arduino There were few existing solutions for programming it in general and none for Android or Java The official implementation was available in C but in the incompatible GPL license The existence of certain programs written in Java with the purpose of programming Arduinos led the group into assuming one of these could be utilized as the license was compatible When the time came to make use of it it was discovered to internally use AVRDUDE as well an embedded version of the latter was available for several platforms This realization came somewhat late in the process see Iteration 4 in Chapter B 4 Following this and the emergency meeting with the customer it was decided to implement the protocol for programming Arduinos Unfortunately the documentation for these was a bit confusing the most detailed and professional protocol document turned out to describe version 2 of the protocol 13 Version 2 was incompatible with the bootloader installed on the Arduino by default Optiboot v4 4 on Arduino Uno This was also 71 9 1 CHALLENGES Chapter 9 the version that was partially implemented before the protocol differences and lack of backwards compatibility was discovered The incompatibility could have been discovered earlier but testing of the protocol had to be postponed This was due to a lack of available working serial commu
76. le usually is plugged into This is because these pins are used for programming the device and if a component is wired to this pin the device will not get programmed over USB E 1 2 Configure Bluetooth module To program the Arduino over Bluetooth the Arduino requires a baud rate of 115200 Standard configuration of Bluetooth modules is usually configured to use a lower baud rate therefore it has to reprogrammed to use the correct baud rate 1 Upload an application that does not use the serial communication The Arduino IDE comes with a lot of example applications and you can use one of them like Blink This can be found in the menu File gt Examples gt Basic Blink Click the Upload button to upload 2 Switch the wires from the Bluetooth module TX on the Arduino to TX on the Bluetooth module same with RX as shown in Figure E 2 b This is done because the Bluetooth module has to communicate with the computer through the USB cable Remember to switch the wires back when you are finished configuring as shown in Figure E 2 a 98 E 1 UPLOAD THE FIRST APPLICATION Chapter E Choose the right USB serial port from the menu Open the serial monitor 5 Change from Newline to Both NL amp CR and change baud rate to the baud of the Bluetooth module as shown in Figure E 1 If you are not sure what baud rate you should use you can try different baud rates until you find the right one 6 You are now rea
77. loperApps appUsesPins appid fileURL 1 n 0 n eq name name website description campatible Figure 6 19 The ER Diagram describing the setup of the database 6 3 2 Database details This section describes the structure and details of the database tables 6 3 2 1 Table app This table contains information about the application appid integer auto increment primary key for applications name varchar 160 name of the application rating int 10 rating of the application developerid int 10 foreign key to the developer of this application category varchar 200 which category this application belongs to description varchar 200 description of the application 56 6 3 DATABASE IMPLEMENTATION Chapter 6 requirementid int 10 foreign key to the requirements of this application 6 3 2 2 Table binaryfiles This table contains information about the hex file compiled Arduino code binaryfileid integer auto increment primary key for binary files appid int 10 foreign key to the application that owns this binary file file BLOB 1000000 The binary file in a BLOB A BLOB is not a datatype and stores data exactly as it was input This database stores it as a binary array 6 3 2 3 Table developer This table contains information about the developer developerid integer auto increment primary key for developers name varchar 160 name of the developer website varchar 200 website of the developer 6 3 2 4
78. ls The implementation targeted specifically the Optiboot boot loader used by many Arduinos A subset of the STK500 protocol is used for communicating with it A factory pattern could be utilized to request a protocol capable of communicating with other boot loaders or full programmers a separate chip doing the programming requiring a full implementation of either v1 or v2 of STK500 70 9 Evaluation This chapter covers the evaluation of the final product the process model and what the team learned in this course 9 1 Challenges During the project several challenges were encountered This section focuses on the two biggest of these challenges licensing and the STK500 protocol 9 1 1 Licensing None of the group members had any experience with licensing prior to this project The customer advised the group to use as much open source material as possible All relevant open source systems deemed useful were incompatible with the Apache 2 0 licence as they were licensed with GPL Therefore it was necessary to implement the required functionality as part of the project Initially the protocol was not a part of the assignment but proved to be the most time consuming task of the project As there were insecurities regarding whether implementations of the STK500 protocol could be licensed outside of GPL it had to be implemented as a library Repeated attempts to get the matter clarified by Atmel the copyright holder of the STK500 protoco
79. manding than first anticipated Initial research done by the group on this area showed that a Java implementation of AVRDude already existed Further research on the implementation however showed that it could not be used as it required programs not available on Android to be installed on the device After an extraordinary meeting with the customer it was decided to change the focus of the assignment The goal of the project remained consistent with previous statements A prototype of the Android store application was completed though not all functionality was imple mented and tested Further work on the Android application was temporarily put on halt At this point the resources were primarily focused on implementing the STK500 protocol in Java to allow for programming of Arduino from an Android device For challenges and issues regarding the implementation of the protocol see Chapter 9 1 2 See below for concrete additions and removals of the requirements 4 3 1 Removals CSS server component In agreement with the customer it was decided to remove the server side component of the assignment from the requirements This was decided to pool resources to other more critical tasks Sync adapter As the server component of the assignment was removed from the re quirements there was no need for the sync adapter Filtering of incompatible apps Due to lack of time it was in agreement with the customer decided to omit functional requirement FR04
80. n can be configured to show relevant code sections when selecting an issue to work on The group used a GitHub connector for Mylyn to get Mylyn to display and work with GitHub issues The Android software development kit SDK provides access to several versions of the Android API through the use of an installation manager This allows for simple updating when new versions of the API are released as well as supporting older devices A simulator for testing against different Android devices is also available 35 5 2 PROJECT MANAGEMENT TOOLS Chapter 5 5 1 1 2 Arduino IDE The Arduino IDE is provided by the creators of the Arduino platform as a free and open source program It provides syntax highlighting example programs as well as basic editing tools The IDE handles compilation of Arduino code into C and C code the regular microcontroller tools can handle and can pass it on to an integrated uploading tool AVRDUDE to get it running on the Arduino The official Arduino IDE was considered for coding the Arduino component in but due to its limited text and code related feature set lacking features such as auto complete it was not used for coding 5 1 2 Codebase management and versioning The tools described in this section were used for versioning and managing the code base 5 1 2 1 Git version control software Git is a free open source Version Control Software VCS with support for both local and remote repositories It
81. n object This second XML document contains the requirements for the application for each device mentioned it will be specified whether this requirement is absolute or not Apart from this they are identical in structure When the user clicks on hide incompatible the application will filter away hide the wC apps that have more features than the currently connected microcontroller can offer if a conflicting pin setup can t be automatically resolved this will also happen C 4 Example This is the connected device with serial number as shown in Table C 3 Table C 3 Serial number to connected microcontroller REGR 3T2A 345D 9999 FDHG 53FD 6Y5Y 3FDS gt Doing an XML lookup to remote database and retrieving the XML that belongs to the connected device Table C 4 shows the XML for current connected device Table C 4 The XML document for current connected device Category Model Producer Arduino Uno Open Source Screen LCD 0025 SparkFun Red LED COM 09590 SparkFun BT Module T9J RN42 SparkFun These Table C 5 are the requirements for an example uC application Table C 5 he XML document for an example uC application The Warn or require field specify whether or not the component has to be present or if the application can run without Category Model Producer Warn or require Arduino Uno Open Source Screen LCD 0025 SparkFun Require Red LED COM 09590 SparkFun Warn
82. ne office suite that allows users to simultaneously edit documents of different types text spreadsheet presentation etc which was of great use 36 5 2 PROJECT MANAGEMENT TOOLS Chapter 5 when the group was working together on documents It also supports document chat and comments temporary chat forum thread like structure 5 2 2 Microsoft Word Microsoft Word is the de facto standard Word Processor with support for many different effects Content creation and formatting tasks are nearly completely intertwined making it tricky to maintain a consistent document as the documents grow larger Microsoft Word was used to generate certain graphs for the documentation 5 2 3 BIEX I4TRX is a macro improved version of Tex used for typesetting documents It is free and open source The general idea is to separate content creation and formatting to create consistent documents effectively without being distracted by the appearance of the con tent 5 2 4 Google Calendar Google Calendar is a free to use online calendar It supports both private and public events Google Calendar allows for simple calendar synchronization across different devices and platforms A shared calendar in Google Calendar was created to make it easier to keep track of group meetings meetings with the customer and the supervisor 5 2 5 Dropbox Dropbox is a cross platform file synchronization and sharing service hosted in the cloud Files in a specified fol
83. nication libraries in Java for PC s compatible with the Arduino Uno USB interface Therefore a simple Android I O app was added for testing purposes Even then the reason for the failure to communicate with the Arduino was hard to pin down until a second Arduino was wired up to echo back the information the pair received Changing the bootloader to utilize version 2 of the protocol could not be done due to it being licensed under GPL Some attempts were made at finding compiled bootloaders for the Uno but did not bear fruit Attempts at compiling bootloaders using version 2 for the chip failed due to unresolved dependencies in the bootloader projects discovered like the Stk Boot 14 and uOS Embedded 15 The solution was to implement version 1 of the protocol and write off most of the protocol work as waste a bit less than a weeks work Some of the work done on version 2 could be reused despite the protocols being radically different however The second version of the protocol has a standardized message format with checksums and static tokens inside the messages to aid in error discovery this would have been beneficial for communicating over Bluetooth It was known that Optiboot didn t make use of all the commands specified in the protocol document AVRO061 16 but documentation on which commands were superfluous was lacking Since Optiboot would simply report that everything is fine when encountering such a command discovering whic
84. oject and given a short presentation of the application itself 7 2 System testing In this section the system tests will be presented Each test was to be written to test a specific part of the product This applies to both the Android application STK500 protocol and software installed on the Arduino device Each test was to be executed separately and the results will be presented in Section 7 3 Table 7 1 Connect with device using device list Test ID STO1 Test name Device list connect Test descrip tion Connect with an Arduino device from the Device list screen Precondition Arduino device is switched on with Bluetooth enabled Test steps e Start program e Press Device list from Action overflow or from the Welcome screen e Press desired Arduino device Success con dition Android and Arduino device are connected via Bluetooth Table 7 2 Connect with device using QR Code Test ID ST02 Test name QR Code connect Test descrip tion Connect to an Arduino device using QR Code reader Precondition Arduino device is switched on with Bluetooth enabled Test steps Start program Press Device list from Action overflow Press Add device Press Connect with QR Code Choose QR Code reader Scan QR Code Success con dition Android and Arduino device are connected via Bluetooth enabled 60 7 2 SYSTEM TES
85. on is provided by the QR Code D 3 1 2 Serial A connection can also be created by typing in a serial which is the MAC address of the Arduino device This serial is six groups of hexadecimal digits meaning 0 9 and a f each group separated by a colon You have to include the colon when typing this address but it is not case sensitive which means you do not have to worry about capital letters 94 D 4 THE SHOP Chapter D D 4 The Shop The first choice in the shop is the category screen dll M 10 42 CATEGORIES ALL APPS CATEGORIES ALL APPS TOP HITS FunGame Wilhelm Games Game Robin i 1 Laa Medical PlayTime St le FunTime Bj rn Tools PlayWithPlayers Robin Medic Wilhelm Medical Jeppe Figure D 4 D 4 a The device list with Bluetooth devices D 4 b Screenshot from the shop with all apps shown You can filter through all of the apps in the store through these buttons You can also browse all the apps together by pressing All There are two ways to sort the apps within the chosen category Either not at all which is the first screen that shows after selecting a category or by the given rating Each app within the category selected is now shown on the screen The rating for each app name of the app name of the publisher and the icon of the app is shown for all the apps The user can go back to the categories by pressing the back button D 4 1 Searching Wherever you are
86. on presented to the customer precisely documenting the development method was deemed to be waste ful at that point in time The development method description was also refined over the course of the project 13 3 2 TEAM ROLES Chapter 3 It was decided to adopt RUP as process model though with some minor changes First of all the Transition phase of the model was deemed unnecessary This was mainly due to the lack of time and resources for beta testing and new versions of the product This phase was instead replaced by the closeout phase described in chapter 3 4 Further no cost es timates were developed for the project Because no money was involved in the production of the product this was also deemed unnecessary Time and resource estimates however were established during the Inception phase Lastly due to lack of time and experience testing was less prioritized than the implementation In addition to the changes mentioned above use of Lean principles were adapted from the start of the project As described in the section about Lean Software Development this methodology is defined by seven principles Of these especially Eliminate waste and Build integrity were used actively by the team during the development of the product and project report These principles is described in chapter 2 1 5 3 2 Team roles The group was organized in different roles based on skill and experience Each team member was given a responsibility f
87. or some code packages Further the team was divided into six subgroups where each member was held responsible for his or her group These groups were respectively group leader documentation and substitute leader Android and GUI Arduino and PUI over the air and test The distribution of team roles are listed in Table 3 1 3 2 1 Role description The division of the group was an important feature Every member knew who to contact about a specific problem or task Group leader was responsible for the progress in the overall project T his person ensured progress and priorities for deadlines Documentation and substitute leader was responsible for management of documen tation and reports In absence of the group leader this person took on the group leader s responsibilities This person was also responsible for contact with the cus tomer and supervisor Android and GUI developer was responsible for the Android development of the project Arduino and PUI developer was responsible for the Arduino part of the project This implies contacting the Arduino lab requisitions for hardware the coding part and over the air installation This role was also responsible for development of the PUI examples Over the air developer was responsible for programming the Arduino over the air This person was also responsible for making the first prototype with a Bluetooth connec tion Test developer was responsible for developing and executing tests f
88. or the complete project 14 3 3 COMMUNICATION Chapter 3 Table 3 1 Roles Name Role Jeppe Benterud Eriksen Group leader Nina Margrethe Smorsg rd Documentation and substitute leader Robin Tordly Android and GUI developer Bjgrn Arve Fossum Arduino and PUI developer Stale Semb Hauknes Over the air developer Wilhelm Walberg Schive Test developer 3 2 2 Division of labor The division of labor between the members of the group was largely done through the use of issues on GitHub Chapter 5 1 2 2 Whenever a task arose it was created as an issue on this site This way all the members could see what needed to be done assign different issues to themselves see what others were working on and therefore choose an appropriate issue to start working on Throughout the project the main consensus of the group has been to meet every day as long as there is not something else interfering This has caused the group to work together almost every day and thus if a problem was encountered it could be dealt with quickly Usually these meeting started at 09 00 10 00 and ended around 16 00 Any and all work done by anyone was registered in a document to ensure correct activity plans Example of an activity plan is documented in Appendix A along with an example of a status report 3 3 Communication Most of the communication within the group was done at group meetings and when the group was working together Fo
89. pter 9 the Optiboot boot loader only waits for so long before leaving programming mode In the case of the device ceasing to communicate with the protocol reprogramming the device from a computer will be required in the absence of a hard reset feature 9 2 Interaction with the customer Regular meetings with the customer were scheduled every Friday throughout the project These meetings were used to present status progress and any problems that were encoun tered In these meetings the customer was able to aid the group in decisions and give input on the prototypes of the product Apart from these regular meetings the communication with the customer was done by e mail If difficult problems were encountered or difficult decisions had to be made the group was always able to achieve help from the customer Extraordinary meetings could be scheduled at short notice if needed and the customer was willing to request help from external developers if the group requested it 9 3 Group interaction It was decided to schedule three regular group meetings each week in addition to the meeting with the customer every Friday Among these two were to be team orientation meetings where the group could discuss progress and issues and make plans for the coming week The third meeting was a working session where the group worked together the whole day In addition to these regular meetings the group scheduled working sessions continuously The guidelines
90. r communication between group members outside the meetings it was decided that the group should only use email and Skype This was decided to avoid the confusion that might arise from using numerous channels of communication Mobile phone was also used when immediate contact was necessary Communication between the group and the customer was mainly done during meetings or by email The same applies for communication with the supervisor The customer also had access to the entire project on GitHub This meant that he could check up on the progress of the project at any time and add issues or concerns directly into GitHub 3 4 Project planning In this section the planning of the project will be presented The project was divided into five large milestones to represent the different phases of the project The phases of the Rational Unified Process RUP are not explicitly stated in the work breakdown structure as some of the milestones stretches over several of the phases in the process model 15 3 4 PROJECT PLANNING Chapter 3 In the work breakdown structure WBS the first part of the Project Management ac tivity and the Planning activity represents the inception and elaboration phase of RUP Further the Execution and Testing activities represents the construction phase As men tioned above the transition phase of RUP was deemed unnecessary It was expected that tasks related to project management would appear at least until the techni
91. re Store 24 4 4 USE CASES Chapter 4 Table 4 1 Use case 1 ID 1 Name Install CSS Goal Have wCSS installed on the Android device Actors Android device owner Precondition None Prerequisite The actor has an Android device with Google Play Main Flow 1 Opens Google Play 2 Searches for uC Software Store 3 Installs the application Alternative Flow None Parent UC None Child UC Al uCSS System Presses QR code button lt includes gt Opens QR reader app User Connects Arduino device to phone QR reader System Scans the QR code Figure 4 2 Use case 2 The user connects to the Arduino with QR code 25 4 4 USE CASES Chapter 4 The second use case describes how the user can connect to an Arduino device through the uC Software Store by using a previously downloaded QR Code reader on an Android The CSS automatically detects available QR Code readers on the Android device and prompts the user to choose a QR Code reader to complete the action CSS automatically detects the QR Code read by the included action and determines whether or not this is a valid MAC address for a Bluetooth device It then attempts to pair the Android with the Arduino If there is no QR Code reader application installed on the Android uCSS prompts the user to install one Table 4 2 Use case 2 ID 2 Name Pair Arduino device and Android device with QR Code
92. rements Design the GUI using drawings and 1 3 3 Design GUI use cases displaying the different scenarios in the application 134 Create GUI Create first version of the GUI designed in 1 3 3 1 3 5 Produce Software Create the rest of the software Impl t I d t ti 1 3 5 1 GUI and logic of CSS Se RG Un ae ROTINE logic Continued on next page 17 3 4 PROJECT PLANNING Chapter 3 Continued from previous page WBS Code Element name Definition Develop the application that will Devel load oe 1 3 5 2 3 o s upload applications from CSS to PP an Arduino device Bluetooth Implement over the air installation 1 3 6 3 j q implementation of an Arduino device 1361 recono Connect and maintain an Bluetooth connection E Create all the necessary a Dorumentatibn documentation needed for the report 1 4 Testing Design and create test cases 1 4 1 Develop unit tests Develop unit tests for the program 1 4 2 User testing Develop user tests 1 5 Closeout Work on final report 18 3 4 PROJECT PLANNING Chapter 3 3 4 1 3 Work breakdown structure tree WBS tree This is the WBS tree made for this specific project Figure 3 2 WBS tree showing a more detailed overview of the different tasks in each of the five milestones 19 3 5 RISK ANALYSIS Chapter 3 3 4 2 Editions to WBS Due to challenges and unexpected work that emerged during the project it was not possible to follow the WB
93. ring SoF APP_NAME String SF DISTRIBUTOR String SoF RATING String O onPause void ListAdapterCategory Context ArrayList lt HashMap lt String String gt gt onCreateOptionsMenu Menu boolean getCount int 0 onOptionsitemSelected Menultem boolean 0 getltem int Object 0 setActivityTitle void 0 getitemid int long 0 onResume void 0 getView int View ViewGroup View getName int String Figure 6 5 The MainActivity is an activity with a ListView that uses ListAdapterCategory as an adapter When a category is selected the MainFragmentActivity is started with Intent about which category was selected In Figure 6 6 the MainFragmentActivity is started when a category is selected This activity creates a FragmentPagerAdapter that manages the fragments One fragment is one of the views that can be swiped through All and TopHits are these fragments Each fragment consist of a list and have an Adapter for this list ListAdapter 43 6 1 SYSTEM ARCHITECTURE Chapter 6 lt lt Java Enumeration gt gt A Page lt lt Jawa Class gt gt MyFragmentPagerAdapter lt lt Java Class gt gt See MainFragmentActivity FALL Page O MyFragmentPagerAdapter FragmentManager MainFragmentActivity EAS Sof TOPHITS Page O getltem int Fragment pager ViewPager So GAMES_ALL Page getCount int Aaa Se Sof GAMES_MOST_POPULAR Page O getPageTitle int CharSequence 01 oF MainFragmen
94. rn more about how the Arduino works take a look at the tutorials on the official web page 28 To make your applications work with the CSS remember to always import the Comput erSerial library Take a look at the included examples in the ComputerSerial library to understand how it works Use of extended blocking commands long running operations or loops inside the running loop should be avoided as these will prevent any programming during execution 101
95. s invalid CSS prompts the user to retry input 27 4 4 USE CASES Chapter 4 Table 4 3 Use case 3 ID 3 Name Pair Arduino device with Android device manually enter ing MAC address Goal Connect the Arduino device to the Android application with the use of manual entering of MAC address Actors Arduino device owner Precondition Actor on Add device screen Prerequisite Installed wCSS End requirement The Arduino device is connected to the phone via Blue tooth Main flow 1 User presses the button indicating that he wants to pair with the Arduino device using the MAC address 2 System opens dialog box for input 3 The user types the MAC address 4 The system pairs with the Arduino device Alternative flow 3 a The user misspells the MAC address 3 b The system displays an error and prompts again Parent UC 1 Child UC 7 28 4 4 USE CASES Chapter 4 Device list button lt includes gt Opens list of avaliable BT units User lt includes gt pCSS connects with device Figure 4 4 Use case 4 User uses the Bluetooth to scan for available connections The fourth use case describes how the user can choose an Arduino device from a list of available Bluetooth devices and pair devices from the menu in uCSS 29 4 4 USE CASES Chapter 4 Table 4 4 Use case 4 ID 4 Name Pair Arduino device with
96. s used Robotium is a powerful test framework that can be used for function system and acceptance testing The tests created in Robotium aims at writing small portions of code and checking the results against ex pected predefined values Robotium was used for unit testing on the Android application During the development of the application different units were to be tested with Robotium after they were finished An example of a Robotium test is shown below In this test it is asserted that the Bluetooth connection with an Arduino device is as expected 9 10 11 solo clickOnActionBarltem R id settings ConnectionState expectedState BluetoothConnection ConnectionState STATE CONNECTED ConnectionState actualState BtArduinoService getBtService get BluetoothConnection getConnectionState assertEquals expectedState actualState 7 1 2 Integration testing Integration testing is based on combining different units and testing the interface and communication between them This type of testing comes after the unit testing phase and before the validation testing 17 The units that can be used in these tests must therefore have passed the unit tests This made integration testing focus purely on the integration of units rather than testing that the units were working correctly as 58 7 1 TESTING STRATEGY Chapter 7 well Because the system is composed of more than one component STK500 protocol and the Andro
97. shion it was possible for the customer to continuously present his thoughts on the product and propose changes where he thought it was necessary The iterative approach on the project also made it easier for the group to set deadlines and milestones for specific parts of the product A summary and overview of each iteration is described in appendix B All the members of the group have taken the course TDT4140 Systemutvikling and therefore have some knowledge about different development methods The Rational Uni fied Process RUP model as described in Chapter 2 is an extensible framework 2 that met the requirements the group had for a process model RUP was chosen as process model for the project above the other models described in Chapter 2 as it best met the needs of the group The fact that the model was tailorable and divided the entire development process into phases that were easy to adapt to made it preferable to the other models examined It was also appealing that the model required the team to focus on critical risks early in the development to avoid surprises 3 1 1 Changes to description As mentioned in the previous section it was clear that the use of an iterative model was in order The specific documentation of the development method was deferred for three weeks however This was due to the uncertain future of the project over the air installa tion was said to potentially be impossible and the need to get the first iterati
98. sitive overall The scores varied from 57 5 to 90 out of a 100 with an average of 78 3 In the end six people were tested with different technological backgrounds Not many problems occurred during the testing One person did however have a small complaint about the consistency of the design of the application After discussing it it became apparent that this issue came from this person not being used to Android devices 7 3 5 Expert reviews After the presentation by the customers request at the SINTEF offices three people agreed to fill out SUS forms about their thoughts of the system As there were still problems with the system the scores reflected the criticism of expert uses but received an average score of 54 out of a maximum of 100 The main ideas for improvements were stability and security 64 7 3 TEST RESULTS Chapter 7 Stability was then worked on but the security aspect was not recognized as an important focus point this late in the development This was agreed upon by the customer after the meeting 7 3 6 User acceptance testing A formal user acceptance test session was not held but during the last meeting with the customer he got the opportunity to test the product The customer was pleased with the performance of the system and gave positive feedback 7 3 7 Summary Based on the tests performed during and after development of the product Table 7 11 describes to what degree the initial requirements set by th
99. t Controls whether the application should attempt to automatically reconnect at the welcome screen when reentering the application Hide other devices Allows the option of hiding showing devices in the device list which does not properly identifies themselves as an Arduino device 97 E Installation guide This installation guide guides you through how to install apps on a new Arduino If you use the Arduino provided with the report and Android application it is not necessary to follow the first steps of this guide If you are building your own Arduino it is recommended to have programming expertise and know how serial communications works You also need to be able to wire the Arduino by following a wiring diagram If you have bought a finished product or are using the Arduino provided with the report you can skip to Section E 2 E 1 Upload the first application Before you can use the wCSS you need a standard application running on your Arduino or else the Arduino will not be recognized as a supported device E 1 1 Arduino IDE 1 To transfer the first application to your Arduino you need the Arduino IDE Down load the latest version of Arduino IDE 23 and install it 2 Download the latest version of the ComputerSerial library 24 and import this into the Arduino IDE 25 3 Plug a USB cable into your Arduino and make sure you do not have anything plugged into the digital port 0 and 1 on the Arduino where the Bluetooth modu
100. tActivity Sof MEDICAL_ALL Page epage2 SO MEDICAL_MOST_POPULAR Page SFTOOLS_ALL Page Sof TOOLS_MOST_POPULAR Page SO MEDIA_ALL Page SO MEDIA_MOST_POPULAR Page S Pagel SANO O getType String int Page O onCreate Bundle void 6 getCategoryFromIype Page String O onCreateView LayoutinflaterViewGroup Bundle View 0 update void onCreate Bundle void onPause void O onCreateOptionsMenu Menu boolean onOptionsitemSelected Menultem boolean O setActivityTitle void onResume void adapter 0 1 onCreate Bundle void O onCreateView Layoutinflater View Group Bundle View update void lt lt Jawa Class gt gt SearchResults no group09 utils SearchResults O onCreate Bundle void onNewintent intent void doSearch String void adapter S ListAdapter Context ArrayListcHashMap lt String String gt gt getCount int O getitem int Object O getitemid int long getView int View ViewGroup View O getiD int String 0 setThumbimage HashMap lt String String gt lmageView TextView void Figure 6 6 Here one can see a FragmentPagerAdapter that manages all the fragments Each fragment uses a ListAdapter that structures the list items The Page enum is used to tell MyFragmentPagerAdapter which category that should be shown in All and TopHits fragments This enum is sent as an intent to the MainFrag mentActivity when started When a category is c
101. tart programming the actual product 3 Open closed problems Open e New requirement friendlier bluetooth device pairing e Bluetooth connection need to add a bluetooth module to the arduino e Non documented preexisting code e Product naming Closed e Lacking source code Will not use the compiled program in question e Licenses separate out licensed components into separate projects 4 Planned work for the next period For the next period we will have to complete the designs of the project and complete version 0 1 to show to the customer 81 A 2 ACTIVITY PLAN EXAMPLE Chapter A 5 Updated risks analysis e License incompatibility impact has gone down from 8 to 7 Importance has gone down from 10 to 8 This is because of information from the customer regarding ways to circumvent this issue as mentioned above A 2 Activity plan example Below is an example of an activity plan made by the group for the supervisor This activity plan spans weeks 6 and 7 Activity plan week 06 and 07 15 Studiepoeng resource team member works appro Figure A 1 Example of activity plan for the weeks 6 and 7 82 B Iterations This section contains an overview and a summary of each iteration of this project The project was split into iterations of two weeks and the content is based on the activity plan and the status report that was delivered to the supervisor In each iteration the use cases described in chapter 4 4 is shown
102. the protocol for installing apps on the microcontroller The Memory card represents the local storage solution on the mobile phone where the database is stored SQLite was used as the database engine because it is common and 42 6 1 SYSTEM ARCHITECTURE Chapter 6 easy to implement on Android DatabaseHandler is a class for taking care of the SQL transactions and is the access point for communication with the database A helper class called Save is used for easy access to the DatabaseHandler When the application communicates with the Save module the database communicates with the DatabaseHandler The Save class can be created from any class in the application It ensures that only a single instance of the DatabaseHandler can be instantiated and handles insertions and queries Save was created because it can be initialized and created everywhere in the application in optional Java classes and makes sure it is only one instance of the DatabaseHandler 6 1 1 Browse shop This is the shop where the user can see the uC apps choose categories and swipe through different fragments In Figure 6 5 one can see the MainActivity which is the activity for the category selection of the shop When a category is selected a new activity Main FragmentActivity see Figure 6 6 is started with the Intent about which category was selected lt Java Class gt gt ListAdapterCategory no group09 fragments SoF KEY_ID String Sof PREFS_NAME St
103. the shop to browse for apps or checking devices located in the area uC Software Store Welcome This app store allows you to download apps to your Arduino device through Bluetooth Press Device List to see nearby devices or Browse Shop to enter the app store Automatically try to reconnect to last connected device Figure D 1 The welcome screen of the uC Software Store After the first time the application was launched the welcome screen will attempt to automatically reconnect to the last known connected device This is an option which can be turned off in the settings 92 D 3 DEVICE LIST Chapter D D 3 Device List Upon selecting the Device List button from the welcome screen or from the action overflow this screen will appear On this screen Bluetooth devices within the reach of the Android device will appear in a list If the device you want to connect to doesn t show or you do not want to connect to a device just yet you can press either the Add device or Browse shop button respectively aa d BREL aa Saving screenshot Ye Devices BTJacket Click on a device to select it Refresh e Devices Click on a device to select it Refresh lolPhone5 68 96 7B A8 70 5C Old Samsung 00 24 90 27 9C 49 JeppeMac 68 A8 6D 57 58 01 If you do not see your device in the screen click Add device to add a device manually or Browse shop to browse without connecting a device SK
104. to be done within a project These issues can be assigned to people given labels to describe the issue and be grouped to create a milestone At times errors that should have been spotted have been merged into the master branch introducing these errors to the master branch These errors can be difficult to notice after the merging An example of this is creating new features based on erroneous foundations Based on this future projects should meet test requirements before being merged into the master branch 74 9 5 CONCLUSION Chapter 9 9 4 3 Design and Implementation As described in Chapter 6 2 1 a complete design guide for the Android application was created early in the project This guide proved to be very useful once the implementation began as discussions on the design were avoided Based on this the group has learned that thorough planning of implementation is wise as it increases the speed of the process and improves the quality of the final product 9 4 4 Testing Debugging the implementation of the STK500v1 protocol proved to be gruelling work As described in Chapter 3 1 1 testing was less prioritized than the implementation As none of the group members had significant experience on the field the writing of tests could potentially demand a lot of time that was used on other tasks In hindsight continu ously writing tests for each new module in both the Android application and the protocol implementation might have sa
105. to relate it to the WBS tree shown below This table also contains a description of each task Table 3 2 Work Breakdown Structure WBS Code Element name Definition All work to implement an applica 1 iC Comae Store tion store for Arduinos and over the air installation with two example PUIs All the work in connection with 1 1 Project management f project management Det i th ject stat d 1 1 1 Meetings with customer A re k S E as decide on requirements and changes 112 Demonstration of work Project team presents finished work o done for customer for the customer Creating risk analysis and 1 1 3 Risk management defining risks regarding the project and group 1 1 4 Status report Write the status report 12 Pigintie Work regarding the planning of dif ferent parts of the project Defini i t d 1 2 1 Requirements specification eee eae te i specifications 1 2 2 Determine Project team Define roles and distribute tasks 123 up meeting Meeting with supervisor for instruc tion and guidance Develop project plan and 1 2 4 Create use cases for scenarios use cases 1 2 5 Research Research areas where needed 13 Fxecution Programming and execution of the project Meeti ith t t t 1 3 1 Project kickoff meeting F oe aa re eee project plan y Determine whether the group is in f lidat gt 1 3 2 y 7 Vala use tune with the customers vision of requirements a the project requi
106. ton Hides apps i incompatible Jacket ie with selected owner Arduino device Figure 4 6 Use case 6 The user can open the action overflow bar and hide show incom patible applications The sixth use case describes how the user can choose to filter apps in CSS based on their compatibility with the paired Arduino device 31 4 4 USE CASES Chapter 4 Table 4 6 Use case 6 ID 6 Name Hide incompatible apps Actors Arduino device owner Prerequisite Installed wCSS Precondition Actor has chosen a category End Requirement None Main Flow 1 The user presses action overflow button 2 The user selects hide incompatible applications 3 The application hides all incompatible applications from the user 4 The user browses compatible apps Alternative Flow None Parent UC 1 Child UC None Selects app Presses install button User Installs app to Arduino device Figure 4 7 Use case 7 The user selects an application presses the install button and confirms the installation The seventh use case describes the user sequence to choose and install an application from the CSS to the paired Arduino device 32 4 4 USE CASES Chapter 4 Table 4 7 Use case 7 ID 7 Name Install application on Arduino device Goal Connect the Arduino device to the Android application with the use of QR Code Actors Arduino device owner Prerequisite Installed w
107. tooth connection is persistent throughout the program All code written is open source Code belonging to the SPRY PORSA Android application is under the Apache 2 0 licence Continued on next page 65 7 3 TEST RESULTS Chapter 7 Continued from previous page ete ey Result Comment code NFROA Passed The Android application is compatible with at least Android 2 3 and newer 66 8 Roadmap for further develop ment This chapter describes what work remains in this project and a pointer to how this could be done The different points of improvement mentioned in this chapter provides an overview of what the group would have focused on if given more time 8 1 The uC Software Store application This section focuses on areas of improvement regarding the uC Software Store Some of the points mentioned in this section are important to elaborate on for the application to be fully usable to the general user while others are of less importance 8 1 1 Database One of the most pressing matters that needs to be elaborated in future work is the im plementation of a remote database The delivered version of the application uses a local database that is automatically filled with data when the application is installed on an Android device The use of a local database makes it difficult for general users of the application to add their personal apps to the uC Software Store database This is because these apps woul
108. untered in B 6 The final parts of the application were completed and the STK500 was implemented into the application as a library A workshop with the customer at SINTEF was held and an acceptance test and an usability test were performed Most of the time was spent on completing the documentation 85 B 7 ITERATION 7 Chapter B B 7 2 Overview e Workshop for SINTEF Demonstrated our finish application Acceptance testing Usability testing e Finished the STK500 protocol e Final touch and finishing of the Android application e Finishing documentation 86 C Standard for defining pC Software Store compatible microcontroller based de vices C 1 Introduction This document contains a standard for how microcontroller based devices is identified and how this makes it possible to filter applications by compatible incompatible in uC Software Store It also defines certain requirements to the wiring of specific components All apps that will show up in the uC Software Store needs to be registered This is done by sending an application to the management along with the microcontroller app a wiring diagram and information about the components used C 2 Basics When a uC application is registered in the uC Software Store database it will have a serial number on eight groups of four hexadecimal digits separated by colons for exam ple 2F 32 GSE2 F353 T325 G443 455N K49D 03J2 Every registered microcontroller also require
109. ved the group a lot of time spent on debugging 9 5 Conclusion The most important requirements were met Those requirements not met were less prior itized after discussions with the customer The project management methods applied en sured steady progress throughout the project The developer team considered the project to be successful as the single most important goal was attained over the air installa tion 79 List of Tables 3 1 3 2 3 4 4 1 4 2 4 3 4 4 4 5 4 6 4 7 4 8 7 1 tid 7 3 7 4 7 5 7 6 7 7 7 8 7 9 7 11 9 1 C 1 C 2 C 3 C 4 C 5 C 6 Roles E ee ets es he alae ti ce Sas a hte a aE GA 8 Sih ah 15 Work Breakdown Structure a a 17 Risk analysis avsta nga ar SRY AR Pe Ne Be ae a at 20 WSO2CASE L ca o vn a bel ee eR da ah Pet a els 25 Use Case Di he eee oy Be oe eb ae E a ee wy bw ee Ee te 26 USE CASAS uk vase i aR me taeda a Pace Ahk Go iol ce ok Ge a DR ie Be aks 28 Us CaSO Ag cote co eh Nea Tare hoe ad chee hat E aon nae ek pees whe 30 Useras Dia PS ade Re ek ee EE ee ed At eed els 31 Use Case aa a Bal SA Poa oi eng Show Ge Bw 32 Use eases iit is oats uo Bah A I a ect ee Be oh a 33 Use Casa DL he ae tos ee ee tel a cele Se ot 34 Connect with device using device list 2 2 0 02 02 0 20000 60 Connect with device using QR Code 2 202004 60 Connect with device using serial 2 2 o ee ee 61 Search for desired app a 61 Connect to last connected
110. ware over the air to a desired microcontroller The overall system architecture as shown in Figure 6 3 and Figure 6 4 illustrates the core components of the system and the relationship between these components The Market Application is the centre of the application and is where most of the GUI and functionality visible to the user is shown Device List is the list of devices that the user can choose from and connect to This is also the location of the Add Device functionality where the user can connect to a device in an alternative way QR Code or MAC address 41 6 1 SYSTEM ARCHITECTURE Chapter 6 STK500 Protocol DatabaseHandler Figure 6 3 This shows the overall system architecture with the most important compo nents lt lt Java Class gt gt AddDevice Screen no group09 utils 4 macAddress String SFNOT_VALID_MAC String AddDeviceScreen onCreate Bundle void 0 onActivityResult int int Intent void onCreateDialog Dialog toUpperCase String void O getMacAdress String O setMacAdress String void O isValidMacAddress String boolean O setActivityTitle void O createDialog String Dialog Figure 6 4 This is a UML diagram of the Add Device Screen When QR reader or input serial is chosen a new asynchronous task is started that handles the Bluetooth connection process The Service holds and manages the Bluetooth connection BluetoothConnection and is communicating with
111. with Java MySQL and the basics of Arduino project development 1 3 THE CUSTOMER Chapter 1 1 3 The customer SINTEF is the largest independent research organization in Scandinavia It is a non commercial organization with close ties to NTNU and international activity with clients in 60 different countries There is a joint effort by NTNU and SINTEF regarding lab work many are employed by both and there are labs funded by both companies in order to facilitate continued research Throughout the project customer interraction was done through Babak Farshchian from SINTEF SINTEF NTNU Det skapende universitet a b Figure 1 1 Customer 1 1 a SINTEF 1 1 b NTNU 1 4 Problem description The project task was to develop a platform for easy use setup and sharing of Physical User Interfaces PUIs for Arduino The task was divided in three main parts a market application over the air installation and example PUIs The purpose of the market application was to allow users of Arduino to browse and down load PUI applications for their Arduino board on a mobile Android device This market application was to be a simplified version of e g Google Play where users easily can browse and install whatever applications they desire An application selected for installation in the market application should be prepared on the mobile device and installed over the air on an Arduino board using Bluetooth The example PUIs were mostly intended

Download Pdf Manuals

image

Related Search

Related Contents

Toshiba 34HFX85 CRT Television User Manual  Brocade Network Advisor SAN Installation and    MODE d`EMPLOI du DOSIMÈTRE RADON KODALPHA  Meat Grinder Instruction manual  Severin RG 2671 raclette    User manual - Check  1. Disposiciones generales  Bedienungsanleitung  

Copyright © All rights reserved.
Failed to retrieve file