Guide
Guide
- Smartphone
connect the modem to your device using a USB cable. Finally, install any necessary drivers or software provided
by the manufacturer.
Your device will automatically detect the modem and display the installation window.
Carry out installation according to system prompts.
https://www.arduino.cc/en/software
Download the Arduino IDE that is compatible with your computer system.
When the download finishes, proceed with the installation and please allow the driver installation
process when you get a warning from the operating system.
Choose the components to install.
Click on the verify tool (checkmark). Since we are verifying the sketch, we can be sure it is going to
compile. After a few seconds, we can see the result of the action in the console (black box in the
bottom).
With the board selected, we are good to go! Click on the upload button, and it will start uploading
the sketch to the board.
When it is finished, a notification pops up in the bottom right of your IDE window. Of course,
sometimes there are some complications when uploading, and these errors will be listed here as well.
Source code.
//Code of WiFi MCU
#include <Arduino.h>
#include <iostream>
#if defined(ESP32)
#include <WiFi.h>
#include <FirebaseESP32.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <FirebaseESP8266.h>
#elif defined(PICO_RP2040)
#include <WiFi.h>
#include <FirebaseESP8266.h>
#endif // firebase library
FirebaseAuth auth;
FirebaseConfig config;
void setup()
{
Serial.begin(9600);
Serial2.begin(9600);
Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Serial.print("IP Address is : ");
Serial.println(WiFi.localIP()); // print local IP address
// Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); // connect to firebase
Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION);
Firebase.reconnectWiFi(true);
uint8_t SerialNoConvert[2];
SerialNoConvert[0] = serialData[22];
SerialNoConvert[1] = serialData[23];
SerialNo = "90"; // + dataprintHEX(SerialNoConvert, 2);
for (int i = 0; i < 2; i++)
{
SerialNo += converter(SerialNoConvert[i]);
}
Serial.print("SerialNo = ");
Serial.println(SerialNo);
if (SelectedBatteryID == SerialNo && serialData[20] < 5)
{
String serialDataHex;
for (int i = 0; i < 24; i++)
{
serialDataHex += sprintf(serialDataHex, "%02X", serialData[i]);
}
Firebase.RTDB.setString(&fbdo, SerialNo + "/Battery raw data", serialDataHex);
Firebase.RTDB.setString(&fbdo, SerialNo + "/Flag", flag);
if (flag == "0")
flag = "1";
else
flag = "0";
Serial.print("Firebase sent data = ");
Serial.println(serialDataHex);
}
}
}
#include <Arduino.h>
#include <iostream>
#include <string>
#if defined(ESP32)
#include <WiFi.h>
#include <FirebaseESP32.h>
#elif defined(ESP8266)
#include <ESP8266WiFi.h>
#include <FirebaseESP8266.h>
#elif defined(PICO_RP2040)
#include <WiFi.h>
#include <FirebaseESP8266.h>
#endif // firebase library
FirebaseAuth auth;
FirebaseConfig config;
void setup()
{
Serial.begin(9600);
Serial2.begin(9600);
Serial.println();
Serial.print("Connected to ");
Serial.println(WIFI_SSID);
Serial.print("IP Address is : ");
Serial.println(WiFi.localIP()); // print local IP address
// Firebase.begin(FIREBASE_HOST, FIREBASE_AUTH); // connect to firebase
Serial.printf("Firebase Client v%s\n\n", FIREBASE_CLIENT_VERSION);
/* Assign the API key (required) */
config.api_key = API_KEY;
Firebase.reconnectWiFi(true);
uint8_t SerialNoConvert[2];
SerialNoConvert[0] = serialData[22];
SerialNoConvert[1] = serialData[23];
SerialNo = "90"; // + dataprintHEX(SerialNoConvert, 2);
for (int i = 0; i < 2; i++)
{
SerialNo += converter(SerialNoConvert[i]);
}
Serial.print("SerialNo = ");
Serial.println(SerialNo);