0

Required feed data for map block
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Required feed data for map block

by tomber42 on Tue Jul 11, 2017 5:59 pm

how should feed data for a map block looks like?
i tryed
lat,long
example: 49.442219454,13.568584377
but this does not work

tomber42
 
Posts: 5
Joined: Sat Jul 01, 2017 9:48 am

Re: Required feed data for map block

by adafruit_support_rick on Wed Jul 12, 2017 8:20 am

This tutorial shows how to set up a location feed:
https://learn.adafruit.com/geofencing-w ... dafruit-io

adafruit_support_rick
 
Posts: 35087
Joined: Tue Mar 15, 2011 11:42 am
Location: Buffalo, NY

Re: Required feed data for map block

by tomber42 on Wed Jul 12, 2017 11:20 am

adafruit_support_rick wrote:This tutorial shows how to set up a location feed:
https://learn.adafruit.com/geofencing-w ... dafruit-io

Thank you, but unfortunately this is not python code.

As i see, i have to create a "multi column" feed with lat and long ..but how can this be done with pyton io client?

As i read in io python documentation: "You can have separate feeds for each sensor in a project, or you can use one feed to contain JSON encoded data for all of your sensors."

But how..there is no example...
Last edited by tomber42 on Wed Jul 12, 2017 11:41 am, edited 1 time in total.

tomber42
 
Posts: 5
Joined: Sat Jul 01, 2017 9:48 am

Re: Required feed data for map block

by jwcooper on Wed Jul 12, 2017 11:40 am

lat/lon is currently not fully tested/supported in the io python library. It should be supported in our other libraries.

Here is an example of sending it in our arduino compatible client library:
https://github.com/adafruit/Adafruit_IO ... on.ino#L78

If you're using mqtt, just send it as csv in the order:
value, lat, lon, elevation

jwcooper
 
Posts: 664
Joined: Tue May 01, 2012 9:08 pm

Re: Required feed data for map block

by 1cc386ea8e470a on Mon Jan 01, 2018 2:18 pm

value, lat, lon, elevation as a CSV string doesn't seem to work with the map block. I've sent it with MQTT via particle and the map does nothing. Is there a byte size limit? My Particle is sending 40 bytes of a speed, latitude, longitude, altitude but it doesn't seem to matter. With or without spaces in the CSV.

Example: 0.022000,41.038826,-83.681221,237.899994
The Adafruit IO Map block ignores that string feed.

Any help would be greatly appreciated.

1cc386ea8e470a
 
Posts: 3
Joined: Mon Jul 04, 2016 10:44 am

Re: Required feed data for map block

by abachman on Tue Jan 02, 2018 3:08 pm

Howdy 1cc...,


What MQTT topic are you using for publishing? The only one that will definitely work with data in `value,lat,lon,ele` CSV format is the `$username/feeds/$feed_key/csv` where $username is your username and $feed_key is the feed key. The "feeds" and "csv" parts are always the same. If you publish to the /json topic (`$username/feeds/$feed_key/json`) you can format your data as JSON with 'value', 'lat', 'lon', and 'ele' properties, like this:
Code: Select all | TOGGLE FULL SIZE
{
  "value":6.59338,
  "lat":36.413,
  "lon":-72.132,
  "ele":999.999
}


Another place to watch while you're publishing is your monitor page at https://io.adafruit.com/monitor. If the data is being published with location data in a format that IO recognizes, it will show up in the Live Data section with the location values set apart from the feed value. That looks like this:
Screen Shot 2018-01-02 at 2.00.52 PM.png
Screen Shot 2018-01-02 at 2.00.52 PM.png (43.96 KiB) Viewed 798 times


Also, if you are able to share the code you're using to publish data, that might help with troubleshooting.


- adam
Last edited by abachman on Tue Jan 02, 2018 3:09 pm, edited 1 time in total.
Reason: add muh name

abachman
 
Posts: 229
Joined: Mon Feb 01, 2010 12:48 pm

Re: Required feed data for map block

by 1cc386ea8e470a on Tue Jan 02, 2018 9:02 pm

abachman,
Thanks for the reply. The applicable particle code is:

Adafruit_MQTT_Publish gpscoordinates = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/asset-tracker.gps-coordinates");
and the publish code as:
if (!gpscoordinates.publish(String(t.getSpeed()) + "," + t.readLatLon() + "," + t.getAltitude())) {
which sends the string as wwww,xxxx,yyyy,zzzz

Are you saying the the gpscoordinates declaration should be?:
Adafruit_MQTT_Publish gpscoordinates = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/asset-tracker.gps-coordinates/csv");

TIA

1cc386ea8e470a
 
Posts: 3
Joined: Mon Jul 04, 2016 10:44 am

Re: Required feed data for map block

by abachman on Wed Jan 03, 2018 6:43 pm

Are you saying the the gpscoordinates declaration should be?:
Adafruit_MQTT_Publish gpscoordinates = Adafruit_MQTT_Publish(&mqtt, AIO_USERNAME "/feeds/asset-tracker.gps-coordinates/csv");


Yeah! That's it exactly. Your string building code looks good, it's the MQTT topic that needs updating.

The example code in the guide shows the same thing in the sample code:
Code: Select all | TOGGLE FULL SIZE
const char LOCATION_FEED[] PROGMEM = AIO_USERNAME "/feeds/" LOCATION_FEED_NAME "/csv";
Adafruit_MQTT_Publish location_feed = Adafruit_MQTT_Publish(&mqtt, LOCATION_FEED);


Our MQTT broker interprets publish events arriving at `$username/feeds/$feed_key` as being either JSON or plain text.


- adam

abachman
 
Posts: 229
Joined: Mon Feb 01, 2010 12:48 pm

Re: Required feed data for map block

by 1cc386ea8e470a on Thu Jan 04, 2018 5:32 pm

I must have missed that documentation. Oops

Thank you fine Sir!

1cc386ea8e470a
 
Posts: 3
Joined: Mon Jul 04, 2016 10:44 am

Please be positive and constructive with your questions and comments.