Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disconnecting from a PPP session that was started in a different script fails #30

Closed
DomAmato opened this issue Apr 21, 2020 · 0 comments · Fixed by #32
Closed

Disconnecting from a PPP session that was started in a different script fails #30

DomAmato opened this issue Apr 21, 2020 · 0 comments · Fixed by #32
Labels
bug for issues

Comments

@DomAmato
Copy link
Contributor

Describe the problem

A script tries to disconnect when a PPP session was started and not closed in a separate script. It fails to tear down that PPP session

2020-04-21 20:33:43,414 [INFO] Hologram.Network.Network (2670): Disconnecting from cell network
2020-04-21 20:33:43,415 [INFO] Hologram.Network.Network (2670): Failed to disconnect from cell network
2020-04-21 20:33:43,416 [INFO] Hologram.Network.Network (2670): Connecting to cell network with timeout of 200 seconds
2020-04-21 20:33:43,514 [INFO] Hologram.Network.Modem.ModemMode.ModemMode (2670): Checking for existing PPP sessions
2020-04-21 20:33:43,565 [INFO] Hologram.Network.Modem.ModemMode.ModemMode (2670): Found existing PPP session on pid: 2604
Traceback (most recent call last):
  File "/usr/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/usr/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/pi/ftp/hologram/__main__.py", line 32, in <module>
    pinger.run()
  File "/home/pi/ftp/hologram/pinger.py", line 51, in run
    self.hologram.network.connect()
  File "/usr/local/lib/python3.7/dist-packages/Hologram/Network/Cellular.py", line 67, in connect
    success = self.modem.connect(timeout = timeout)
  File "/usr/local/lib/python3.7/dist-packages/Hologram/Network/Modem/Nova_U201.py", line 36, in connect
    success = super().connect(timeout)
  File "/usr/local/lib/python3.7/dist-packages/Hologram/Network/Modem/Modem.py", line 97, in connect
    return self._mode.connect(timeout = timeout)
  File "/usr/local/lib/python3.7/dist-packages/Hologram/Network/Modem/ModemMode/PPP.py", line 43, in connect
    self.__enforce_no_existing_ppp_session()
  File "/usr/local/lib/python3.7/dist-packages/Hologram/Network/Modem/ModemMode/PPP.py", line 72, in __enforce_no_existing_ppp_session
    % pid_list)
Exceptions.HologramError.PPPError: Existing PPP session(s) are established by pid(s) [2604]. Please close/kill these processes first

Expected behavior

Calling disconnect should stop other PPP sessions that are open regardless of what script started them.

Actual behavior

It fails to disconnect

Steps to reproduce the behavior

have 2 python scripts, one that starts a PPP session and another the disconnects. Run 1 than the other. It should fail

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Raspbian Buster
  • Python SDK installed via PyPI or GitHub: Develop branch
  • SDK version (use command below):
  • Python version: 3.7.3
  • Hardware (modem) model: Pi 3 model b
@DomAmato DomAmato added the bug for issues label Apr 21, 2020
DomAmato added a commit that referenced this issue Apr 23, 2020
DomAmato added a commit that referenced this issue Apr 30, 2021
* Add Github Actions

* Update issue templates

use comments to hide extra details when preparing a report

