【发布时间】:2018-03-09 06:41:48
【问题描述】:
如何识别点击 IoT 按钮的纬度/经度位置
【问题讨论】:
如何识别点击 IoT 按钮的纬度/经度位置
【问题讨论】:
您可以从 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
【讨论】: