Sending sensor data from Fipy to a cloud server
-
Hi everyone, I need to send some data from a fipy to a database in Mongo DB, I’m planning on using the LTE module for this and i read that you need to use usocket, have you ever worked with this? Have any of you have an example that I can look up to?
-
You could try
def http_get(url): print("get(", url, ")") _, _, host, path = url.split('/', 3) print("host", host) print("path", path) addr = socket.getaddrinfo(host, 80)[0][-1] print("addr", addr) s = socket.socket() print("connect") s.connect(addr) print("send") s.send(bytes('GET /%s HTTP/1.0\r\nHost: %s\r\n\r\n' % (path, host), 'utf8'))Note that the LTE module doesn't always play nice, to the extent that some have bypassed it for cellular comms https://forum.pycom.io/topic/6202/method-to-take-control-of-cell-modem/22
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