Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more.
0

How do I populate the lat long values with fixed data in my
Moderators: adafruit_support_bill, adafruit

Forum rules
If you're posting code, please make sure your code does not include your Adafruit IO Active Key or WiFi network credentials.
Please be positive and constructive with your questions and comments.

How do I populate the lat long values with fixed data in my

by Antidote on Mon Mar 16, 2020 1:42 am

Hi,
I have some feeds for a BME260 configured and all working well via an ESP32. I plan to have numerous setup over the city and would like a map in my dashboard to show where they are..

Is it possible to send in fixed lat,long data with my feeds so that they will appear on the map block in my dashboard?
How can I populate those location columns with a fixed value?

Untitled.png
Untitled.png (35.68 KiB) Viewed 56 times


my output is created within Arduino ide using a mashup of the BME sample code and adafrui.io feeds

Code: Select all | TOGGLE FULL SIZE
void sendValues() {
    temperature->save(bme.readTemperature());
    humidity->save(bme.readHumidity());
    air_pressure->save(bme.readPressure() / 100.0F);

Antidote
 
Posts: 1
Joined: Mon Mar 16, 2020 1:28 am

Re: How do I populate the lat long values with fixed data in

by dastels on Mon Mar 16, 2020 10:26 am

Try adding lat and lon key-value pairs to the payload you send to AdafruitIO. For example (from my environmental sensor project guide: https://learn.adafruit.com/remote-iot-environmental-sensor)
Code: Select all | TOGGLE FULL SIZE
{'value' : 0, 'lat' : gps_interface.latitude, 'lon' : gps_interface.longitude, 'created_at' : ''}

dastels
 
Posts: 1904
Joined: Tue Oct 20, 2015 3:22 pm

Re: How do I populate the lat long values with fixed data in

by brubell on Tue Mar 17, 2020 10:45 am

Hi antidote,

If you're using the Adafruit IO Arduino library, you can send locational data by including the location metadata with the value you send to Adafruit IO:
Code: Select all | TOGGLE FULL SIZE
    location->save(value, lat, lon, ele);


For example: Sending the location to the temperature feed would look like:
Code: Select all | TOGGLE FULL SIZE
    temperature->save(bme.readTemperature(), lat, lon, ele);



Here's a full example:
https://github.com/adafruit/Adafruit_IO ... cation.ino

brubell
 
Posts: 792
Joined: Fri Jul 17, 2015 10:33 pm

Please be positive and constructive with your questions and comments.