Arduino - Report - 2021 - Asif - Mulla - UI Improvements, Bug Fixes and Angular Version Upgrade
Arduino - Report - 2021 - Asif - Mulla - UI Improvements, Bug Fixes and Angular Version Upgrade
On
UI Improvements, Bug fixes and
Angular Version Upgrade
Submitted by
Asif Sajid Mulla
Dr. D.Y. Patil Pratishthan's College of
Engineering,Salokhenagar Kolhapur.
Mentors
Mr. Nagesh Karmali
Ms. Firuza Aibara
Acknowledgement
I, the summer intern of the FOSSEE - Arduino On Cloud, am so overwhelmed in all humbleness
and gratefulness to acknowledge my deep gratitude to all those who have helped me put my
ideas to perfection and have assigned tasks well above the level of simplicity and into something
concrete and unique.
I wholeheartedly thank Prof. Kannan M. Moudgalya for having faith in me, selecting me to be a
part of his valuable project and for constantly motivating me to do better. I thank Mr. Nagesh
Karmali and Ms. Firuza Aibara for providing me the opportunity to work on this project. I am
also very thankful to my mentors for their valuable suggestions. They were and are always there to
show me the right track when needed help. With help of their brilliant guidance and encouragement,
I was able to complete tasks properly and was up to the mark in all the tasks assigned. During the
process, i got a chance to see the stronger side of our technical and nontechnical aspects and also
strengthen our concepts. Last but not the least, I sincerely thank all our other colleagues working in
different projects under Prof. Kannan M. Moudgalya for helping us evolve better with their
critical advice.
Declaration
I declare that this written submission represents our ideas in my own words and whenever other’s
ideas or words have been included, I have adequately cited and referenced the original sources. I
declare that I have properly and accurately acknowledged all sources used in the production of
this thesis.
I also declare that We have adhered to all principles of academic honesty and integrity and have not
misrepresented or fabricated or falsified any idea/data/fact/source in our submission. I understand
that any violation of the above will be a cause for disciplinary action by the Institute and can also
evoke penal action from the sources which have not been properly cited or from whom proper
permission has not been taken when needed.
Asif Mulla
Index
1. Introduction
1.1. Project overview
2. Improvement UI.
2.1. Dashboard UI.
2.2. Gallery UI.
2.3. Lazy loading features.
6. Some improvements.
6.1. Show header after login.
6.2. Development mode login bug.
6.3. Cloud circuit save bug
6.4. Change password functionality
8. Conclusion
9. Future Work
10. References
List Of Figures
Figure 2.1: Dashboard UI.
Figure 2.1.1: Temporary Circuit UI.
Figure 2.2: Gallery UI
Figure 2.3: Lazy Loading Features
Figure 4.1: Add to Gallery Button
Figure 4.2: View Circuit on gallery
Figure 4.4: Delete Circuit From Gallery
Figure 5.1: Search Functionality for save circuit
Figure 6.2: Development Mode Login
Figure 6.4.1:Environment Urls in Development
Mode.
Figure 6.4.2:Environment Urls in Production Mode.
Figure 7.1:DHT 11 Connection with arduino.
Chapter 1
Introduction
Arduino on cloud is a cloud-based simulator, which can be used by students and researchers to test
and run the simulation on the web, before actual execution. This system allows the users to drag and
drop Arduino components from the left pane onto the working space on the right. The pins of the
Arduino board can be connected to various input/ output devices like LED, motor, push-button, etc
using wires. There is also a facility to change the color of wires, LEDs, and such components, to
differentiate easily. The users can then proceed to write their code in the code window which is then
simulated. There is an option for the users to print or save it in pdf format for documentation
purposes. The basic ERC check enables the users to find out errors if any.[1]
Improvement UI
During the internship, I added a few features to the project, most of these features aimed at
improving the accessibility of the website and facilitate some stuff in the website.
One more feature added is the temporary UI had a separate tab previously which is now converted
into a separate page.
Passing through each of the phases of the version. Angular syntax was changed.which i checked
whether it was correct or not after successful migration of each version. I runned the development
as well as production mode.
When I completed the updates till version 11, I found the two packages (isundefined , is null) were
deprecated from angular 4. Thus, I modified the code to make it work smoothly in future.
1.Before Updating
If you use the legacy HttpModule and the Http service, switch to HttpClientModule and the
HttpClient service. HttpClient simplifies the default ergonomics (you don't need to map to JSON
anymore) and now supports typed return values and interceptors. Read more on angular.io.
1. Update to version 8 of the core framework and CLI by running ng update @angular/cli@8
@angular/core@8 in your terminal and review and commit the changes.
2. Replace /deep/ with ::ng-deep in your styles, read more about angular component styles and
::ng-deep. /deep/ and ::ng-deep both are deprecated but using ::ng-deep is preferred until the
shadow-piercing descendant combinator is removed from browsers and tools completely.
3. Angular now uses TypeScript 3.4, read more about errors that might arise from improved type
checking.
4. The CLI's build command now automatically creates a modern ES2015 build with minimal
polyfills and a compatible ES5 build for older browsers, and loads the appropriate file based on the
browser. You may opt-out of this change by setting your target back to es5 in your tsconfig.json.
5. When using new versions of the CLI, you will be asked if you want to opt-in to share your CLI
usage data. You can also add your own Google Analytics account. This lets us make better decisions
about which CLI features to prioritize, and measure the impact of our improvements.
6. If you use ViewChild or ContentChild, we're updating the way we resolve these queries to give
developers more control. You must now specify that change detection should run before results are
set. Example: @ContentChild('foo', {static: false}) foo !: ElementRef;. ng update will update your
queries automatically, but it will err on the side of making your queries static for compatibility.
8. For lazy loaded modules via the router, make sure you are using dynamic imports. Importing via
string is removed in v9. ng update should take care of this automatically.
11. Your project has now been updated to TypeScript 3.8, read more about new compiler checks and
errors that might require you to fix issues in your code.
13. If your project depends on other Angular libraries, we recommend that you consider updating to
their latest version. In some cases this update might be required in order to resolve API
incompatibilities. Consult ng update or npm outdated to learn about your outdated libraries.
14. Angular 9 introduced a global $localize() function that needs to be loaded if you depend on
Angular's internationalization (i18n). Run ng add @angular/localize to add the necessary packages
and code modifications. Consult the $localize Global Import Migration guide to learn more about the
changes.
18. New projects use the filename .browserslistrc instead of browserslist. ng update will migrate you
automatically.
19. Run ng update @angular/core@11 @angular/cli@11 which should bring you to version 11 of
Angular.
21.Support for IE9, IE10, and IE mobile has been removed. This was announced in the v10 update.
Chapter 4
In the previous model, the circuits were in JSON file and this file was called in the front end to display
the circuits. I added all the gallery circuits in the backbend and then I exported this data in migration, I
called the API to get the gallery circuits and update in UI, also modified the cards.
The gallery is visible to every user but the authority to delete the content is only with the uset with
staff role. When we delete an image, it displays the pop-up for the information of the action. After
clicking on "Yes", the API for delete will get called.
Some Improvements
In the previous existing system this search box consisted of the buttons and the results received were
not accurate and the previous version were visible.
So, When we start with the login process, we can check if the angular project is working with the
development as well as production mode. If the development mode is present we can pass the token
using URL and in production mode,, this token is hidden.
Figure 6.2: Development Mode Login.
In development mode, when we save circuits, functionalities do not work smoothly displaying errors.
The problem occurred due to cors error. I fixed this error to modify the http headers.
Specifications:-
Operating voltage:3.5 to 5.5 v
Operating current:0.3 mA (measuring) 60uA
Communication Process -
Single-bus data format is used for communication and synchronization between MCU and DHT11
sensor. One communication process is about 4ms. Data consists of decimal and integral parts. A
complete data transmission is 40 bit, and the sensor sends higher data bits first. Data format: 8bit
integral RH data + 8bit decimal RH data + 8bit integral T data + 8bit decimal T data + 8 bit checksum.
If the data transmission is right, the check-sum should be the last 8bit of "8bit integral RH data + 8bit
decimal RH data + 8bit integral T data + 8bit decimal T data''.
Initially I gathered the information about the DHT11 sensor followed by the creation of an SVG file. I
connected the DHT11 with an Arduino, using a simple DHT11 library, but when simulation of the
program is done moisture and humidity is detected as 0, also accurate output is not detected. I am still
working on this to get the accurate result.
Conclusion
This project was very interesting for me to work on as there were various new challenges. I had a very great
time working over it and also learnt various new concepts which helped me to improve my skills and learn new
technologies. I would like to thank all the faculty involved for guiding me throughout the project.
Chapter 9
Future Work
• The current system is not responsible so, in future we can work on responsive web pages.
• working with DHT 11 sensor to arduino cloud.
• Refactoring of application.
• Fixing bug, users are able to delete/interact with elements even when simulation is running.
Adding more sensors and components.
•
References
[1] https://esim-cloud.readthedocs.io/en/latest/overview/index.html#arduino-on-cloud
[2] https://update.angular.io/?v=7.0-11.0
[3] https://www.npmjs.com/package/ng2-search-filter
[4] https://components101.com/sensors/dht11-temperature-sensor