This is a virtual weather station that receives information from the OpenWeatherMap API and allows you to view weather conditions for a specific city in the 2Smart Cloud mobile application.
You can install the 2Smart Cloud mobile application in the App Store or Play Market.
config.json file and insert data below:{
"mqttUri":"mqtt://cloud.2smart.com:1883",
"wssUri":"wss://cloud.2smart.com/mqtt",
"userEmail":"",
"productId":1635274929545301,
"token":"",
"deviceId":"",
"firmwareVersion":"1"
}
userEmail field and device access token into token field. You could get this parameters in Account settings screen in the 2Smart Cloud mobile application.docker run --name weather-station --restart always -d -v "${PWD}:/config" 2smartdev/openweathermap:cloud
The device will appear in your mobile application in a few seconds.
In the current example, the device will started with the default OpenWeatherMap AppId. If you want to change it, please read the "Additional configuration" topic.
A configuration file consists of the following required fields and must have the name config.json :
{
"mqttUri": "",
"userEmail": "",
"productId": "",
"token": "",
"deviceId": "",
"openWeatherMap": {
"appId": ""
}
}
Fill each field according to the next descriptions:
Optional: if you want to specify OpenWeatherMap App ID manually, add the following fields to your config file
After filling the configuration file, run the following command in the same directory to start the device:
docker run --name weather-station --restart always -d -v "${PWD}:/config" 2smartdev/openweathermap:cloud
Register a vendor acccount on 2Smart Cloud platform and create a product based on Virtual MCU. Look throught more about platform here https://2smart.com
Download the device connection data from your product's hub or wizard in the 2Smart Cloud vendor interface. To do this in the “Connection info” modal window choose the Configuration file and download it for the target environment("production" or "sandbox").
Open the directory with this file in the terminal. If you downloaded the "production" configuration file then the "token" field would be empty, read the "Retrieve production token" topic to get this token and paste its value.
(Important: if you downloaded both "production" and "sandbox" configuration files, then they must be located in different directories because they have the same name).
Run the following command to start the device:
docker run --restart always -d -v "${PWD}:/config" 2smartdev/openweathermap:cloud

Run the following command to find the container id of the device:
docker ps
Find the record where "IMAGE" column equals "2smartdev/openweathermap:cloud" and copy the value of "CONTAINER ID" column for this record
Run the following command with the retrieved container id to stop the device:
docker stop <container id>
Run the following command with the retrieved container id to restart the device:
docker restart <container id>
Content type
Image
Digest
Size
56.1 MB
Last updated
almost 5 years ago
docker pull 2smartdev/openweathermap