filmov
tv
🔴How to send sensor Data from Arduino UNO to MySQL Server(PHPMYADMIN) Offline (No internet)?

Показать описание
#Arduino #MySQL#node_red_sql
@makersgroup
To send Arduino data to the database you don't need any wifi devices like eas8266, nodemcu, or Wifi shield LAN. You just follow the video and all is done quickly.
The Arduino Code:-
int Humidity=0;
int Temprature=0;
int Light=0;
void setup() {
}
void loop() {
Temprature=random(20,40);
Humidity=random(80,120);
Light=random(100,160);
delay(2000);
}
The JSON code, to import the project:-
[
{
"id": "c73516050e9670c4",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "8c0759f2b73c30ef",
"type": "serial in",
"z": "c73516050e9670c4",
"name": "",
"serial": "632ce51bae434d89",
"x": 150,
"y": 140,
"wires": [
[
"78c9b7023caae7d3"
]
]
},
{
"id": "78c9b7023caae7d3",
"type": "json",
"z": "c73516050e9670c4",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 250,
"y": 200,
"wires": [
[
"7fe478bfb80dde25"
]
]
},
{
"id": "7fe478bfb80dde25",
"type": "function",
"z": "c73516050e9670c4",
"name": "",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 260,
"wires": [
[
"4aebfc352c4acb8b"
]
]
},
{
"id": "4aebfc352c4acb8b",
"type": "mysql",
"z": "c73516050e9670c4",
"mydb": "a8c399d7db9657e5",
"name": "",
"x": 510,
"y": 200,
"wires": [
[]
]
},
{
"id": "632ce51bae434d89",
"type": "serial-port",
"serialport": "COM4",
"serialbaud": "9600",
"databits": "8",
"parity": "none",
"stopbits": "1",
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "\\n",
"bin": "false",
"out": "char",
"addchar": "",
"responsetimeout": "10000"
},
{
"id": "a8c399d7db9657e5",
"type": "MySQLdatabase",
"name": "",
"host": "127.0.0.1",
"port": "3306",
"db": "test",
"tz": "",
"charset": "UTF8"
}
]
@makersgroup
To send Arduino data to the database you don't need any wifi devices like eas8266, nodemcu, or Wifi shield LAN. You just follow the video and all is done quickly.
The Arduino Code:-
int Humidity=0;
int Temprature=0;
int Light=0;
void setup() {
}
void loop() {
Temprature=random(20,40);
Humidity=random(80,120);
Light=random(100,160);
delay(2000);
}
The JSON code, to import the project:-
[
{
"id": "c73516050e9670c4",
"type": "tab",
"label": "Flow 2",
"disabled": false,
"info": "",
"env": []
},
{
"id": "8c0759f2b73c30ef",
"type": "serial in",
"z": "c73516050e9670c4",
"name": "",
"serial": "632ce51bae434d89",
"x": 150,
"y": 140,
"wires": [
[
"78c9b7023caae7d3"
]
]
},
{
"id": "78c9b7023caae7d3",
"type": "json",
"z": "c73516050e9670c4",
"name": "",
"property": "payload",
"action": "",
"pretty": false,
"x": 250,
"y": 200,
"wires": [
[
"7fe478bfb80dde25"
]
]
},
{
"id": "7fe478bfb80dde25",
"type": "function",
"z": "c73516050e9670c4",
"name": "",
"outputs": 1,
"noerr": 0,
"initialize": "",
"finalize": "",
"libs": [],
"x": 360,
"y": 260,
"wires": [
[
"4aebfc352c4acb8b"
]
]
},
{
"id": "4aebfc352c4acb8b",
"type": "mysql",
"z": "c73516050e9670c4",
"mydb": "a8c399d7db9657e5",
"name": "",
"x": 510,
"y": 200,
"wires": [
[]
]
},
{
"id": "632ce51bae434d89",
"type": "serial-port",
"serialport": "COM4",
"serialbaud": "9600",
"databits": "8",
"parity": "none",
"stopbits": "1",
"waitfor": "",
"dtr": "none",
"rts": "none",
"cts": "none",
"dsr": "none",
"newline": "\\n",
"bin": "false",
"out": "char",
"addchar": "",
"responsetimeout": "10000"
},
{
"id": "a8c399d7db9657e5",
"type": "MySQLdatabase",
"name": "",
"host": "127.0.0.1",
"port": "3306",
"db": "test",
"tz": "",
"charset": "UTF8"
}
]
Комментарии