Sigfox to Cayenne

I send temperature and humidity from DHT11 to Sigfox.
Node Red will download the data from Sigfox Backend and send it via MQTT to Cayenne.

You need it:

  • Arduino Mega (or Arduino UNO and SoftwareSerial for modem)
  • Sigfox modem Wisol SFM10R1
  • DHT11 Temperature and Humidity sensor
  • Level shifter
  • Raspberry Pi with Node Red

Arduino Code

Cayenne-Sigfox-DHT11.txt (1.5 KB)

When you enter 1 to the serial monitor, send the data to Sigfox Backend.

Node red flows

[{"id":"2ee8bab9.a6b926","type":"http request","z":"13eb0657.a1aa1a","name":"","method":"GET","ret":"obj","url":"https://APIlogin:APIpassword@backend.sigfox.com/api/devices/DeviceID/messages?limit=1","tls":"","x":282.2221984863281,"y":311.111083984375,"wires":[["94d91df6.f903b"]]},{"id":"ca6dcf82.86521","type":"inject","z":"13eb0657.a1aa1a","name":"","topic":"","payload":"1","payloadType":"str","repeat":"2","crontab":"","once":false,"x":202.55557250976562,"y":404.66662979125977,"wires":[["2ee8bab9.a6b926"]]},{"id":"94d91df6.f903b","type":"function","z":"13eb0657.a1aa1a","name":"Get data","func":"msg.payload = msg.payload.data[0].data;\nreturn msg;","outputs":1,"noerr":0,"x":439.6666564941406,"y":310.99996185302734,"wires":[["5e62006e.2ebd9","dac1c829.491a18"]]},{"id":"dac1c829.491a18","type":"function","z":"13eb0657.a1aa1a","name":"Temperature","func":"i = msg.payload.slice(0, 4);\na = i.slice(0, 2);\nb = i.slice(2, 4);\nc = b + a\nd = parseInt(c, 16) / 100;\nmsg.payload = d.toString();\nreturn msg;\n","outputs":"1","noerr":0,"x":602.9999389648438,"y":312.3333215713501,"wires":[["d1e922d5.e738","97f26c37.6da58"]]},{"id":"5e62006e.2ebd9","type":"function","z":"13eb0657.a1aa1a","name":"Humidity","func":"i = msg.payload.slice(4, 8);\na = i.slice(0, 2);\nb = i.slice(2, 4);\nc = b + a\nd = parseInt(c, 16);\nmsg.payload = d.toString();\nreturn msg;","outputs":1,"noerr":0,"x":613.8888092041016,"y":366.3333320617676,"wires":[["d1e922d5.e738","a3c2b6b2.3565d8"]]},{"id":"d1e922d5.e738","type":"debug","z":"13eb0657.a1aa1a","name":"","active":false,"console":"false","complete":"false","x":842.0000152587891,"y":267.6666450500488,"wires":[]},{"id":"97f26c37.6da58","type":"mqtt out","z":"13eb0657.a1aa1a","name":"","topic":"v1/MQTTusername/things/ClientID/data/1","qos":"0","retain":"","broker":"","x":922.4443969726562,"y":310.4444236755371,"wires":[]},{"id":"a3c2b6b2.3565d8","type":"mqtt out","z":"13eb0657.a1aa1a","name":"","topic":"v1/MQTTusername/things/ClientID/data/2","qos":"0","retain":"","broker":"","x":925.1109924316406,"y":366.4443588256836,"wires":[]},{"id":"53036e03.74a74","type":"comment","z":"13eb0657.a1aa1a","name":"Setup - http request","info":"You must enter your own:\n\n-API login\n-API password\n-Device ID","x":251.11111450195312,"y":264.4444465637207,"wires":[]}]

Setting MQTT data from Node Red to Cayenne - @adam has the perfect tutorial.

http://community.mydevices.com/t/using-node-red-as-a-local-fallback-server/1623

Hackster io

https://www.hackster.io/TAD2000/sigfox-to-cayenne-80b15a

1 Like

I probably should update that a bit to include the Cayenne MQTT libraries instead of generic ones, but thanks for the link.

1 Like

Thanks for sharing @tad.dvor ! I think this is first Sigfox project I’ve seen posted :slight_smile:

And, yeah good point @adam, whenever you have some free time.

~Benny

1 Like

how about news for this update ? we are some people wanting to import sigfox data directly into cayenne without intermediaries (like node red)?