MCP Status without device

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
Micha_he
Normal user
Posts: 372
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

MCP Status without device

#1 Post by Micha_he » 15 Sep 2022, 16:11

I use a MCP23017 via I2C, without configured devices. The internal command's like 'MCPGPIO,4,1' works. But when i use the command 'Status,MCP,4' or 'Status,M,4' I get a state of '0'.

Code: Select all

{
"log": "",
"plugin": 9,
"pin": 4,
"mode": "input",
"state": 0
}
Is this command don't work without a device is setup ?

User avatar
iron
Normal user
Posts: 221
Joined: 24 Sep 2016, 08:37
Location: Greece
Contact:

Re: MCP Status without device

#2 Post by iron » 15 Sep 2022, 19:45

You initiate monitor at/after boot ?

Monitor,MCP,<MCPGPIO>
-D

User avatar
chromo23
Normal user
Posts: 829
Joined: 10 Sep 2020, 16:02
Location: germany

Re: MCP Status without device

#3 Post by chromo23 » 15 Sep 2022, 20:05

I am also not sure this command works correctly ... but the project i used the mcp23017 for is already deployed and i only have remote access to the software...so i can do no proper testing.

Edit: but there also seems to be a discrepancy in the mode... it seems that you use the the mcp23017 as an output but the log states the gpio as an input.. did you also set the mode?

Micha_he
Normal user
Posts: 372
Joined: 07 Feb 2018, 19:14
Location: Helmstedt, Germany

Re: MCP Status without device

#4 Post by Micha_he » 15 Sep 2022, 20:22

Yes, the mode is set to output at start.

@iron: Yes, I set the monitor at start and the monitor works, event is generated.

User avatar
Ath
Normal user
Posts: 3655
Joined: 10 Jun 2018, 12:06
Location: NL

Re: MCP Status without device

#5 Post by Ath » 15 Sep 2022, 20:49

Micha_he wrote: 15 Sep 2022, 16:11 Is this command don't work without a device is setup ?
The "status" command is (also) an ESPEasy core command and doesn't need a device/task to be set up, only connected (but that shouldn't be a problem :lol:), as it directly reads the status via the I2C bus.
/Ton (PayPal.me)

Smotek7
Normal user
Posts: 145
Joined: 01 Aug 2020, 16:18
Location: SK

Re: MCP Status without device

#6 Post by Smotek7 » 11 Jun 2024, 11:46

Hi,
sorry for the beginner's question.
I don't want to start a new topic.

I have an MCP23017 connected, I scan the I2C and see it at 0x20.
I will send MCPGPIO,2,1 from the command line and it will return Failed
I tried to define
On System#Boot Do
MCPmodeRange,1,16,0
MonitorRange,MCP,1,16
Endon
but it didn't help.
Build: ESP_Easy_mega_20240414_collection_A_ESP32_4M316k Apr 14 2024
Where am I doing wrong?

Smotek7
Normal user
Posts: 145
Joined: 01 Aug 2020, 16:18
Location: SK

Re: MCP Status without device

#7 Post by Smotek7 » 12 Jun 2024, 08:11

The problem was in HW.
Strange behavior of ESP32, I tried it on another and it works there.

TD-er
Core team member
Posts: 8879
Joined: 01 Sep 2017, 22:13
Location: the Netherlands
Contact:

Re: MCP Status without device

#8 Post by TD-er » 12 Jun 2024, 09:35

Ah good to know, as I already discussed it with Ton as I couldn't find anything obviously wrong in what you tried to do.

Maybe you're using some pins for I2C which are better not used on ESP32?

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 1 guest