Python 3.5 or higher is required
Follow the steps bellow:
-
Clone this repository by running :
git clone www.github.com/vahidzee/HardWarClient.git
-
Go to the cloned directory :
cd HardWarClient
-
Install virtualenv :
sudo apt install virtualenv
-
Create a virtual environment for the project by running :
virtualenv --python=python3 venv
-
Activate your virtual environment by running:
source venv/bin/activate
-
Install Project requirements by running:
pip install -r requirements.txt
-
Install python serial
sudo apt-get install python3-serial
-
Run Project by running:
sudo python3 main.py
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.
Set server_address
and server_port
to announced values.
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.
There are Two Running Options:
- Binding Arduino to the network:
python main.py
which binds your Arduino device to the server specified byserver_address
andserver_port
in settings. - Debugging Arduino's Connection:
python main.py debug_arduino
which sends the byte-array set byarduino_debug_message
insettings.py
file.
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.
- First of all make sure you're typing
py
instead ofpython
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
anddisable
andenable
the serial port your device is connected to without pulling it out.