niagroup / 2020_arduino_pi_iot_project Goto Github PK
View Code? Open in Web Editor NEWA remote access IOT project communicating via bluetooth between an Arduino & Raspberry Pi
License: MIT License
A remote access IOT project communicating via bluetooth between an Arduino & Raspberry Pi
License: MIT License
forms/Web UI -> python/Flask back end
back end should pair with discovered devices, issue test suite in "flask_webapp/tests/", return pass/fail status back up to UI
NOTE:: results will be based on total time needed to be balanced
1. This will be executed from the webapp UI.
2. The status should change based on the results of this process.
[xx,xx,xx,xx,xx,xx,xx,xx]
Byte Position | Designation |
---|---|
0 | Start Byte |
1 | Test Byte |
2 | Kp Byte |
4 | Ki Byte |
5 | Kd Byte |
6 | Result Desired Flag Byte |
7 | Stop Byte |
python/Flask -> Web UI/ display Table
Last analysis: Aug 18 | Next scheduled analysis: Aug 25
โ Nice work, you're all caught up!
โ Nothing yet, but I'm continuing to monitor your PRs.
What would you like to see here? Let us know!
๐ Quick links
Pixee Docs | Codemodder by Pixee
๐งฐ Tools I work with
SonarCloud | SonarQube | CodeQL | Semgrep
๐ Pixee CLI
The power of my codemods in your local development environment. Learn more
๐ฌ Reach out
Feedback | Support
โค๏ธ Follow, share, and engage with Pixee: GitHub | LinkedIn | Slack
NOTE : The servo position should be sent as a angle in degrees (i.e. 0, 30, 90, etc )
Considerations:
1. The servo is made up of 3 wires:
3. Avoid manually turning the servo while connected to the Arduino to avoid any incidental feedback current from the servo motor.
Considering switching sensor technologies from ultrasonic sensor -> Infrared Range finder.
Upon clicking the connect button I did observe connection established successfully, however an alert message was displayed by the browser explaining that there was a failure that occurred during connection.
user entries
time, date, balance time
NOTE : We will be using the SoftwareSerial library, as it will make testing/development easier.
NOTE : This will require the creation of a defined command list, that the pi side of the team will need when integration begins.
1. The arduino reads serial commands in byte arrays, so a defined list of byte will be needed. (i.e. [FF, A3, 12, 78, etc])
2. Because the arduino will read as an array of bytes, this will potentially require a start byte and a stop byte to trigger when to stop listening for commands.
3. The HC-05 Bluetooth module has an operating voltage of 3.3 volts. The VCC pin should ONLY be connected to the arduino's 3.3V pin. While different revision of the board have circuit protection, we should side with caution and just stick with 3.3V.
_4. Serial Communication has two general methods : half duplex or full duplex _
NOTE : For serial communication device 1 RX pin connects to device 2's TX pin, and device 1's TX pin connects to device 2's RX pin. So if communication isn't working, this may be a good thing to double check first.
Model a simple design to be easily assembled for the balance beam. The balance beam is used to hold the sensor & the ping pong ball. The pivot mechanism will depend on how you portion gets designed.
Description: This issue will track the effort of creating a python back-end data structure with calls for issuing a generic and BLE Bluetooth scan and identify available devices.
Pass Criteria:
Reach Goals:
#Please document all headaches, learning, tips & tricks.
This script will simply mirror the current BLE solution, but offer similar functionality for the non_BLE communication.
NOTE : Request & Response messages will be compromised of 8 bytes in an array
The function should exist outside the main loop so it is contained
The function should be called each time a BT message is received
The function should be able to read all 8 bytes and parse them accordingly
byte0 | byte 1 | byte 2 | byte 3 | byte 4 | byte 5 | byte 6 | byte 7 |
---|---|---|---|---|---|---|---|
command | detail 1 | detail 2 | Kp | Ki | Kd | reserve | status |
NOTE : the first bit (MSB, farthest left bit) of the command byte will indicate what type of command this message will be. i.e. sanity check vs PID control run.
1. The function is being created based on the expectation of the request btyte array being formatted correctly.
2. The status byte will only be used by the arduino (response).
NOTE : It has only been tested on the Raspberry Pi
NOTE:: Be sure to update the other front-end developers so they know where to place their js, html, and css files.
NOTE : Sanity checks are higher priority as they require less processing time than a full test request
1. The library should be developed in parallel with the backend library to ensure consistency in definitions
2. The code should handle a lot of the heavy lifting in its own file to keep the main code concise
3. The bluetooth implementation will need to be implemented on the pi side to work the same for BT BLE devices as well as BT classic devices.
request - message from the pi to the arduino
response - message from the arduino to the pi
NOTE : This may be an arduino limitation, not sure as of yet. References search terms : "Arduino Serial Communication"
Work
NOTE : this may need to change to milliseconds in the future.
1. The sensor has 4 pins
*TRIG - Trigger pin should be connected to any digital I/O pin as an OUTPUT (Currently pin 4)
*ECHO - Echo pin should be connected to any digital I/O pin as an INPUT; to be read (Currently pin 5)
*VCC - Supply voltage pin should be connected to the arduino 5V pin
*GND - Ground should be connected to the arduino ground pin
2. The trigger pin has to be set to HIGH then LOW to start the ultrasonic pulse emission.
NOTE : This means it should start at LOW and end with LOW, never leave it at HIGH
3. DO NOT WRITE TO THE ECHO PIN, this pin is strictly for reading by the arduino
NOTE: The echo pin returns a series of pulses (HIGHS & LOWS, i.e. 101000100001). To read the series of pulses we use the pulseIn function. i.e. pulseIn(5,HIGH)
*Create Flask Project
*Add necessary folders for respective web-teams
*Push to main repo
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.