[Solved] Multiple i2c devices ...

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
simeonof
Normal user
Posts: 10
Joined: 20 Jan 2016, 06:38

[Solved] Multiple i2c devices ...

#1 Post by simeonof » 04 Feb 2016, 16:44

Hi, I wonder how to address multiple devices on I2C bus :?:
For dallas ds18b20, there is an option under tasks - "Device Nr", but there is nothing for other I2C devices (INA219 or ADS1115).
Maybe it is not implemented yet ?
Last edited by simeonof on 13 Feb 2016, 22:20, edited 1 time in total.

costo
Normal user
Posts: 490
Joined: 21 Nov 2015, 15:03

Re: Multiple i2c devices ...

#2 Post by costo » 04 Feb 2016, 17:47

Selecting addess for INA219 is not implemented, only 0x40 is available.

Only OLED and LCD displays have a selectable address so you can connect 2 OLED's of LCD displays

hamster
Normal user
Posts: 61
Joined: 27 Sep 2015, 21:01
Location: UK

Re: Multiple i2c devices ...

#3 Post by hamster » 07 Feb 2016, 18:03

having a selectable I2C address would be useful for MCP23017 + PCF8574
I have a board which I was using with my Pi which has 2 x MCP23017 address 0x20 / 0x21

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Multiple i2c devices ...

#4 Post by chunter1 » 09 Feb 2016, 21:25

i would appreciate if there was an address field in the task list where you can define the address of the specified device manually.

Martinus

Re: Multiple i2c devices ...

#5 Post by Martinus » 10 Feb 2016, 08:56

hamster wrote:having a selectable I2C address would be useful for MCP23017 + PCF8574
I have a board which I was using with my Pi which has 2 x MCP23017 address 0x20 / 0x21
You can just use the port numbers to address both devices. These will be 1-32 in your situation. I've added the table in the Wiki page:
http://www.esp8266.nu/index.php/MCP23017#Input

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Multiple i2c devices ...

#6 Post by chunter1 » 10 Feb 2016, 09:06

Martinus wrote:
hamster wrote:having a selectable I2C address would be useful for MCP23017 + PCF8574
I have a board which I was using with my Pi which has 2 x MCP23017 address 0x20 / 0x21
You can just use the port numbers to address both devices. These will be 1-32 in your situation. I've added the table in the Wiki page:
http://www.esp8266.nu/index.php/MCP23017#Input
How can i use 32 ports when there are only 12 tasks available?

Martinus

Re: Multiple i2c devices ...

#7 Post by Martinus » 10 Feb 2016, 11:48

chunter1 wrote:
Martinus wrote:
hamster wrote:having a selectable I2C address would be useful for MCP23017 + PCF8574
I have a board which I was using with my Pi which has 2 x MCP23017 address 0x20 / 0x21
You can just use the port numbers to address both devices. These will be 1-32 in your situation. I've added the table in the Wiki page:
http://www.esp8266.nu/index.php/MCP23017#Input
How can i use 32 ports when there are only 12 tasks available?
This is only supported for outputs. Inputs use a high speed polling technique that will likely not work for too many ports and overload the ESP Easy.
I'm not even sure if it will survive 12 input tasks, has never been tested.

hamster
Normal user
Posts: 61
Joined: 27 Sep 2015, 21:01
Location: UK

Re: Multiple i2c devices ...

#8 Post by hamster » 10 Feb 2016, 21:10

Well... I am currently using 8 Inputs and 8 Outputs on one ESP1E which I am replacing with the one below using a 12E
(Originally I had this connected to a RPI. using MCP23s17's . These now swapped out with a MCP23017 and rewired as I2C)
Soon as I get this one back working I will try. many thanks
2016-02-10 19.59.59s.jpg
2016-02-10 19.59.59s.jpg (83.95 KiB) Viewed 5451 times
By the way; fantastic project.I am really impressed how the improvements keep coming.. Well Done ESP EASY !

chunter1
Normal user
Posts: 82
Joined: 22 Jan 2016, 22:40

Re: Multiple i2c devices ...

#9 Post by chunter1 » 11 Feb 2016, 08:55

Martinus wrote:
chunter1 wrote:
Martinus wrote: You can just use the port numbers to address both devices. These will be 1-32 in your situation. I've added the table in the Wiki page:
http://www.esp8266.nu/index.php/MCP23017#Input
How can i use 32 ports when there are only 12 tasks available?
This is only supported for outputs. Inputs use a high speed polling technique that will likely not work for too many ports and overload the ESP Easy.
I'm not even sure if it will survive 12 input tasks, has never been tested.
Since i took a closer look at the ESPEasy sourcecode, i think there is some potential for improvement.
I would have preferred going with the ESP8266_RTOS_SDK or esp-open-rtos much more.
However, i'm glad and thankful this project exists ;)

Martinus

Re: Multiple i2c devices ...

#10 Post by Martinus » 11 Feb 2016, 15:02

chunter1 wrote:I would have preferred going with the ESP8266_RTOS_SDK or esp-open-rtos much more.
Feel free to launch your own repo on github and offer your support here. The more projects, the more people can achieve with this little device. ESP8266.nu is currently backed by only one project, developed by only one developer (with some plugin contributions by community members). Many people may think that this platform is only about ESP Easy and this is not correct as ESP Easy is just one sample project discussed here.

hamster
Normal user
Posts: 61
Joined: 27 Sep 2015, 21:01
Location: UK

Re: Multiple i2c devices ...

#11 Post by hamster » 12 Feb 2016, 22:11

Fantastic job.. :D
2x MCP23017's working
Using ports 17 to 32 work as either inputs or outputs as does ports 1 to 16 (I'm using R78)
Many thanks :D

tozett
Normal user
Posts: 733
Joined: 22 Dec 2015, 15:46
Location: Germany

Re: Multiple i2c devices ...

#12 Post by tozett » 13 Feb 2016, 22:15

SOLVED?
i would may help others quicker if the threadstarter could mark the whole thread as SOLVED
...if it is...

simeonof
Normal user
Posts: 10
Joined: 20 Jan 2016, 06:38

Re: [Solved] Multiple i2c devices ...

#13 Post by simeonof » 13 Feb 2016, 22:27

Yes, it was helpfull informatinon.
But evry day I'm working with ESPEasy it pops up another problem.
Anyway I've see how many work you've done boys. Thank You again and keep the good work!

Post Reply

Who is online

Users browsing this forum: No registered users and 13 guests