如何识别单击IoT按钮的经纬度位置 [英] How to identify the lat/long location from where the IoT button click was made

查看:54
本文介绍了如何识别单击IoT按钮的经纬度位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何识别单击IoT按钮的经纬度

https://aws.amazon.com/iotbutton/

解决方案

您可以执行从IP地址到位置的查找.即 http://ip-api.com/json/208.80.152.201

不幸的是,IoT按钮的点击仅提供3个事件参数:

 clickType: event.clickType, // (string) the type of press; can be "SINGLE", "DOUBLE" or "LONG"
 serialNumber: event.serialNumber, // (string) device's serial number, from the back of the button.
 batteryVoltage: event.batteryVoltage // (string) device's voltage level in millivolts. e.g. "1567mV"

如果您设置IoT按钮涉及将其放置在wifi网络上并使其静止不动,则是时候将序列号手动映射到纬度/经度了.然后从序列号到经/纬度进行查找.

[1] https://docs. aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html

[2] https://www. losant.com/blog/getting-started-with-aws-iot-button-losant

How to identify the lat/long location from where the IoT button click was made

https://aws.amazon.com/iotbutton/

解决方案

There are lookups you can do from IP Address to location. i.e http://ip-api.com/json/208.80.152.201

Unfortunately for you, IoT Button clicks only give 3 event parameters:

 clickType: event.clickType, // (string) the type of press; can be "SINGLE", "DOUBLE" or "LONG"
 serialNumber: event.serialNumber, // (string) device's serial number, from the back of the button.
 batteryVoltage: event.batteryVoltage // (string) device's voltage level in millivolts. e.g. "1567mV"

If your set up of an IoT button involves putting it on a wifi network, and having it be stationary, that is the time to manually map the serial number to a latitude/longitude. Then do a look-up from serial number to lat/long.

[1] https://docs.aws.amazon.com/iot/latest/developerguide/iot-lambda-rule.html

[2] https://www.losant.com/blog/getting-started-with-aws-iot-button-losant

这篇关于如何识别单击IoT按钮的经纬度位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