SiPy socket message not showing up in Google IoT

  • 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.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)

    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 :)

  • 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:

    with two tweaks:

    I needed to comment out line #210 of the (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

    Hope that helps anyone who stumbles upon the same errors.

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

  • This post is deleted!

  • Can you confirm you got further than I did: ie. you can get Sigfox to forward to Pybytes?

Log in to reply

Pycom on Twitter