Differences

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

Link to this comparison view

pm:prj2022:apredescu:111 [2022/05/10 16:00]
dinu_stefan.rusu [Results]
pm:prj2022:apredescu:111 [2022/06/24 10:38] (current)
dinu_stefan.rusu [Download]
Line 1: Line 1:
 ====== Password manager ====== ====== Password manager ======
 +===== Rusu Dinu-Ștefan 1221EA =====
 ===== Introduction ===== ===== Introduction =====
  
Line 5: Line 6:
  
 ===== General description ===== ===== General description =====
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​ma_diagram_hardware_rusu_dinu_stefan.png?​800|}} +{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​ma_diagram_hardware_rusu_dinu_stefan.png?​600|}} 
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​ma_diagram_rusu_dinu_stefan.png?​800|}}+{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​ma_diagram_rusu_dinu_stefan.png?​600|}}
  
 ===== Hardware Design ===== ===== Hardware Design =====
Line 12: Line 13:
 Parts list: Arduino UNO R3, Infrared receiver, remote control, Alphanumeric LCD, breadboard, resistor 1k, jumper wires Parts list: Arduino UNO R3, Infrared receiver, remote control, Alphanumeric LCD, breadboard, resistor 1k, jumper wires
  
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_electric_schematic_visual.png?​800|}}+{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_electric_schematic_visual.png?​600|}}
  
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_electric_schematic_wireframe.png?​800|}}+{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_electric_schematic_wireframe.png?​600|}}
  
 ===== Software Design ===== ===== Software Design =====
-Developed using CLion (+PlatformIO) and Arduino IDE (to upload the code to the Arduino). On boot, the walled ​displays a seed, that is used in the companion app to retrieve the password. After the password is entered in the wallet, the user can scroll trough the passwords, edit or delete a password or save a new one. After performing edits on the passwords, they can be saved by pressing FOL+ while in ADD_PASSWORD mode (mode 4). This is done in order to prevent too many writes to the EEPROM (after 100000 writes, the EEPROM will become damaged, hence an '​autosave'​ feature is not provided).+Developed using CLion (+PlatformIO) and Arduino IDE (to upload the code to the Arduino). On boot, the wallet ​displays a seed, that is used in the companion app to retrieve the password. After the password is entered in the wallet, the user can scroll trough the passwords, edit or delete a password or save a new one. After performing edits on the passwords, they can be saved by pressing FOL+ while in ADD_PASSWORD mode (mode 4). This is done in order to prevent too many writes to the EEPROM (after 100000 writes, the EEPROM will become damaged, hence an '​autosave'​ feature is not provided).
  
-The companion app is a cross-platform app, written in Flutter.+Modularity and reusability were key while writing the code for the wallet, in order to allow for ease of expansion, and addition of new features. 
 + 
 +In order to easily debug the code and to trim'​spammy'​ logs in the case that not all of them are necessary, 3 logging levels exist (No logs, warning, warning & info), and 2 type of logs (Info & Warning). Logging is handled by:  
 +<​code>​void printDebugInfoMessage(const String &​message)</​code>​ 
 +and 
 +<​code>​void printDebugWarningMessage(const String &​message)</​code>​ 
 + 
 +In order to define the logging level, debuggingLevelEnabled from currentState must be changed to one of: NO_LOGS, WARNINGS, INFO. 
 + 
 +To decode the signal from the remote, the <​code>​String decodeRemoteCode(uint32_t code)</​code>​ function is used, that contains a switch that returns the letter that was pressed. I did not use a HashMap in order to save memory. 
 + 
 +Each remote code is written as a define at the top of the program, in order to easily update the code in case that a different remote is used. Also, all other constants such as pins, the password cover, and the logging levels are defined in the same way. 
 + 
 +The wallet has a custom built state management system, in order to not refresh the display every time loop() is ran. The state of the wallet is kept in a struct, and if any field in that struct is changed, a state changed is triggered, and the display is refreshed. The state is handled by:  
 +<​code>​void setState(int32_t state, int32_t debuggingEnabled,​ const String &​display,​ const String &​displayRow2,​ const String &input = currentState.input,​ const String &​password = currentState.password,​ const String &​secrets = currentState.secrets)</​code>​ 
 + 
 +In order to write to the display, a custom function is used, that handles a few write modes, such as appending text and overwriting,​ and also the line on which the text is going to be written to. Writing to the display is handled by: 
 +<​code>​void writeToDisplay(const String &word, bool append = true, bool firstRow = true, bool appendSpace = true)</​code>​ 
 + 
 +The companion app is a cross-platform app, written in Flutter ​(a framework for building cross-platform apps developed by Google, on top of Dart) that allows the user to get the wallet password and view quick tutorials about each mode of the wallet.
  
  
