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

แชร์
ฝัง
  • เผยแพร่เมื่อ 23 พ.ย. 2022
  • #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.
    Node red installation guide:- • Node-RED Installation ...
    The Arduino Code:-
    int Humidity=0;
    int Temprature=0;
    int Light=0;
    void setup() {
    Serial.begin(9600);
    Serial.println(F("DHTxx Unified Sensor Example"));
    }
    void loop() {
    Temprature=random(20,40);
    Humidity=random(80,120);
    Light=random(100,160);
    Serial.print("{\"Hum\":");
    Serial.print(Humidity);
    Serial.print(",\"Temp\":");
    Serial.print(Temprature);
    Serial.print(",\"Li\":");
    Serial.print(Light);
    Serial.println("}");
    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": "",
    "func": "var value=JSON.parse(JSON.stringify(msg.payload));
    value=msg;
    var sensor1 = msg.payload.Li;
    var sensor2 = msg.payload.Temp;
    var sensor3 = msg.payload.Hum;
    msg.payload = [sensor1, sensor2, sensor3];
    msg.topic = 'INSERT INTO sensordata(Humidity, Temprature, Light) VALUES (?,?,?);';
    return msg;",
    "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": "\
    ",
    "bin": "false",
    "out": "char",
    "addchar": "",
    "responsetimeout": "10000"
    },
    {
    "id": "a8c399d7db9657e5",
    "type": "MySQLdatabase",
    "name": "",
    "host": "127.0.0.1",
    "port": "3306",
    "db": "test",
    "tz": "",
    "charset": "UTF8"
    }
    ]
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 70

  • @madalinago4268
    @madalinago4268 ปีที่แล้ว +1

    Thank you so much, you helped me a lot on my project! 😇

    • @makersgroup
      @makersgroup  ปีที่แล้ว

      Thank you for your comment

  • @user-vs1jx1mw6g
    @user-vs1jx1mw6g ปีที่แล้ว +2

    Hi, I have problem with database. In my project I use DHT11 and HW-038. In arduino ide I get data from my sensor correctly, but when I am trying to get data in my database, my sql returned empty result. Where can be my mistake?

  • @ByteBrilliant734
    @ByteBrilliant734 2 หลายเดือนก่อน +1

    thanks for the video sir, but i have a problem at the level of my node-red, when i open the work space and go manage palette to install serial or dashboard, it does not show any result instead it shows an error message that "no match found". please i wish someone really help me out.

  • @hamzabeyaz3651
    @hamzabeyaz3651 10 หลายเดือนก่อน +2

    Hello, we see the data as 0 in SQL even though we are doing the same thing you did. What do we write in SQL Insert Into values(?)? I would be glad if you can help me urgently.

    • @makersgroup
      @makersgroup  10 หลายเดือนก่อน

      Hello dear, first you need to make sure that the sensor data is sucessfully read by the arduino using your serial monitor, if you get the correct sensor reading on your arduino ide serial monitor, the error might be on your node red , you you have to amend the sensor data to send serially to the sql node as per your project

  • @kuraikuranaken9854
    @kuraikuranaken9854 6 หลายเดือนก่อน +1

    Hello, may I know how the phpmyadmin is connected to mysql?
    and how would the arduino read information instead of writing to mysql?

    • @makersgroup
      @makersgroup  6 หลายเดือนก่อน

      You can follow this video th-cam.com/video/YxkZ6OzYV44/w-d-xo.html to install xampp which consists of phpmyadmin and mysql

  • @arjuns9392
    @arjuns9392 2 หลายเดือนก่อน

    Hi sir I'm not getting serial.in in node red

  • @lawrencepinlac5965
    @lawrencepinlac5965 ปีที่แล้ว +1

    Can you help us with our project? We used MQ135,MQ7 and DHT11 sensors.
    I connected the COM and the database but the values are not showing. My command prompt also shows
    "Unexpected string in JSON at position 26"
    What does it mean?

    • @lawrencepinlac5965
      @lawrencepinlac5965 ปีที่แล้ว +1

      I also tried your example, I used it as a guide but the values are not showing and the command prompt displaying
      "Unexpected string in JSON at position 26"

    • @makersgroup
      @makersgroup  ปีที่แล้ว +1

      Does the example in the video works for you?, If you are able to make the project which is given on the video, changing the sensors and values is easy peasy. but if it does not work for you let me know so that I can assist you?

    • @lawrencepinlac5965
      @lawrencepinlac5965 ปีที่แล้ว +1

      @@makersgroup It worked, thanks for the help brother

    • @irving422
      @irving422 ปีที่แล้ว

      @@lawrencepinlac5965 Bro, how did you make it work? I'm trying to read values from a LM35 but have the same problem as yours

  • @gezhagnteramedew5086
    @gezhagnteramedew5086 2 หลายเดือนก่อน +1

    Hi sir
    i have a problem when i am trying to upload it gives me the following result
    Sketch uses 2688 bytes (8%) of program storage space. Maximum is 32256 bytes.
    Global variables use 224 bytes (10%) of dynamic memory, leaving 1824 bytes for local variables. Maximum is 2048 bytes.
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0xfe
    avrdude: stk500_recv(): programmer is not responding
    avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0xfe
    Failed uploading: uploading error: exit status 1
    i configure the board to Arduino uno and the port to COM4

    • @makersgroup
      @makersgroup  2 หลายเดือนก่อน +1

      make sure:- the Arduino port is COM4 in your case, by the way, the method also works for other boards in the same way. Also, reset, unplug the board and restart the arduino IDE and re-connect the board make sure the code you are trying to upload does not have an error

  • @radioactivestijn9978
    @radioactivestijn9978 5 หลายเดือนก่อน +1

    I keep getting ER_BAD_DB_ERROR when deploying, any idea what the issue could be?

    • @makersgroup
      @makersgroup  5 หลายเดือนก่อน +2

      Incorrect database credentials: Double-check that you have provided the correct username, password, host, and database name when configuring the connection to the MySQL server.
      Database privileges: Ensure that the user you are connecting with has sufficient privileges to access and modify the specified database. The user should have at least the necessary permissions to insert data into the database.
      Database existence: Verify that the specified database actually exists on the MySQL server. If not, create the database manually or modify the configuration to use an existing database.
      Network or connectivity issues: Check if there are any network or firewall issues that are preventing the connection between your Node-RED application and the MySQL server. Ensure that the MySQL server is accessible from the machine running Node-RED.
      MySQL server configuration: Make sure that the MySQL server is properly configured to accept remote connections and that it allows connections from the machine running Node-RED.

  • @vighneshsomoshi9935
    @vighneshsomoshi9935 2 หลายเดือนก่อน +1

    Hello Sir, how can i use the data from the database to give output in terms of LED indications?

    • @makersgroup
      @makersgroup  2 หลายเดือนก่อน +2

      If you do not need historical data you can directly amend in the arduino code so as to control the led in real time data from sensors

  • @myapplication9897
    @myapplication9897 7 หลายเดือนก่อน +1

    Hello sir,
    i got this problem : " serial port COM5 error: Error: Opening COM5: Access denied"
    can you help me?

    • @makersgroup
      @makersgroup  7 หลายเดือนก่อน

      This is because you do not close serial monitor or else there is other program which uses COM5

  • @45ombahirat30
    @45ombahirat30 6 หลายเดือนก่อน +1

    I am following you step by step its showing successfully deployed but no change in database why is it so

    • @makersgroup
      @makersgroup  6 หลายเดือนก่อน +1

      Make sure you have setup the database properly on both xampp and nodered softwares

  • @JjayFabor
    @JjayFabor 10 หลายเดือนก่อน +1

    Hello sir, can I still run this even if my arduino is not connected to my computer?

    • @makersgroup
      @makersgroup  10 หลายเดือนก่อน

      Since the arduino send the data serialy to the nodered software on your machine you are expected to connect your arduino with your machine

  • @user-cn8sq8td7y
    @user-cn8sq8td7y 7 หลายเดือนก่อน

    i have problem. in serial monitor, it's appear correct humidity and temperature. in node-red, serial in and mysql is connected. but the problem is not save in to database. can you help me?

    • @makersgroup
      @makersgroup  7 หลายเดือนก่อน

      have you created humidity and temperature fields in the database so as to save the sent data values? th-cam.com/video/fRNKrEdmnkg/w-d-xo.htmlsi=73M2FWxAtfCUzSnK

    • @user-cn8sq8td7y
      @user-cn8sq8td7y 7 หลายเดือนก่อน

      @@makersgroup yes, i follow every step by step. still not save to my database

  • @gustavobocci626
    @gustavobocci626 7 หลายเดือนก่อน +1

    i tested and it works with arduino mega 2560 too

    • @makersgroup
      @makersgroup  7 หลายเดือนก่อน +2

      Also it worked with arduino nano and mini too

  • @DomixPlayTV
    @DomixPlayTV ปีที่แล้ว +1

    I have error that says "column "xxx" cannot be null"

    • @makersgroup
      @makersgroup  ปีที่แล้ว +1

      This might happen because you have a variable with out a value, try to follow the tutorial step by step and if it works it will be easy to you to use for your own use with a litle bit of modification

  • @user-uk2wq4we7p
    @user-uk2wq4we7p 3 หลายเดือนก่อน +1

    I keep getting ER_BAD_FIELD_ERROR when deploying, any idea what the issue could be?

    • @makersgroup
      @makersgroup  3 หลายเดือนก่อน

      Do not copy any thing try to build from scratch to figure out the cause of the error easily

    • @makersgroup
      @makersgroup  3 หลายเดือนก่อน +1

      Do not copy any thing try to build from scratch to figure out the cause of the error easily

  • @eljouska7171
    @eljouska7171 ปีที่แล้ว

    can i use the same approch to recieve data from database ?

    • @eljouska7171
      @eljouska7171 ปีที่แล้ว

      Could you please demonstrate the method i wanna recieve the data from the mysql db and send it to arduino is it possible ?

  • @ByteBrilliant734
    @ByteBrilliant734 2 หลายเดือนก่อน +1

    thanks for the

    • @makersgroup
      @makersgroup  2 หลายเดือนก่อน

      Make sure your internet connection is stable and follow up this tutorial m.th-cam.com/video/sRiL0qR9CU4/w-d-xo.html if still did n't work reinstall the software and try again

  • @lumidemukaj7149
    @lumidemukaj7149 2 หลายเดือนก่อน +1

    Can i do a request to database in base of id of a key fob that is scan on arduino and to look in database if it is there or not

    • @makersgroup
      @makersgroup  2 หลายเดือนก่อน

      Let me be honest with you , i haven't try this yet

    • @lumidemukaj7149
      @lumidemukaj7149 2 หลายเดือนก่อน

      @@makersgroup can u try?

  • @magusofflowers6929
    @magusofflowers6929 3 หลายเดือนก่อน +1

    Can this also work for Rfid RC522 inputs?

    • @makersgroup
      @makersgroup  3 หลายเดือนก่อน

      Yes but you must make it sutable for RFID

  • @suyamchanderiya8649
    @suyamchanderiya8649 ปีที่แล้ว

    Serial In node is not showing in node js then what can i do sir

    • @makersgroup
      @makersgroup  ปีที่แล้ว

      You have to install serial node in your nodered

  • @pramodpandit4890
    @pramodpandit4890 8 หลายเดือนก่อน +1

    COM port is not connected in node-red . What can I do?

    • @makersgroup
      @makersgroup  8 หลายเดือนก่อน +1

      Thank you very much

    • @pramodpandit4890
      @pramodpandit4890 8 หลายเดือนก่อน +1

      @@makersgroup you have solution for that error?

    • @makersgroup
      @makersgroup  8 หลายเดือนก่อน +1

      Yes you must change the COM port to the port which you used to upload the program and you must also close serial port since you could not acess serial port in 2 different software simultinously

  • @nharish7425
    @nharish7425 ปีที่แล้ว +1

    Hello sir, I can't able to send the data to php database...

    • @nharish7425
      @nharish7425 ปีที่แล้ว

      Both serial port and mysql port is connected..

    • @makersgroup
      @makersgroup  ปีที่แล้ว

      I can assist you in person please contact me

  • @christianlazaropacherrezyp3915
    @christianlazaropacherrezyp3915 ปีที่แล้ว +1

    one question, if i put my database online, that system will work correctly?

    • @makersgroup
      @makersgroup  ปีที่แล้ว +1

      The Arduino board must be connected to the server inorder to send the data serialy via the connection cable

  • @junreyrivera7729
    @junreyrivera7729 ปีที่แล้ว +1

    there's no serial in in my node-red

    • @makersgroup
      @makersgroup  ปีที่แล้ว +1

      You can install serial node in 20 seconds using the same procedure in this video,
      th-cam.com/video/sRiL0qR9CU4/w-d-xo.html

  • @user-zd2yi1fn3q
    @user-zd2yi1fn3q 11 หลายเดือนก่อน

    How can I resolve the COM port conflict between arduino uno and node.js

    • @makersgroup
      @makersgroup  11 หลายเดือนก่อน

      First, close serial monitor if you opened it if that did n't fix the error you must check that you used the same port number to upload the program and on the nodered software

    • @user-zd2yi1fn3q
      @user-zd2yi1fn3q 11 หลายเดือนก่อน

      @@makersgroup The instructions in your tutorial, are that, the "serial-in node" in node-red should use the same COM port as Arduino!

    • @user-zd2yi1fn3q
      @user-zd2yi1fn3q 11 หลายเดือนก่อน

      @@makersgroup If I close either of the two apps, the running app works correctly, however my project requires running both apps simultaneously!

    • @makersgroup
      @makersgroup  11 หลายเดือนก่อน

      If you open serial port of arduino and node red serial node at the same time you will get error because as the name suggests serial communication can not be used simultinously for dual purpose

    • @user-zd2yi1fn3q
      @user-zd2yi1fn3q 11 หลายเดือนก่อน +1

      @@makersgroup So, what options do I have, for my project to work?

  • @mtusa23
    @mtusa23 24 วันที่ผ่านมา +1

    tn node, work like a restful server?

    • @makersgroup
      @makersgroup  11 วันที่ผ่านมา

      Nodes are a simplified widget purosly made to tackle specific task

  • @haziq9636
    @haziq9636 5 หลายเดือนก่อน +1

    Does it work with esp8266?

    • @makersgroup
      @makersgroup  5 หลายเดือนก่อน +1

      You can use this video m.th-cam.com/video/MXFFoh1oZhE/w-d-xo.html