Problem with DS18B20 and webpage

For general Flowcode discussion that does not belong in the other sections.
Post Reply
MJU20
Posts: 337
http://meble-kuchenne.info.pl
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 93 times
Been thanked: 67 times

Problem with DS18B20 and webpage

Post 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!
Attachments
Webserver met DS18B20 voor MM.fcfx
(22.36 KiB) Downloaded 413 times

mnfisher
Valued Contributor
Posts: 1462
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 136 times
Been thanked: 713 times

Re: Problem with DS18B20 and webpage

Post by mnfisher »

You need to call SampleAllDevices

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

Martin

MJU20
Posts: 337
Joined: Tue Dec 08, 2020 5:11 pm
Has thanked: 93 times
Been thanked: 67 times

Re: Problem with DS18B20 and webpage

Post 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!

Steve-Matrix
Matrix Staff
Posts: 1472
Joined: Sat Dec 05, 2020 10:32 am
Has thanked: 204 times
Been thanked: 349 times

Re: Problem with DS18B20 and webpage

Post 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.

Post Reply