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

Make wvdial integration more robust #122

Merged
merged 16 commits into from Jan 21, 2019

Conversation

Projects
None yet
3 participants
@c-w
Copy link
Member

commented Jan 21, 2019

See #116

Previously the wvdial and usb_modeswitch configurations were generated as part of the setup script. This could lead to incorrectly configured systems, e.g. when the files were deleted or incorrectly created. With this change, the generation of the configuration files is moved into Python which gives us more control to generate the correct files at the required time.

@c-w c-w requested a review from adamsclafani Jan 21, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Jan 21, 2019

Codecov Report

Merging #122 into master will decrease coverage by 0.27%.
The diff coverage is 41.4%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #122      +/-   ##
==========================================
- Coverage   68.41%   68.13%   -0.28%     
==========================================
  Files          20       26       +6     
  Lines        1453     1494      +41     
==========================================
+ Hits          994     1018      +24     
- Misses        459      476      +17
Impacted Files Coverage Δ
opwen_email_client/webapp/views.py 45.86% <ø> (ø) ⬆️
opwen_email_client/domain/modem/e353.py 100% <100%> (ø)
opwen_email_client/domain/modem/e3131.py 100% <100%> (ø)
opwen_email_client/domain/sim/hologram.py 100% <100%> (ø)
opwen_email_client/domain/modem/e303.py 100% <100%> (ø)
opwen_email_client/webapp/config.py 100% <100%> (ø) ⬆️
opwen_email_client/webapp/forms/settings.py 42.85% <25%> (+2.04%) ⬆️
opwen_email_client/domain/sim/__init__.py 30.76% <30.76%> (ø)
opwen_email_client/webapp/actions.py 35.78% <34.69%> (+1.33%) ⬆️
opwen_email_client/domain/modem/__init__.py 38.09% <38.09%> (ø)
... and 6 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b307cf5...53fc594. Read the comment docs.

@c-w

This comment has been minimized.

Copy link
Member Author

commented Jan 21, 2019

@adamsclafani The wvdial parts of this code have been tested against a modem, but unfortunately I don't currently have access to a modem that requires usb_modeswitch. Could you please test the PR against one of your modems? Thanks in advance.

Here's the snippet that I used to verify the code against the hardware without having to set up the entire Lokole stack:

from opwen_email_client.webapp.actions import StartInternetConnection
from time import sleep

internet = StartInternetConnection('./modeswitch', './wvdial', 'Hologram_World')

print('starting connection')
with internet():
    print('connection established')
    sleep(5)  # verify that the modem's connection light is solid during these seconds
    print('connection shut down')

@c-w c-w force-pushed the wvdial branch from e66cbb0 to 10f4349 Jan 21, 2019

@c-w c-w force-pushed the wvdial branch from f73951f to b7e2e1f Jan 21, 2019

@adamsclafani

This comment has been minimized.

Copy link
Collaborator

commented Jan 21, 2019

Everything looks good! My modem doesn't need usb_modeswitch anymore.

One thing to note is that my wvdial config is different and my modem doesn't work with the default hologram wvdial config. We'll need to add a new config type for apn.konekt.io as well.

@adamsclafani

This comment has been minimized.

Copy link
Collaborator

commented Jan 21, 2019

After this is done we can add:

while not _dialer_is_connected(log.name):
     if connection.poll() is not None:
          connection.terminate()
          raise Exception(...)

This will catch wvdial errors right away as wvdial will exit when there is a wonky config

@c-w c-w merged commit f920763 into master Jan 21, 2019

3 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
pyup.io/safety-ci No dependencies with known security vulnerabilities.
Details

@c-w c-w deleted the wvdial branch Jan 21, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.