Basic problem with inputs

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
DMailMan
New user
Posts: 4
Joined: 17 Jun 2017, 09:21

Basic problem with inputs

#1 Post by DMailMan » 17 Jun 2017, 09:39

I am just getting started with ESPEasy, and like the idea of what it offers, but am having a really basic problem - I can't get any inputs to my board to work.

I can set pin output values ok to turn on and off an LED, but when I try to read an input value, I just get 0 as the status, even if I have connected the input pin to Vin. Am I missing some other crucial step ?
espeasy pins status.PNG
espeasy pins status.PNG (8.47 KiB) Viewed 4759 times
Thanks for pointing out anything obvious ! ESP Easy looks great, but some of the basics are a bit opaque, and this might be one of them.

Martinus

Re: Basic problem with inputs

#2 Post by Martinus » 17 Jun 2017, 10:56

You've hit something that's due to unfinished development. The Wiki command reference states "Show status on previously controlled pins", meaning that it only reports the pin state if a pin has been set using an earlier command. But some plugins like the MCP, PCF8574 actually report input states without earlier commands to it.

ESP Easy should actually report "?" in this case... So that would be a bug...
Or should try to figure out the real state for a pin that has not been altered using a command. (this could be the tricky part)

DMailMan
New user
Posts: 4
Joined: 17 Jun 2017, 09:21

Re: Basic problem with inputs

#3 Post by DMailMan » 19 Jun 2017, 13:09

Thanks for the reply. I had seen a question mark response earlier, and was unclear on how to interpret what was going wrong, so thanks for explaining what it means. Why is figuring out the state of pin tricky ? Isn't it just a case of reading the voltage directly ?

So perhaps I was going about it the wrong way, but all I really want to do is read in a value from a pin of any sort, and none of them are working so I figured that this command approach would be the simplest test.

But if it's not, then that takes me back to the originating issue, which is that I want to read in the value of a potentiometer from the analog pin, and i can't get any values to show up there either:
D1 analog input.PNG
D1 analog input.PNG (25.33 KiB) Viewed 4721 times
There's definitely power going through, and the output from the pot is connected to pin A0, so I'm not sure why the value stays as zero no matter what I do. Is there some other step needed to have values show up here as well ? Or is the absence of a value here also due to something as-yet missing in the implementation ?

Shardan
Normal user
Posts: 1156
Joined: 03 Sep 2016, 23:27
Location: Bielefeld / Germany

Re: Basic problem with inputs

#4 Post by Shardan » 19 Jun 2017, 17:05

Hello,

as far as i can see from your screenshot you're using a R12x or R14x version of ESPEasy.

You did not set an IDX value. The framewokr of these versions depends heavily on the IDX,
If it is missing no value is shown.

If you're not using Domoticz, you can use any value from 1 to around 250,
just use unique numbers within the same ESP-device.

Regards
Shardan
Regards
Shardan

DMailMan
New user
Posts: 4
Joined: 17 Jun 2017, 09:21

Re: Basic problem with inputs

#5 Post by DMailMan » 19 Jun 2017, 19:00

Yes - it's the 120 version.

Thanks for the IDX tip. I may be missing a section of the docs, but where would I go to find out that IDX is important ? I can find very little info on that sort of thing.

So now I have a value appearing in the web page and in the log - great !

Which raises the next issue - at one extreme end of the pot range i get a value of 5, and at the other end of the range, i get a value of 6. I was expecting a range between 0 and 1023, so am presuming something is still not quite right. Perhaps some formula is required to map onto a more sensible value range ?

Also, what is the Delay value measured in ? I assume it's a time delay between readings, and thought at first it was milliseconds, but now think it might be seconds ?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Basic problem with inputs

#6 Post by grovkillen » 19 Jun 2017, 19:42

ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

DMailMan
New user
Posts: 4
Joined: 17 Jun 2017, 09:21

Re: Basic problem with inputs

#7 Post by DMailMan » 19 Jun 2017, 20:29

OK, got that part - but can I suggest that you default the value to 1, if defaulting to 0 causes frequent issues for noobs like me ?

User avatar
grovkillen
Core team member
Posts: 3621
Joined: 19 Jan 2017, 12:56
Location: Hudiksvall, Sweden
Contact:

Re: Basic problem with inputs

#8 Post by grovkillen » 19 Jun 2017, 20:33

DMailMan wrote: 19 Jun 2017, 20:29 OK, got that part - but can I suggest that you default the value to 1, if defaulting to 0 causes frequent issues for noobs like me ?
That would (potentially) cause problems for Domoticz. But this is a non-issue as of 2.0.0 which is due for release this summer. (You only need IDX if you use Domoticz as a controller).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you :idea: :idea: :idea:

Post Reply

Who is online

Users browsing this forum: No registered users and 46 guests