Hi is there a way to use the map plugin so my devices can send me their gps position using the http rest api? I’ve tried a few things but can’t get it working. The blynk example page has no details on maps
By http rest api i mean
request = “http://blynk-cloud.com/” + str(token) +"/update/" + str(pin) + “?value=” + str(value)
The Map Widget just takes the provided coordinates and displays them on the Map App… how you get those coordinates into your sketch is up to you. Many methods could be used, including precoded, GPS module, or feeding that data via outside sources.
Thanks for the reply. Yeah I see how to do it with their library, my question is how to do it with the rest api. How would I format the url to send the data to their server
more in depth example of my code which doesn’t work:
pin = “V11”
value = str(“11,1,40.754129,-88.6964227,test”)
request = “http://blynk-cloud.com/” + str(token) +"/update/" + str(pin) + “?value=” + str(value)
callURL(request)
def callURL(getStr):
… proxy/headers stuff here
req = urllib2.Request(getStr, None, headers)
html = urllib2.urlopen(req).read()
right. i know that will display properly in a terminal. My question is how to get it to show correctly in the map widget, so whatever position is sent in shows up in the map.
“Do you know the syntax for the Map widget?” No I don’t that’s the question, how do i format the data using the http rest api to get data to show up in the map widget.
“Do you know how to manipulate the String received in Terminal or other widget?” I can manipulate the data going to blynk in whatever way is neccessary. So yes.
yeah i’d encourage you to do so. Really i just want a scatter plot. I was planning to go through the trouble of doing a Cartesian -> lat/long converter, but since the map didn’t work i guess i can’t