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

    Best Practices for Push Notifications to gpy

    Scheduled Pinned Locked Moved GPy
    3 Posts 2 Posters 41 Views 2 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.
    • P Offline
      Patton Doyle
      last edited by Patton Doyle

      Hi all,

      Just getting started with the pycom platform, and I've quite enjoyed it so far. I'm deploying a small network of gpy boards on the Verizon network and will need the boards to send and receive real-time updates from the web. The key considerations are:
      a) the speed of the updates (preferably < 1 second), and
      b) the reliability of the updates.

      I'm not too worried about sending updates from the board (there are many good solutions; we'll probably use a Restful API), but I'm a bit concerned about receiving updates. Is there a best practice for this kind of situation?

      The three ideas that came to mind:

      • Send text messages to the board. This works well on the gpy end, but can introduce lag on the server end (e.g. sending emails to phonenumber@vtext.com can take up to a minute). I could physically attach a pycom to the server to send text messages and improve the server end, but that seems silly. Edit: I also just noticed that Verizon has a 100 SMS limit on all their Cat M1 plans, so this seems like a bad approach.
      • Run a very small server on the pycom (I assume this is possible) and perform calls to the device IP address directly. I've done something similar in the past, but I'm not sure how often Verizon cycles IP addresses, so it could prove unreliable.
      • Have the pycom use websockets or a long-running http call to get realtime updates. This also seems plausible, but I haven't tried it.

      Any experience with these approaches/other suggestions? Thanks!
      Patton

      J 1 Reply Last reply Reply Quote 0
      • J Offline
        jcaron @Patton Doyle
        last edited by

        @Patton-Doyle if you don’t have battery life constraints I would go for websockets, or any form of device-initiated TCP connnection. Haven’t tried it on a Pycom device but it should be pretty straightforward.

        If you do it yourself rather than using an existing library don’t forget keep alive pings and connection re-establishment, of course.

        1 Reply Last reply Reply Quote 3
        • P Offline
          Patton Doyle
          last edited by

          Thanks! Appreciate the recommendation.

          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