• 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 + MQTT + multiple DS18B20

Q&A Forum › Category: Home Automation › ESP8266 + MQTT + multiple DS18B20
0 Vote Up Vote Down
Slawomir Lipka asked 3 months ago

Hi,
I am trying to send temperature readings from three DS18B20 sensors to MQTT using your tutorials. In order to distinguish individual sensors, I wanted the data to be sent in separate topics, which would be the addresses of individual sensors. For example, “esp/ds18b20/temperature/28DE58B0A021015E”. Unfortunately, I have a problem with using the sensor address that I generate using the printAddress(tempDeviceAddress) function to create the appropriate topic. How should I generate a string containing the address of the sensor so that I can use it to create the appropriate topic?
Many Thanks, Slawek

1 Answers
0 Vote Up Vote Down
Sara Santos Staff answered 3 months ago

Hi.
First, you need to convert the address to a string.
What is the original variable type of the address? How are you getting the board address?
Then, you just need to concatenate the topic with the string that contains the address.
Regards,
Sara

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] SMART HOME with RPi, ESP32, and ESP8266 (version 1.2) March 8, 2023
  • [eBook Updated] ESP32-CAM Projects (version 1.3) January 7, 2023

You must be logged in to view this content.

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

Copyright © 2013-2023 · 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.