Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/vahidzee/hardwar-2019-client
Middleware Client which connects Arduino through Serial Port to a custom TCP server - SUT HardWar 2019 Contest
https://github.com/vahidzee/hardwar-2019-client
arduino network python3 serial-port serial-ports sharif-university
Last synced: about 2 months ago
JSON representation
Middleware Client which connects Arduino through Serial Port to a custom TCP server - SUT HardWar 2019 Contest
- Host: GitHub
- URL: https://github.com/vahidzee/hardwar-2019-client
- Owner: vahidzee
- Created: 2019-04-29T12:54:12.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-05-11T13:46:16.000Z (almost 6 years ago)
- Last Synced: 2024-11-06T22:31:40.535Z (3 months ago)
- Topics: arduino, network, python3, serial-port, serial-ports, sharif-university
- Language: Python
- Size: 23.4 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: ReadMe.md
Awesome Lists containing this project
README
# Sharif University of Technology Hardwar 2019 - Arduino Middleware Client
## Setup
Python 3.5 or higher is requiredFollow the steps bellow:
1. Clone this repository by running :
`git clone www.github.com/vahidzee/HardWarClient.git`2. Go to the cloned directory :
`cd HardWarClient`3. Install virtualenv :
`sudo apt install virtualenv`4. Create a virtual environment for the project by running :
`virtualenv --python=python3 venv`5. Activate your virtual environment by running:
`source venv/bin/activate`6. Install Project requirements by running:
`pip install -r requirements.txt`7. Install python serial
`sudo apt-get install python3-serial`8. Run Project by running:
`sudo python3 main.py`## Settings
### Serial Port Setup
First of all you should find the port your Arduino is connected to by looking under
`tools > port` in your Arduino sketch application,
also you can list all serial ports available on your computer by running
`python -m serial.tools.list_ports`After finding the serial port your device is connected to,
enter the port name in `settings.py` as a value of `serial_port_name`,
you can also change `serial_baudrate` and `serial_timeout` to your desired values.### Network Address
Set `server_address` and `server_port` to announced values.### Log Settings
If `serial_log` is set to `True`, every Serial output of your Arduino device will be displayed in both two running modes.If `network_log` is set to `True`, every received data from server will be displayed in both two running modes.
## Usage
### Running options
There are Two Running Options:
1. Binding Arduino to the network: `python main.py` which binds your Arduino device to the server specified by `server_address` and `server_port` in settings.
2. Debugging Arduino's Connection: `python main.py debug_arduino` which sends the byte-array set by `arduino_debug_message` in `settings.py` file.### Accessing Data From Arduino's Side
Every data sent to your device is accessible through Arduino's Serial read methods and all your Serial output results will be read by Client Application.## Debugging Windows Problems
* First of all make sure you're typing `py` instead of `python` to run python applications :D !
* Make sure you're running this project as an administrator (open your command line application as an administrator)
* If you're still getting errors while opening the serial port, goto your `device manager` and `disable` and `enable` the serial port your device is connected to without pulling it out.