Particle Electron GSM Error!

Dev07Dev07 Member
edited February 21 in Troubleshooting


I have successfully virtualized my electron with Zerynth. I tried the “GSM HTTP” example code that is given. I have changed APN as per my SIM card, but it shows an error at the line "g350.auto_init()" as below:

Something bad happened HardwareInitializationError at line 28 of main
raised at line 38 of ublox.g350.g350.auto_init
raised at line 55 of ublox.g350.g350.init

What am I doing wrong?
I am also not able to find out the library for ublox g350 in python. Where can I find it?



  • Hi Dev07,

    thanks for joining our community.
    In the Zerynth GitHub you can find all source code of the Zerynth Supported Libraries (here, in particular, the Ublox g350 Python Library).

    Regarding your issue, the Ublox g350 GSM chip requires a high input current that often the host PC, through the USB cable, is not able to provide; you can try to connect a Li-Po battery in the related connector (or an external power supply paying attention to the input voltage range supported by the device - here more info from our documentation) and try again to run the Python script.

    Let me know if this can help you :)
    Matteo Cipriani
    Zerynth Support Team
  • Hello @Matteo Cipriani,

    I've tried using Li-Po battery but I still get the above error! All I've changed in the example code is that I've changed APN according to my SIM card provider as per below.
    # set here the APN name            gsm.attach('')
    Help me solve this.
  • I also have another question! I have to reset the Electron each time I uplink the code(and that also too quickly)!
    Is it possible that it can be auto-reset? 
  • Hi Dev07,

    Sorry for the late answer; we're working very hard to improve and complete our next release r2.1.0 that will be available in this weekend.

    I'm also working on resolving your issue; stay tuned for updates.

    Regarding the reset during the uplink procedure, yes it is, unfortunately, necessary.
    Some devices (included the Particle Electron), do not expose a way to auto-reset with a command from the local machine; so to start the Zerynth Virtual Machine, a manual reset is needed.
    Matteo Cipriani
    Zerynth Support Team
  • Hi dev07,

    Good News :smiley:
    We found the bug, we fixed it and now everything works in the right way!

    This fix will be available very soon in our next patch, but, if you need before, I can send you the blocks of code to replace.
    Matteo Cipriani
    Zerynth Support Team
  • Dev07Dev07 Member
    Hi @Matteo Cipriani,

    That would be great if you could share the code earlier.

  • edited March 2
    Hi dev07,

    I just commit new updates in the official Zerynth Github repository for Ublox-g350 library; you have to replace the g350.c and the under your Zerynth Installation:

    g350.c must be replaced under "your_home/zerynth2/dist/r2.1.0/libs/official/ublox/g350/csrc/" must be replaced under "your_home/zerynth2/dist/r2.1.0/libs/official/ublox/g350/"

    NOTE: if you are using mac or linux platform replace "zerynth2" with ".zerynth2" (hidden folder) in the path

    Here below a Python script to test your Particle Electron:

    from ublox.g350 import g350
    from wireless import gsm
    import streams
    import requests
    import json


    print("Registering to the network...")

    for i in range(20):
    # set here the APN name
    except g350Exception:
    print("Something wrong on the G350")
    except TimeoutError:
    print("Can't register to network, took too long")
    print("ooops, can't register at all!")
    while True:

    print("Signal Strength:",gsm.rssi())
    print("Link info",gsm.link_info())
    print("Network info",gsm.network_info())
    print("Device info",gsm.mobile_info())

    for i in range(3):
    print("Trying to connect...")
    response = requests.get("")
    print("Http Status:",response.status)
    except Exception as e:

    if response.status==200:
    print("Headers are:",response.headers)
    print("And the result is:",response.content)
    js = json.loads(response.content)
    except Exception as e:
    print("ooops, something very wrong! :(",e)
    except Exception as e:
    print("Something bad happened",e)

    Remember to set your APN name and to remove the pin code from your sim card.

    Let me know if this will work for you ;)

    Matteo Cipriani
    Zerynth Support Team
Sign In or Register to comment.

ZERYNTH Community

@ 2016, all rights reserved.