• Skip to main content
  • Skip to primary sidebar

RNTLab.com

The Ultimate Shortcut to Learn Electronics and Programming with Open Source Hardware and Software

  • Courses
  • Forum
    • Forum
    • Ask Question
  • Shop
  • Account
  • Blog
  • Login

ESP8266 temp reading – MQTT – SQLite

Q&A Forum › Category: ESP8266 › ESP8266 temp reading – MQTT – SQLite
0 Vote Up Vote Down
Cor Groot asked 5 years ago

When I create in Node Red an Inject node with the topic: INSERT INTO tempreadings(in_toevoer) values(11.5); which is connected to a sqlite-node, it inserts a new row into the database.

When I send the same string from my ESP8266 by MQTT to the mqqt-in node connected to the same sqlite node, I get a SQL error.

The debug message from the MQTT-in node is: “INSERT INTO tempreadings(in_toevoer) values(11.5);”, it looks like that the quotes are added, which create (I think) the SQL error.

How can I insert a new row from ESP8266 via MQTT into a sqlite database?

Question Tags: ESP8266 temp reading - MQTT - SQLite
3 Answers
0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Hello Cor, I hope you are doing well and I’m sorry for taking so long to get back to you.

I’m not sure if that’s what is causing the error…

In the inject node which payload type did you use? If you’ve used the string (az) payload type, it will still output the query with the quotes, right?

Which SQL error is it printing in the debug window?

Thanks for your patience!

0 Vote Up Vote Down
Cor Groot answered 5 years ago

Thanks for your answer.
I found the problem, I was trying to send (from the esp6288 via mqtt) a string  variable into a sql nummeric cell )-8

0 Vote Up Vote Down
Rui Santos Staff answered 5 years ago

Thank you for letting me know and I’m glad you made it work!

Primary Sidebar

Login to Ask or Answer Questions

This Forum is private and it’s only available for members enrolled in our Courses.

Login »

Latest Course Updates

  • [eBook Updated] Learn Raspberry Pi Pico/Pico W with MicroPython eBook – Version 1.2 May 26, 2025
  • [New Edition] Build ESP32-CAM Projects eBook – 2nd Edition April 16, 2025

You must be logged in to view this content.

Contact Support - Refunds - Privacy - Terms - MakerAdvisor.com - Member Login

Copyright © 2013-2025 · RandomNerdTutorials.com · All Rights Reserved

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.