-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from Chr157i4n/dev
version 0.4.2
- Loading branch information
Showing
19 changed files
with
227 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
--- | ||
name: UART connection problem report | ||
about: Create a report to help us improve | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
**Describe the bug** | ||
A clear and concise description of what the bug is. | ||
Please check out the [Troubleshoot section](https://github.com/Chr157i4n/TMC2209_Raspberry_Pi#troubleshoot) first. | ||
|
||
``` | ||
Include the output of the [demo/debug_script_01_uart_connection.py](https://github.com/Chr157i4n/TMC2209_Raspberry_Pi/blob/main/demo/debug_script_01_uart_connection.py) script in your issure report here using [Markdown Code-Blocks](https://docs.github.com/en/get-started/writing-on-github/working-with-advanced-formatting/creating-and-highlighting-code-blocks). | ||
``` | ||
|
||
**To Reproduce** | ||
Steps to reproduce the behavior: | ||
1. installed the library with pip | ||
2. ran the function '....' | ||
4. See error | ||
|
||
**Expected behavior** | ||
A clear and concise description of what you expected to happen. | ||
|
||
**Versions** | ||
- Raspberry Pi Version | ||
- OS Version | ||
- Version of this library | ||
- TMC2209 version and manufacturer | ||
|
||
**Additional context** | ||
Add any other context about the problem here. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[metadata] | ||
name = TMC_2209_Raspberry_Pi | ||
version = 0.4.1 | ||
version = 0.4.2 | ||
author = Christian Köhlke | ||
author_email = [email protected] | ||
description = this is a Python libary to drive a stepper motor with a Trinamic TMC2209 stepper driver and a Raspberry Pi | ||
|
@@ -22,7 +22,7 @@ classifiers = | |
package_dir = | ||
= src | ||
packages = find: | ||
python_requires = >=3.6 | ||
python_requires = >=3.7 | ||
install_requires = | ||
RPi.GPIO | ||
pyserial | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
#pylint: disable=unused-import | ||
#pylint: disable=ungrouped-imports | ||
""" | ||
Many boards have RaspberryPI-compatible PinOut, | ||
but require to import special GPIO module instead RPI.GPIO | ||
This module determines the type of board | ||
and import the corresponding GPIO module | ||
Can be extended to support BeagleBone or other boards | ||
""" | ||
|
||
from os.path import exists | ||
from ._TMC_2209_logger import TMC_logger, Loglevel | ||
|
||
BOARD = "UNKNOWN" | ||
dependencies_logger = TMC_logger(Loglevel.DEBUG, "DEPENDENCIES") | ||
|
||
if not exists('/proc/device-tree/model'): | ||
from Mock import GPIO | ||
else: | ||
with open('/proc/device-tree/model', encoding="utf-8") as f: | ||
model = f.readline().lower() | ||
if "raspberry" in model: | ||
try: | ||
from RPi import GPIO | ||
BOARD = "RASPBERRY_PI" | ||
except ModuleNotFoundError as err: | ||
dependencies_logger.log( | ||
(f"ModuleNotFoundError: {err}\n" | ||
"Board is Raspberry PI but module RPi.GPIO isn`t installed.\n" | ||
"Follow the installation instructions in the link below to resolve the issue:\n" | ||
"https://sourceforge.net/p/raspberry-gpio-python/wiki/install/\n" | ||
"Exiting..."), | ||
Loglevel.ERROR) | ||
raise | ||
except ImportError as err: | ||
dependencies_logger.log( | ||
(f"ImportError: {err}\n" | ||
"Board is Raspberry PI but module RPi.GPIO isn`t installed.\n" | ||
"Follow the installation instructions in the link below to resolve the issue:\n" | ||
"https://sourceforge.net/p/raspberry-gpio-python/wiki/install/\n" | ||
"Exiting..."), | ||
Loglevel.ERROR) | ||
raise | ||
elif "nvidia jetson" in model: | ||
try: | ||
from Jetson import GPIO | ||
BOARD = "NVIDIA_JETSON" | ||
except ModuleNotFoundError as err: | ||
dependencies_logger.log( | ||
(f"ModuleNotFoundError: {err}\n" | ||
"Board is Nvidia Jetson but module jetson-gpio isn`t installed.\n" | ||
"Follow the installation instructions in the link below to resolve the issue:\n" | ||
"https://github.com/NVIDIA/jetson-gpio\n" | ||
"Exiting..."), | ||
Loglevel.ERROR) | ||
raise | ||
except ImportError as err: | ||
dependencies_logger.log( | ||
(f"ImportError: {err}\n" | ||
"Board is Nvidia Jetson but module jetson-gpio isn`t installed.\n" | ||
"Follow the installation instructions in the link below to resolve the issue:\n" | ||
"https://github.com/NVIDIA/jetson-gpio\n" | ||
"Exiting..."), | ||
Loglevel.ERROR) | ||
raise | ||
else: | ||
# just in case | ||
dependencies_logger.log( | ||
"The board is not recognized. Trying import default RPi.GPIO module...", | ||
Loglevel.INFO) | ||
BOARD = "UNKNOWN" | ||
try: | ||
from RPi import GPIO | ||
except ImportError: | ||
from Mock import GPIO |
Oops, something went wrong.