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

    SiPy socket message not showing up in Google IoT

    Scheduled Pinned Locked Moved Support & Troubleshooting
    5 Posts 2 Posters 35 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.
    • C Offline
      cookie
      last edited by

      Hello pycom community,

      I'm currently trying to setup my SiPy to send messages to a google cloud function. For that I have successfully done:

      1. connected my SiPy to PyCom
      2. Logged into Google and configured devices
      3. deployed a google cloud function attached to the respective topic
      4. send a test message (over pycom website) and received it (throug checking the logs in google)

      however if I am sending a message with the provided sample code:

      def send_message(msg):
          sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1)
          s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)
          s.setblocking(True)
          s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)
          s.send(msg)
          pass
      

      The message does not show up in the google cloud logs
      However I can confirm that the message has been received by sigfox through a seperate callback sending an email to my inbox with the payload.

      I was able to send a message using the pybytes signal api and spot it in the google logs, however that limits my payload size drastically. (and I really need those 12 bytes for my use case)

      Is there any way how I can setup everything using pycom or do I have to configure a http callback and go that direction?

      Thanks for your attention :)

      1 Reply Last reply Reply Quote 0
      • P Offline
        plsecker
        last edited by

        Can you confirm you got further than I did: https://forum.pycom.io/topic/5840/sigfox-callback-failing-to-send-to-pybytes ie. you can get Sigfox to forward to Pybytes?

        C 1 Reply Last reply Reply Quote 0
        • C Offline
          cookie
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • C Offline
            cookie @plsecker
            last edited by

            @plsecker I can confirm that messages show up in PyBytes (signals are displayed and messages are listed as data received)

            1 Reply Last reply Reply Quote 0
            • C Offline
              cookie
              last edited by

              Ok my assumption is, that the cloud integration is only usable for the signals, because it is mentioned, that it is used 'to persist data for more than 4 months'.
              However I had success with following this tutorial:

              https://cloud.google.com/community/tutorials/sigfox-gw

              with two tweaks:

              I needed to comment out line #210 of the sigfox-api.py (in the github repo provided by the tutorial) # send_duplicate=d['sendDuplicate'],
              and I needed to adjust one of the message bodies inside sigfox-api-callbacks.json in line #39: "bodyTemplate": "{\r\n\"device\" : \"{device}\",\r\n\"time\" : \"{time}\",\r\n\"temp\" : \"{temp}\",\r\n\"batt\" : \"{batt}\",\r\n\"seqNumber\" : \"{seqNumber}\",\r\n\"lat\" : \"{lat}\",\r\n\"lng\" : \"{lng}\"}"

              with that I was able to see my message with gcloud pubsub subscriptions pull sigfox-data-sub --limit 100 --auto-ack

              nice.
              Hope that helps anyone who stumbles upon the same errors.

              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