Spanish Total.js
Italiano
Documentazione Per agenti IA
Indice

Installazione

Install the Admin and Stream apps, connect them to PostgreSQL and start them.

.md Sito web

Questa pagina non è ancora tradotta. Stai leggendo l’originale.

In questa pagina
Note: Total.js IoT Platform is available only with a Total.js Enterprise subscription. See the IoT Platform page on totaljs.com.

Total.js IoT Platform runs on your own server. You receive the source code from Total.js with your Enterprise license. The package has three folders:

  • admin: the app you work in.
  • stream: the app that receives the data of your devices.
  • drivers: example drivers that you can install or use as a starting point.

Requirements

  • Node.js 18 or newer.
  • PostgreSQL 15 or newer.

Create the database

Create an empty PostgreSQL database for the platform, for example iot. Both apps use this one database. Admin creates its tables the first time it starts.

Install Admin

  1. Open a terminal in the admin folder and install the dependencies:
npm install
  1. Open the config file and set the connection to your database and the address where people will open the app:
database             : postgresql://user:password@127.0.0.1:5432/iot
url                  : https://iot.example.com
  1. Start the app:
npm start

Admin listens on port 8000. Open http://127.0.0.1:8000/ in your browser and continue with First steps.

Install Stream

  1. Open a terminal in the stream folder and install the dependencies:
npm install
  1. Open the config file and set the same database and the public address of the stream. Your devices send their data to this address.
database           : postgresql://user:password@127.0.0.1:5432/iot
url                : https://stream.example.com
  1. Open index.js and choose a port for the stream, different from the port of Admin. Remove the // in front of the options.port line and write the number:
options.port = 8001;
  1. Start the stream:
node index.js

Open http://127.0.0.1:8001/ to see the status page of the stream.

Run in production

Start each app in release mode, which is faster and does not watch the files for changes:

node index.js --release

Keep both apps running with the process manager of your server and put them behind a web server with HTTPS. Devices must be able to reach the address of the stream. Admin only needs to be reachable by the people who use it, and by anyone who reads its open data.

All settings of both apps are described in Configuration files.

Fatto in Europa