• 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 7 months 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 6 months 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 6 months 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 6 months 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] Download Build Web Servers with ESP32 and ESP8266 (2nd Edition) February 8, 2021
  • [eBook Released] Build Web Servers with ESP32 and ESP8266 (version 1.0) October 27, 2020

You must be logged in to view this content.

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

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