Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
romakarol authored Mar 26, 2019
1 parent b7c7969 commit 4393300
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions pytrackCode/sigfoxMessage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
from network import Sigfox
import socket
import ubinascii

print("SiPy test program.\n")
# init Sigfox for RCZ1 (Europe)
sigfox = Sigfox(mode=Sigfox.SIGFOX, rcz=Sigfox.RCZ1)

s = socket.socket(socket.AF_SIGFOX, socket.SOCK_RAW)

# make the socket blocking
s.setblocking(True)

# configure it as uplink only
s.setsockopt(socket.SOL_SIGFOX, socket.SO_RX, False)

# send some bytes
msg="ABCD"
print("Sending message")
print(msg)
s.send(msg)
print("sent.\n")

0 comments on commit 4393300

Please sign in to comment.