Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
Expand All @@ -32,7 +32,7 @@ jobs:
run: |
python -m build
- name: Upload dist files
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: dist-files
path: dist/
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: dist-files
path: dist/
Expand All @@ -61,7 +61,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Download dist files
uses: actions/download-artifact@v2
uses: actions/download-artifact@v4
with:
name: dist-files
path: dist/
Expand Down
26 changes: 16 additions & 10 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
python-gsmmodem-new
===================
*GSM modem module for Python*
python-gsmmodem-2025
====================
*GSM modem module for Python forked in 2025*

python-gsmmodem is a module that allows easy control of a GSM modem attached
to the system. It also includes a couple of useful commandline utilities for
Expand Down Expand Up @@ -28,6 +28,12 @@ Bundled utilities:
- **identify-modem.py**: simple utility to identify attached modem. Can also be
used to provide debug information used for development of python-gsmmodem.

How is this different than https://github.com/babca/python-gsmmodem?
--------------------------------------------------------------------
It seems the `python-gsmmodem-new` repository is not maintained anymore.
This fork is a copy of the last commit from the original repository, with some modifications.
Specifically, I started this to handle SIM800 modem, which require xonxoff flow control to work properly.

How to use this package
-----------------------

Expand All @@ -44,32 +50,32 @@ Requirements
How to install this package
---------------------------

There are multiple ways to install ``python-gsmmodem-new`` package:
There are multiple ways to install ``python-gsmmodem-2025`` package:

Automatic installation of the latest "stable" release from PyPI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

::

pip install python-gsmmodem-new
pip install python-gsmmodem-2025

`pip <http://www.pip-installer.org>`_ will automatically download and install
all dependencies, as required. You can also utilise ``easy_install`` in the
same manner as using ``pip`` above.

If you are utilising ``python-gsmmodem-new`` as part of another project,
If you are utilising ``python-gsmmodem-2025`` as part of another project,
add it to your ``install_requires`` section of your ``setup.py`` file and
upon your project's installation, it will be pulled in automatically.

Manual installation of the latest "stable" release from PyPI
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Download a ``python-gsmmodem-new`` archive from `PyPI
<https://pypi.python.org/pypi/python-gsmmodem-new>`_, extract it and install the package with command::
Download a ``python-gsmmodem-2025`` archive from `PyPI
<https://pypi.python.org/pypi/python-gsmmodem-2025>`_, extract it and install the package with command::

python setup.py install

Note that ``python-gsmmodem-new`` package relies on ``pySerial`` for serial communications:
Note that ``python-gsmmodem-2025`` package relies on ``pySerial`` for serial communications:
https://github.com/pyserial/pyserial

Installation of the latest commit from GitHub
Expand All @@ -81,7 +87,7 @@ Clone from GitHub::
cd python-gsmmodem/
python setup.py install

Note that ``python-gsmmodem-new`` package relies on ``pySerial`` for serial communications:
Note that ``python-gsmmodem-2025`` package relies on ``pySerial`` for serial communications:
https://github.com/pyserial/pyserial

Testing the package
Expand Down
9 changes: 7 additions & 2 deletions gsmmodem/serial_comms.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,8 @@ class SerialComms(object):
# Default timeout for serial port reads (in seconds)
timeout = 1

def __init__(self, port, baudrate=115200, notifyCallbackFunc=None, fatalErrorCallbackFunc=None, *args, **kwargs):
def __init__(self, port, baudrate=115200, notifyCallbackFunc=None, fatalErrorCallbackFunc=None,
xonxoff=False, dsrdtr=True, rtscts=True, *args, **kwargs):
""" Constructor

:param fatalErrorCallbackFunc: function to call if a fatal error occurs in the serial device reading thread
Expand All @@ -32,6 +33,10 @@ def __init__(self, port, baudrate=115200, notifyCallbackFunc=None, fatalErrorCal
self.port = port
self.baudrate = baudrate

self.xonxoff = xonxoff
self.dsrdtr = dsrdtr
self.rtscts = rtscts

self._responseEvent = None # threading.Event()
self._expectResponseTermSeq = None # expected response terminator sequence
self._response = None # Buffer containing response to a written command
Expand All @@ -47,7 +52,7 @@ def __init__(self, port, baudrate=115200, notifyCallbackFunc=None, fatalErrorCal

def connect(self):
""" Connects to the device and starts the read thread """
self.serial = serial.Serial(dsrdtr=True, rtscts=True, port=self.port, baudrate=self.baudrate,
self.serial = serial.Serial(xonxoff=self.xonxoff, dsrdtr=self.dsrdtr, rtscts=self.rtscts, port=self.port, baudrate=self.baudrate,
timeout=self.timeout,*self.com_args,**self.com_kwargs)
# Start read thread
self.alive = True
Expand Down
4 changes: 2 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[metadata]
name = python-gsmmodem-new
name = python-gsmmodem-2025
description = Control an attached GSM modem: send/receive SMS messages, handle calls, etc
license = LGPLv3+
author = Francois Aucamp
author_email = [email protected]
url = https://github.com/babca/python-gsmmodem
url = https://github.com/jaydenpung/python-gsmmodem
long_description = file: README.rst
long_description_content_type = text/x-rst
classifiers =
Expand Down