My project is to receive data from Bluetooth (HC-05) sensor and storing it in the database. I have successfully received data from Bluetooth sensor and stored it in a String variable. Now i have to store this data to the database. I want to use the sensors as standalone (not connecting to the PC - operated on battery). Can I store the data to the database using ESP8266.


Since you mention you operate on a battery (standalone), what exactly do you mean by "the database"? Do you have online connectivity? Do you have any peripherals like an sdcard or other storage?

In case you don't have a permanent online connection, you would need to use some writable memory (like EEPROM) to store your data in some organized form. Since the ESP8266 doesn't seem to have any EEPROM built in, you would need to use its flash memory, like described in those answers.

A database could be as simple as a fixed length string list (essentially how string arrays look in memory). For example if the string data you want to save always has 32 bytes, you could just divide your available storage (e.g. 4096 bytes) to have a "database" wich can store 128 entries (4096/32). Your "database entries" will then be addressable in multiples of 32, you would find the 1st entry at byte 0, the 2nd at byte 32 and so on.

Once you are online, you could send the data out for further processing. Getting the data into a database can be as simple as a https request.

  • I am not using any memory. I am using Firebase as a database to store data. I have arduino uno, esp8266. I have created the project in firebase and copied the host name, key into the program. But when I try to upload the program to arduino I am receiving No such file or directory error for the following header files #include<memory> #include<string> #include<functional> #include<vector> #include<utilities>. I am following this link. How do i solve the issues. Feb 3 '20 at 9:31
  • Missing files most probably mean you didn't include a Library in your IDE. Check the comments in the link you've posted, the listed code looks a bit messed up, while not mentioning any #include<string> lines. Did you try the Examples directly from the firebase repository, or the much better library (from the linked electropeak source article)?
    – scitor
    Feb 3 '20 at 15:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.