Sign inSign up

2smartdev/raspberry-system-monitor

By 2smartdev

•Updated almost 5 years ago

Image
0

1.4K

2smartdev/raspberry-system-monitor repository overview

⁠Raspberry Pi Bridge for the system monitor

This is a virtual device for the 2Smart Cloud⁠ platform, it provides you system information about your device (File System, RAM, CPU, CPU temperature, Network). You could run this device on any Raspberry Pi version and connect it to your mobile account of 2Smart Cloud mobile application.

You can install the 2Smart Cloud mobile application in the App Store⁠ or Play Market⁠.

⁠Instruction to run ready-to-use virtual device

  1. Create the config.json file and insert data below:
{
    "mqttUri":"mqtt://cloud.2smart.com:1883",
    "wssUri":"wss://cloud.2smart.com/mqtt",
    "userEmail":"",
    "productId":1622652075265946,
    "token":"",
    "deviceId":"",
    "firmwareVersion":"2"
}
  1. Insert your user email into userEmail field and device access token into token field. You could get this parameters in Account settings screen in the 2Smart Cloud⁠ mobile application.
  2. Run the following command to start the device:
docker run --name raspberry-monitoring --restart always --privileged -d -v "${PWD}:/config" 2smartdev/raspberry-system-monitor

The device will appear in your mobile application in a few seconds.

⁠Instruction to create your own product based on virtual weather station

  1. Register a vendor acccount on 2Smart Cloud⁠ platform and create a product based on Raspberry Pi MCU. Look throught more about platform here https://2smart.com⁠

  2. 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").

  3. 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).

  1. Run the following command to start the device:
 docker run --name raspberry-monitoring --restart always --privileged -d -v "${PWD}:/config" 2smartdev/raspberry-system-monitor

⁠Additional configuration

A configuration file consists of the following required fields and must have the name "config.json" :

{
  "mqttUri": "",
  "userEmail": "",
  "productId": "",
  "token": "",
  "deviceId": ""
}

Fill each field according to the next descriptions:

  • mqttUri - a production or sandbox 2smart-cloud app URI
  • userEmail - an email related to your account
  • productId - a product's ID
  • token - a 2smart-cloud access token(sandbox or production), if you downloaded the production configuration file, then this field would be empty, read the "Retrieve production token" topic to get this token, then paste it here
  • deviceId - a device ID, leave it empty if your entered production MQTT URI, it will be generated automatically

⁠Retrieve production token

Open the 2Smart Cloud mobile app, go to "Settings" tab, the value of the "Device access token" is your production token

⁠Stopping and restarting the device

Run the following command to find the container id of the device:

docker ps

Find the record where "IMAGE" column equals "2smartdev/raspberry-system-monitor" and copy the value of "CONTAINER ID" column for this record

⁠Stop the device

Run the following command with the retrieved container id to stop the device:

docker stop <container id>
⁠Restart the device

Run the following command with the retrieved container id to restart the device:

docker restart <container id>

Tag summary

Content type

Image

Digest

Size

62.6 MB

Last updated

almost 5 years ago

docker pull 2smartdev/raspberry-system-monitor