Welcome to the Pycom forum Forum
    • \[\[global:header.categories\]\]
    • \[\[global:header.recent\]\]
    • \[\[global:header.tags\]\]
    • \[\[global:header.popular\]\]
    • Login

    Explore Pybytes | Official Documentation | Report a Firmware Bug/Issue | GitHub

    Using Pybytes with FiPy, NB-IoT and Vodafone Sim from GoInvent London event

    Scheduled Pinned Locked Moved FiPy
    fipynb-iotvodafonegoinventpybytes
    4 Posts 3 Posters 516 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T Offline
      thinginnovations
      last edited by

      There was mention that the sim included with the FiPy was of limited connectivity due to the way the apn has been setup and that it was possible to use it with Pybytes with some fiddling somehow. The details for this were not shared, presumably because we ran out of time and the NB-IoT service wan't 100% available at the time and in that particular location.

      I now have the FiPy NB-IoT working a lot better from where I am now and would like to be able to access data that is being sent otherwise it's not going to be useful at all. I know there are others interested in achieving this.

      Thanks

      Andrew

      1 Reply Last reply Reply Quote 0
      • H Offline
        hayesey
        last edited by hayesey

        I have got it working this evening, the code I used is here, it's basically the pybytes getting started example with a couple of lines added to tell it to use LTE. Add to pybytes as a "wifi" device and update to the latest pybytes firmware using the pycom firmware uploader. Firmware version I'm using is: 1.18.2.r6.

        # Import what is necessary to create a thread
        import _thread
        from time import sleep
        
        # Increment index used to scan each point from vector sensors_data
        def inc(index, vector):
            if index < len(vector)-1:
                return index+1
            else:
                return 0
        
        # Define your thread's behaviour, here it's a loop sending sensors data every 5 seconds
        def send_env_data():
            idx = 0
            sensors_data = [0, -0.2, -0.5, -0.7, -0.8, -0.9, -0.9, -0.9, -0.8, -0.6, -0.4, -0.2, 0, 0.3, 0.5, 0.7, 0.8, 0.9, 0.9, 0.9, 0.8, 0.6, 0.4, 0.1]
        
            while True:
                # send one element from array `sensors_data` as signal 1
                pybytes.send_signal(1, sensors_data[idx])
                idx = inc(idx, sensors_data)
                sleep(5)
        
        pybytes.set_config('lte', { "band": 20, "apn": "ep.inetd.gdsp", "reset": True})
        pybytes.set_config('network_preferences', ["lte"])
        print(pybytes.get_config)
        import pycom
        pycom.nvs_set('pybytes_debug', 1)
        # Start your thread
        _thread.start_new_thread(send_env_data, ())
        

        There's a couple of extra lines of debug which can probably be removed.

        Once uploaded, I saw the connection in the pymakr window:

        Screenshot 2019-07-21 at 21.54.11.png

        and in pybytes:

        pybytes_screenshot.png

        K 1 Reply Last reply Reply Quote 1
        • H Offline
          hayesey
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • K Offline
            KK @hayesey
            last edited by

            @hayesey I am looking for a SIM card NB-IoT enabled in the UK. Could you let me know how you get your SIM card, or where I can find one please?

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better 💗

            Register Login
            • 1 / 1
            • First post
              Last post

            Pycom on Twitter

            Pycom