问题
How to identify the lat/long location from where the IoT button click was made
https://aws.amazon.com/iotbutton/
回答1:
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
来源:https://stackoverflow.com/questions/44915934/how-to-identify-the-lat-long-location-from-where-the-iot-button-click-was-made