Line 25: Line 45:
 The device works as expected, passwords are saved and retrieved from EEPROM, there seem to be no bugs in the software, neither for the Arduino nor for the companion app. The device works as expected, passwords are saved and retrieved from EEPROM, there seem to be no bugs in the software, neither for the Arduino nor for the companion app.
  
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_10_.jpg?​200|}}+{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_10_.jpg?​600|}}
  
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan.jpg?​200|}}+{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan.jpg?​600|}}
  
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_2_.jpg?​200|}}+{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_2_.jpg?​600|}}
  
  
  
 {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_3_.jpg?​200|}} {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_3_.jpg?​200|}}
-{{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_4_.jpg?​200|}} 
 {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_5_.jpg?​200|}} {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_5_.jpg?​200|}}
- 
 {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_6_.jpg?​200|}} {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_6_.jpg?​200|}}
 +
 {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_7_.jpg?​200|}} {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_7_.jpg?​200|}}
 {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_8_.jpg?​200|}} {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_8_.jpg?​200|}}
- 
 {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_9_.jpg?​200|}} {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_9_.jpg?​200|}}
 ===== Conclusions ===== ===== Conclusions =====
 This was the first project of this type that I've made, it helped me better understand the labs, and how hardware works. This was the first project of this type that I've made, it helped me better understand the labs, and how hardware works.
 ===== Download ===== ===== Download =====
-You can find the code for the Arduino [[https://​github.com/​xrusu/​ma-lab|here]] https://​github.com/​xrusu/​ma-lab and for the companion app [[https://​github.com/​xrusu/​ma-lab-companion|here]] https://​github.com/​xrusu/​ma-lab-companion, or you can download the archives from here:+You can find the code for the Arduino [[https://​github.com/​xrusu/​arduino-password-manager|here]] https://​github.com/​xrusu/​arduino-password-manager ​and for the companion app [[https://​github.com/​xrusu/​arduino-password-manager-companion|here]] https://​github.com/​xrusu/​arduino-password-manager-companion, or you can download the archives from here:
  
 {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_1221a_arduino_code.zip|Wallet code archive}} {{:​pm:​prj2022:​ea:​dinu_stefan_rusu:​rusu_dinu_stefan_1221a_arduino_code.zip|Wallet code archive}}
Line 54: Line 72:
 ===== Log ===== ===== Log =====
  
-21/04/​2022: ​Project selection+20/05/​2022: ​Added more details about '​Software'​ on wiki
  
-22/04/2022: Wiki page +09/05/2022: Wiki brush-up
- +
-07/05/2022: Started writing the software+
  
 08/05/2022: Code brush-up 08/05/2022: Code brush-up
  
-09/​05/​2022: ​Wiki brush-up+07/​05/​2022: ​Started writing the software
  
 +22/04/2022: Wiki page
 +
 +21/04/2022: Project selection
 ===== Bibliography/​Resources ===== ===== Bibliography/​Resources =====
  
Line 69: Line 88:
  
 [[https://​www.vishay.com/​docs/​82491/​tsop382.pdf | IR Receiver Datasheet]] [[https://​www.vishay.com/​docs/​82491/​tsop382.pdf | IR Receiver Datasheet]]
 +
 +[[https://​dart.dev/​ | Dart]]
 +
 +[[https://​docs.flutter.dev/​ | Flutter]]
  
 <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​ <​html><​a class="​media mediafile mf_pdf"​ href="?​do=export_pdf">​Export to PDF</​a></​html>​
  
pm/prj2022/apredescu/111.1652187643.txt.gz · Last modified: 2022/05/10 16:00 by dinu_stefan.rusu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0