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:
- connected my SiPy to PyCom
- Logged into Google and configured devices
- deployed a google cloud function attached to the respective topic
- 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) passThe 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 :)
-
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?
-
This post is deleted! -
@plsecker I can confirm that messages show up in PyBytes (signals are displayed and messages are listed as data received)
-
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 insidesigfox-api-callbacks.jsonin 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-acknice.
Hope that helps anyone who stumbles upon the same errors.
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