* wait for the process to be terminated (#17)

* Properly handle when parsing other types of SMS PDUs (#16)

* Add chunking for messeages over 512 bytes (#15)

* Update test_Modem.py

* check python and pip versions (#19)

* simplify version check

* check python and pip version for update too

* call super.disconnect instead of connect (ensures event network.disconnected broadcast) (#22)

* remove extraneous parenthesis (#24)

* include token

* remove extraneous parenthesis (#26)

* remove travis and rename actions

* use pytest instead of coverage

* only test on 3.7 for now

* Allow sending raw AT commands to the modem (#28)

* Fix PPP Errors with disconnect and routing (#32)

Fix #30 and #31

* Concat to bytes not str (#33)

* properly convert bytestring ascii value

* convert from ascii int value to int

* make it possible to renable at sockets (#36)

* include support for Huawei Modem E372 (#21)

* include support for Huawei Modem E372 and actually works with Ubuntu and Raspbian10

* add support in class for E372 modem

Co-authored-by: Hector Mendez <hector.mendez@nimanic.com>

* Add BG96 Support (#37)

* add bg96 to modems

* update description and enable at sockets

* Update BG96.py

* check if active

* send the right permutation

* decode and use command

* wait for socket to open and handle other actions

* better urc handling

* more logging

* handle attribute errors too

* handle urc types better

* better socket state handling

* bg96 is send ok not ok

* log more info

* use set instead of command

* add send ok as possible results

* handle send ok in process response

* close properly and update read_socket

* handle recv response from urc

* fix missing imports

* clean up logging a bit

* remove another logging instance

* fix merge conflict

* fix copy pasta

* try adding config on develop

* add some more github actions (#41)

* add dependency label to config

* Dont encode buffer (#39)

* add more info to release

* Bump actions/setup-python from v1 to v2.0.2 (#51)

Bumps [actions/setup-python](https://github.com/actions/setup-python) from v1 to v2.0.2.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v1...7a69c2b)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update psutil requirement from ~=5.6.3 to ~=5.7.2 (#50)

Updates the requirements on [psutil](https://github.com/giampaolo/psutil) to permit the latest version.
- [Release notes](https://github.com/giampaolo/psutil/releases)
- [Changelog](https://github.com/giampaolo/psutil/blob/master/HISTORY.rst)
- [Commits](giampaolo/psutil@release-5.6.3...release-5.7.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update hjson requirement from ~=3.0.0 to ~=3.0.1 (#48)

Updates the requirements on [hjson](https://github.com/hjson/hjson-py) to permit the latest version.
- [Release notes](https://github.com/hjson/hjson-py/releases)
- [Changelog](https://github.com/hjson/hjson-py/blob/master/history.md)
- [Commits](hjson/hjson-py@v3.0.0...v3.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pyudev requirement from ~=0.21.0 to ~=0.22.0 (#45)

Updates the requirements on [pyudev](https://github.com/pyudev/pyudev) to permit the latest version.
- [Release notes](https://github.com/pyudev/pyudev/releases)
- [Changelog](https://github.com/pyudev/pyudev/blob/develop-0.22/CHANGES.rst)
- [Commits](pyudev/pyudev@v0.21.0...v0.22)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update requests requirement from ~=2.22.0 to ~=2.24.0 (#44)

Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](psf/requests@v2.22.0...v2.24.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* add section for dependencies

* fix broken python actions

* Update psutil requirement from ~=5.7.2 to ~=5.8.0 (#70)

Updates the requirements on [psutil](https://github.com/giampaolo/psutil) to permit the latest version.
- [Release notes](https://github.com/giampaolo/psutil/releases)
- [Changelog](https://github.com/giampaolo/psutil/blob/master/HISTORY.rst)
- [Commits](giampaolo/psutil@release-5.7.2...release-5.8.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pyusb requirement from ~=1.0.2 to ~=1.1.0 (#59)

Updates the requirements on [pyusb](https://github.com/pyusb/pyusb) to permit the latest version.
- [Release notes](https://github.com/pyusb/pyusb/releases)
- [Commits](pyusb/pyusb@v1.0.2...v1.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update requests requirement from ~=2.24.0 to ~=2.25.1 (#67)

Updates the requirements on [requests](https://github.com/psf/requests) to permit the latest version.
- [Release notes](https://github.com/psf/requests/releases)
- [Changelog](https://github.com/psf/requests/blob/master/HISTORY.md)
- [Commits](psf/requests@v2.24.0...v2.25.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Update pyserial requirement from ~=3.4.0 to ~=3.5 (#72)

Updates the requirements on [pyserial](https://github.com/pyserial/pyserial) to permit the latest version.
- [Release notes](https://github.com/pyserial/pyserial/releases)
- [Changelog](https://github.com/pyserial/pyserial/blob/master/CHANGES.rst)
- [Commits](pyserial/pyserial@v3.4...v3.5)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* Strip AT command result prefix when issued command ends with ? or % (#6)

* Strip AT command result prefix when issued command ends with ? or %

* Simplify strip of characters from AT command result

* Fix type for BG96 (#77)

* allow setting APN (#79)

* properly handle bytes when reading from an open socket (#74)

* Update pyusb requirement from ~=1.1.0 to ~=1.1.1 (#75)

Updates the requirements on [pyusb](https://github.com/pyusb/pyusb) to permit the latest version.
- [Release notes](https://github.com/pyusb/pyusb/releases)
- [Commits](pyusb/pyusb@v1.1.0...v1.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

Co-authored-by: akumlehn <andreas@kumlehn.de>
Co-authored-by: Héctor <hector.a.mendez.l@gmail.com>
Co-authored-by: Hector Mendez <hector.mendez@nimanic.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Tom Pethtel <TomPethtel@gmail.com>
Co-authored-by: Reuben Balik <rbalik@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug for issues
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant