Page 1 of 1

Problem with DS18B20 and webpage

Posted: Mon Dec 27, 2021 12:04 am
by MJU20
Hello there,

I've bumped onto two problems in 1 flowchart.

I've used the DS18B20 component before, but now in FC9, I can't get it to work.
I will connect my logic analyser one of these days to find out what's wrong, but maybe the error is in the way I made the flowchart.

The problem is that I can't get a realistic temperature from the DS18B20 in my flowchart.
What I want to get is
1- a webpage that contains the temp-reading of the sensor
2- another variable on this page that contains the value of a (dummy) counter

The page loads and shows me a value for the DS18B20 but... this gets stuck at -0.062500°C. And believe me, it's not that cold here! :-)
So there is a problem with the attached DS18B20 (on pin 23 of the Wroom board) or there is a problem with the way I read the sensor?
(I have a 4k7 resistor between the dataline and the +3.3V)

Can someone please check this in the attached chart?

Then problem 2: I want to have another variable on the same webpage.
The index.htm works. I have it running and it reloads every 5 seconds.
But... probably my mistake is that I think that "setoutvalue 1,x" becomes %1 in the HTML code?

Is this wrong? How can I add a second variable in the HTML code of the same page?

Can please someone look into the attached chart and tell me where I do wrong?

I really need examples to get things working in FC9.
Thanks in advance!

Re: Problem with DS18B20 and webpage

Posted: Mon Dec 27, 2021 7:55 am
by mnfisher
You need to call SampleAllDevices

See https://www.flowcode.co.uk/forums/viewt ... 4870#p4870 for a working example

Martin

Re: Problem with DS18B20 and webpage

Posted: Mon Dec 27, 2021 10:44 pm
by MJU20
Thanks Martin,

This was indeed a hardware problem.
I checked it with my logic analyser and the response was... nothing as expected.

I took a magnifier and found out that this is a Ds18S20 instead of a B...
I really don't know how I got this one. It came out a box with B models.
Anyway, now the temp reading works.

But how about the second variable on 1 HTML page, what am I doing wrong?
This is the second part of my question.
Anyone?

Thanks again!

Re: Problem with DS18B20 and webpage

Posted: Thu Feb 03, 2022 9:58 am
by Steve-Matrix
Looking at the wiki page for the Webserver component, it appears you need to set the "Outgoing...Count" property to the number of outgoing variables you want to show. In your program this is currently set to 1. Try setting it to 2.