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

Python3 #3

Open
eried opened this issue Oct 20, 2020 · 4 comments
Open

Python3 #3

eried opened this issue Oct 20, 2020 · 4 comments

Comments

@eried
Copy link

eried commented Oct 20, 2020

Hola!

Genial encontrar este codigo, estaba tratando hacer algo similar para un modem huawei. Hay planes para actualizarlo a python3? O usan alguna alternativa?

>>> %Run test.py
Traceback (most recent call last):
  File "/home/pi/Desktop/test.py", line 24, in <module>
    from gsmmodem_manager import HuaweiE3372
  File "/home/pi/.local/lib/python3.7/site-packages/gsmmodem_manager/__init__.py", line 9, in <module>
    from lib import signal_quality, GSMModem, HuaweiModem, HuaweiMS2131, HuaweiMS2372h, HuaweiE3372
ModuleNotFoundError: No module named 'lib'
@fontanon
Copy link
Contributor

Hi. Really thank you @eried .

I'm afraid we do not have any plans to update to python3 soon. We're using the python2.7 library as part of a couple of production projects, and it is running smooth on our raspberry pi zero units.

If you manage to do so, please PR back to us because this can be great contribution :)

Regards!

@eried
Copy link
Author

eried commented Oct 20, 2020

Oh cool, it runs on python2.7 :) on a clone E3372, maybe that old version is good enough :D (porting is not my forte so it would mean a lot of hours googling)

small question: when you do the set operator, if you have a global sim (like hologram.io) can that operator be set automatically?

thanks

@fontanon
Copy link
Contributor

Yep @eried runs on python2.7 very well.

We use the set operator because PodGroup global SIMs are multi-network SIMs (global SIMs): https://www.podgroup.com/products/iot-connectivity/multi-network-iot-sim-cards/

Please refer to your usb dongle AT commands manual to find the "automatic network selection mode". Usually is AT+COPS=0. Perhaps you could add a new method on the library ... something line set_automatic_network_selection that promots the AT+COPS=0 instead of AT+COPS=1,2,{PLMN}.

    def set_automatic_network_selection(self, plmn, sleeptime=2):
        command = 'AT+COPS=0'
        response = self._send_command(command, sleeptime)

        if len(response) and response[0] == 'OK': 
            return True, command, None
        elif response is None or response == []:
            return True, command, None
        else:
            self._logger.error('Set operator failed with: ' + str(response))
            return False, command, response

Would you please fork, add method, test and let us know if that worked for your purposes? PR are welcomed 😄

@eried
Copy link
Author

eried commented Oct 20, 2020

Oh yes, I will try to add stuff. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants