Back to Docs

Device Installation Guide

Complete guide for installing and configuring LXPCloud devices on various hardware platforms.

Overview

This guide will help you install and configure LXPCloud devices on different hardware platforms. After creating a machine/device in your LXPCloud dashboard and obtaining your API key, follow the appropriate installation guide below.

Important: Make sure you have already created your device in the LXPCloud dashboard and have your API key ready before starting the installation.

API Key Configuration

Your API key is essential for device authentication. It should be stored securely and never shared publicly.

API Key Format: lxp_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Store your API key in a secure location and reference it in your device configuration files.

Raspberry Pi 4/5 Installation

Hardware Requirements:

  • Raspberry Pi 4 (2GB RAM minimum) or Raspberry Pi 5
  • MicroSD card (16GB minimum, Class 10 recommended)
  • Power supply (5V/3A for Pi 4, 5V/5A for Pi 5)
  • Ethernet cable or WiFi connection
  • Optional: Case and cooling solution

Installation Steps:

1 Prepare Raspberry Pi OS

Download and flash Raspberry Pi OS Lite to your microSD card using Raspberry Pi Imager.

2 Enable SSH and Configure Network

Create an empty file named ssh in the boot partition and configure WiFi if needed.

3 Boot and Connect

Insert the microSD card, power on the Pi, and connect via SSH:

ssh pi@raspberrypi.local
4 Update System
sudo apt update && sudo apt upgrade -y
5 Install Python and Dependencies
sudo apt install python3 python3-pip python3-venv git -y
6 Clone LXPCloud Device Agent
git clone https://github.com/lexpai/lxpcloud-device-agent.git cd lxpcloud-device-agent
7 Configure API Key

Edit the configuration file:

nano config.py

Add your API key and device settings:

API_KEY = "lxp_your_api_key_here" DEVICE_ID = "your_device_id" SERVER_URL = "https://api.lexpai.com"
8 Install Python Dependencies
pip3 install -r requirements.txt
9 Test Connection
python3 test_connection.py
10 Setup as Service
sudo cp lxpcloud-agent.service /etc/systemd/system/ sudo systemctl enable lxpcloud-agent sudo systemctl start lxpcloud-agent
Success! Your Raspberry Pi is now connected to LXPCloud and will start sending data automatically.

Raspberry Pi Pico Installation

Hardware Requirements:

  • Raspberry Pi Pico or Pico W
  • Micro USB cable
  • WiFi network (for Pico W)
  • Optional: Breadboard and jumper wires for sensors

Installation Steps:

1 Download MicroPython

Download the latest MicroPython firmware for Pico from the official website.

2 Flash MicroPython

Hold BOOTSEL button while connecting Pico to computer, then flash the firmware.

3 Install Thonny IDE

Download and install Thonny IDE for Python development.

4 Connect to Pico

Open Thonny and select MicroPython (Raspberry Pi Pico) as interpreter.

5 Upload LXPCloud Library

Download and upload the LXPCloud MicroPython library to your Pico.

6 Configure WiFi (Pico W)
# main.py import network import time wlan = network.WLAN(network.STA_IF) wlan.active(True) wlan.connect('YOUR_WIFI_SSID', 'YOUR_WIFI_PASSWORD') while not wlan.isconnected(): time.sleep(1)
7 Configure LXPCloud Connection
from lxpcloud import LXPCloud # Initialize LXPCloud client lxp = LXPCloud( api_key="lxp_your_api_key_here", device_id="your_device_id", server_url="https://api.lexpai.com" )
8 Setup Data Collection
import machine import time # Example: Read analog sensor adc = machine.ADC(26) while True: value = adc.read_u16() lxp.send_data({ 'sensor_value': value, 'timestamp': time.time() }) time.sleep(5)
Success! Your Raspberry Pi Pico is now sending data to LXPCloud.

Arduino Installation

Hardware Requirements:

  • Arduino Uno, Nano, or Mega
  • Ethernet Shield or WiFi module (ESP8266/ESP32)
  • USB cable
  • Optional: Sensors for data collection

Installation Steps:

1 Install Arduino IDE

Download and install Arduino IDE from the official website.

2 Install Required Libraries

Go to Tools > Manage Libraries and install:

  • ArduinoJson
  • Ethernet (built-in)
  • WiFi (if using WiFi module)
3 Download LXPCloud Arduino Library

Download the LXPCloud Arduino library and add it to your Arduino libraries folder.

4 Configure Network Settings
#include <LXPCloud.h> // Network configuration char ssid[] = "YOUR_WIFI_SSID"; char pass[] = "YOUR_WIFI_PASSWORD"; // LXPCloud configuration LXPCloud lxp("lxp_your_api_key_here", "your_device_id");
5 Setup Main Code
void setup() { Serial.begin(9600); // Connect to WiFi WiFi.begin(ssid, pass); while (WiFi.status() != WL_CONNECTED) { delay(500); Serial.print("."); } // Initialize LXPCloud lxp.begin(); } void loop() { // Read sensor data int sensorValue = analogRead(A0); // Send data to LXPCloud lxp.sendData("sensor_value", sensorValue); delay(5000); // Send every 5 seconds }
6 Upload and Test

Upload the code to your Arduino and monitor the Serial output for connection status.

Success! Your Arduino is now connected to LXPCloud and sending data.

ESP32 Installation

Hardware Requirements:

  • ESP32 development board
  • USB cable
  • WiFi network
  • Optional: Sensors and breadboard

Installation Steps:

1 Setup Arduino IDE for ESP32

Add ESP32 board support to Arduino IDE:

  1. File > Preferences
  2. Add to Additional Board Manager URLs: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_index.json
  3. Tools > Board > Boards Manager
  4. Search for "ESP32" and install
2 Install Required Libraries

Install these libraries via Library Manager:

  • ArduinoJson
  • WiFi
  • HTTPClient
3 Download LXPCloud ESP32 Library

Download the LXPCloud ESP32 library and add it to your Arduino libraries folder.

4 Configure WiFi and LXPCloud
#include <WiFi.h> #include <LXPCloud.h> // WiFi credentials const char* ssid = "YOUR_WIFI_SSID"; const char* password = "YOUR_WIFI_PASSWORD"; // LXPCloud configuration LXPCloud lxp("lxp_your_api_key_here", "your_device_id");
5 Setup Main Code
void setup() { Serial.begin(115200); // Connect to WiFi WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { delay(1000); Serial.println("Connecting to WiFi..."); } Serial.println("WiFi connected"); // Initialize LXPCloud lxp.begin(); } void loop() { // Read sensor data (example) int temperature = random(20, 30); // Replace with actual sensor // Send data to LXPCloud lxp.sendData("temperature", temperature); delay(10000); // Send every 10 seconds }
6 Select Board and Upload

Select your ESP32 board from Tools > Board menu and upload the code.

Success! Your ESP32 is now connected to LXPCloud and sending data.

Troubleshooting

Common Issues

Connection Issues

  • Device not connecting: Check your API key and device ID
  • Network timeout: Verify internet connection and firewall settings
  • Authentication failed: Ensure API key is correct and not expired

Data Issues

  • No data received: Check device configuration and sensor connections
  • Incorrect data format: Verify data structure matches API requirements
  • Missing timestamps: Ensure proper time synchronization

Hardware Issues

  • Power problems: Use adequate power supply for your device
  • Sensor not working: Check wiring and sensor compatibility
  • Memory issues: Optimize code for limited memory devices

Support

If you encounter any issues during installation, please contact our support team: