[SOLVED] Maps with http rest api

They are, I tried without, does not work

Hi @JFdB could you share your entire code, please

Dear Maha1,
here is the relevant part of my python code. Note that value0 can be changed to β€œ1” for a second marker:

 value0="0"
 value1=str(LatDeg)
 value2=str(LonDeg)
 value3=str(GPSdate)
 payload = {'value': [value0 , value1, value2, value3]}
 r=requests.get('http://blynk-cloud.com/xxx/update/V30', params=payload)

@JFdB thank you very much
but how did you get lonDeg, latDeg and GPSdate ?
are you using a GPS module ?

LatDeg and LonDef are GPS coordinates, GPSdate is the date that I get from my GPS module.
The problem that was addressed in this post is how to get a marker on the MAP in Blynk when you have GPS coordinates. The GPSdate is not necessary, but it will display a banner with the date together with the marker on the blynk map

well i took coordinate from google and made a try but unfortunaty nothing appears on the map

import BlynkLib
import requests
from urllib2 import Request, urlopen

BLYNK_AUTH = ' ********* '

# initialize Blyn
blynk = BlynkLib.Blynk(BLYNK_AUTH)
v='0'
lat="43.300000"
lon= "5.400000"
pay = {'value': [v , lat, lon]}
r=requests.get('http://blynk-cloud.com/BLYNK_AUTH /update/V6',params=pay)
blynk.run()

what am i doing wrong ?

deleted

Deleted

Deleted, see final solution below

still not working :slightly_frowning_face:

Always include code like this,

image

That’s the back tick character (under the Esc key on my keyboard).

and yup i totally agree about the quotes
cause when i copy the one u are using a Non-ASCII character β€˜\x93’ error appears

@wickedbeernut i will thanks for the information :slightly_smiling_face:

I fixed your post for you, this time.

I ran the following code on a raspberry py:


import requests
v="0"
lat= "43.300000"
lon= "5.400000"
msg = "test3"
pay = {'value': [v , lat, lon, msg]}
r=requests.get('http://blynk-cloud.com/xxx/update/V30',params=pay)

This code works for me, where xxx is the BLYNK_AUTH token.
Your problem is with the way you include the BLYNK_AUTH in the request.get call.
The first request.get() parameter is in single quotes, and the BLYNK_AUTH variable in your statement:

r=requests.get('http://blynk-cloud.com/BLYNK_AUTH /update/V6',params=pay)

is not expanded to your authorisation code. I also tested the following, which works for me (remove redundant spaces in BLYNK_AUTH!):

BLYNK_AUTH = '*********'
r=requests.get('http://blynk-cloud.com/'+BLYNK_AUTH+'/update/V30',params=pay)

Let me know if this works
PS: You live in a french city, according to my blynk map :wink:

Hi again @JFdB. Tried your suggestion and it cured the problem, i can see the position on my blunk map now.
Thank you so much for your help :smile: .