Increase number of devices

Moderators: grovkillen, Stuntteam, TD-er

Post Reply
Message
Author
tuxmartin
Normal user
Posts: 34
Joined: 10 Sep 2017, 13:07

Increase number of devices

#1 Post by tuxmartin » 25 Nov 2017, 23:51

Hi,
I'm using ESPeasy v2.0.0-dev12. Firmware has limit to 12 devices.

Is possible to increase this limit?

I would like to connect 5 relays (Switch input) and 10 DS18B20 sensors on one gpio pin.
For each relay I need "virtual mqtt device" (Output - (Domoticz MQTT helper)).

I would like to add devices for system states: uptime, wifi signal and freemem - it is next 3 devices.

Is there any reason for only 12 devices?

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

Re: Increase number of devices

#2 Post by TD-er » 25 Nov 2017, 23:55

How are you going to connect the 5 relais?
Finding 5 free GPIO's is already hard and then you also need one for the 1-wire.

tuxmartin
Normal user
Posts: 34
Joined: 10 Sep 2017, 13:07

Re: Increase number of devices

#3 Post by tuxmartin » 26 Nov 2017, 00:01

I'm using Wemos D1 mini https://wiki.wemos.cc/products:d1:d1_mini

I found on wiki Why only 12 tasks?.
But there is no info how to compile firmware with more devices support.

tuxmartin
Normal user
Posts: 34
Joined: 10 Sep 2017, 13:07

Re: Increase number of devices

#4 Post by tuxmartin » 26 Nov 2017, 00:36

I found limits in file ESPEasy.ino:

Code: Select all

#define TASKS_MAX                          12 // max 12!
#define CONTROLLER_MAX                      3 // max 4!
#define NOTIFICATION_MAX                    3 // max 4!
What is the reason for comments with exclamation mark?

Domosapiens
Normal user
Posts: 307
Joined: 06 Nov 2016, 13:45

Re: Increase number of devices

#5 Post by Domosapiens » 26 Nov 2017, 01:05

Look here
https://github.com/letscontrolit/ESPEasy/issues/590

Hexenmeister explains ....see:
This is possible (up to about 28 without enlargement of config.dat), but some addresses have to be recalculated ...

Code: Select all

#define DAT_OFFSET_TASKS 4096 // each task = 2k, (1024 basic + 1024 bytes custom), 12 max
#define DAT_OFFSET_CONTROLLER DAT_OFFSET_TASKS + (DAT_TASKS_SIZE * TASKS_MAX) // each controller = 1k, 4 max
#define DAT_OFFSET_CUSTOM_CONTROLLER DAT_OFFSET_CONTROLLER + (DAT_CUSTOM_CONTROLLER_SIZE * CONTROLLER_MAX) // each custom controller config = 1k, 4 max.
This recalculation is a clever way, that I didn't know a half year ago.
Without that recalculation I was able to run 24 tasks, but memory of the first controller position is overwritten,
so I used the second controller position.
30+ ESP units for production and test. Ranging from control of heating equipment, flow sensing, floor temp sensing, energy calculation, floor thermostat, water usage, to an interactive "fun box" for my grandson. Mainly Wemos D1.

tuxmartin
Normal user
Posts: 34
Joined: 10 Sep 2017, 13:07

Re: Increase number of devices

#6 Post by tuxmartin » 27 Nov 2017, 17:16

Thank you, it works!

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: Increase number of devices

#7 Post by danmero » 27 Nov 2017, 18:47

Why someone will waste a Task/Device for a system variable, can't be changed remotely anyway and you can publish from rules.

In any case use a $1IO Expansion Board I2C or $1.4 IO Expansion Board I2C that will save you IO on the main board.
You can trigger multiple/different GPIO using a single mqtt import/rules and %eventvalue% variable.

Regards,

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

Re: Increase number of devices

#8 Post by Shardan » 27 Nov 2017, 19:19

Just as long as you use it as an output.
Use a 16port MCP21017 as an input and you will see...

Rgrds
Regards
Shardan

papperone
Normal user
Posts: 497
Joined: 04 Oct 2016, 23:16

Re: Increase number of devices

#9 Post by papperone » 27 Nov 2017, 19:42

Shardan wrote: 27 Nov 2017, 19:19 Just as long as you use it as an output.
Use a 16port MCP21017 as an input and you will see...

Rgrds
I support this as I'm designing new PCBs MCP23017 based (same as the one I've already for 8 relays + 8 inputs) and one of them I thought to have it 16 inputs, stack-able to be able to connect up to 8 (as MCP23017 can be set up to 8 different addresses) and go up to 128 inputs which of course will make ESPEasy completely unusable and I'm really puzzled on how to overcome this limits (power-wise ESP8266 has the capability to handle that many logical inputs, simply not possible with current ESPEasy design)
My TINDIE Store where you can find all ESP8266 boards I manufacture --> https://www.tindie.com/stores/GiovanniCas/
My Wiki Project page with self-made PCB/devices --> https://www.letscontrolit.com/wiki/inde ... :Papperone

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

Re: Increase number of devices

#10 Post by Shardan » 27 Nov 2017, 19:49

I've a similiar circuit already running with PCF8574, stackable PCB......
That's why i suggested some changes on github already.
Regards
Shardan

maluko
Normal user
Posts: 112
Joined: 02 Sep 2015, 00:49

Re: Increase number of devices

#11 Post by maluko » 27 Nov 2017, 20:00

Shardan wrote: 27 Nov 2017, 19:19 Just as long as you use it as an output.
Use a 16port MCP21017 as an input and you will see...

Rgrds
i have a home made board with 2 mcp but they dont work at same time because only has one i2c adress, even with the different gnd chant dont work.

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

Re: Increase number of devices

#12 Post by Shardan » 27 Nov 2017, 20:11

Don't leave adress inputs "floating".

The address inputs need Vcc or ground. I've a 10KOhm pull up resistor on all Ax-Inputs and jumpers to set them to ground as necessary.
Regards
Shardan

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: Increase number of devices

#13 Post by danmero » 27 Nov 2017, 22:13

Shardan wrote: 27 Nov 2017, 19:19 Just as long as you use it as an output.
Use a 16port MCP21017 as an input and you will see...
I use the expander for both input and output and works as expected, the only limitation is that you have to waste a Task for each input.
Anyway I never use built in GPIO for direct input or output as per say, only via expander and/or optoisolator.

Regards,

maluko
Normal user
Posts: 112
Joined: 02 Sep 2015, 00:49

Re: Increase number of devices

#14 Post by maluko » 28 Nov 2017, 14:32

Shardan wrote: 27 Nov 2017, 20:11 Don't leave adress inputs "floating".

The address inputs need Vcc or ground. I've a 10KOhm pull up resistor on all Ax-Inputs and jumpers to set them to ground as necessary.
thanks shardan

can you explain with a schematic?

Thanks

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

Re: Increase number of devices

#15 Post by Shardan » 28 Nov 2017, 16:45

danmero wrote: 27 Nov 2017, 22:13
Shardan wrote: 27 Nov 2017, 19:19 Just as long as you use it as an output.
Use a 16port MCP21017 as an input and you will see...
I use the expander for both input and output and works as expected, the only limitation is that you have to waste a Task for each input.
Anyway I never use built in GPIO for direct input or output as per say, only via expander and/or optoisolator.

Regards,
You use a 23017 with 16 inputs on ESPEasy with 12 tasks?
As said i use a similiar solution with two PCF8574, one as input, one as output, that works flawlessly.

Anyways i need much more then 8 or 16 inputs so i've requested a solution on github already, just one task per
PCD8574 or MCP23017 just reading the byte (PCF8574) or word (MCP23017) and giving the binary value back to the home control.
Regards
Shardan

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

Re: Increase number of devices

#16 Post by Shardan » 28 Nov 2017, 16:46

can you explain with a schematic?

Thanks
As soon as i'm home :)
Regards
Shardan

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

Re: Increase number of devices

#17 Post by Shardan » 28 Nov 2017, 18:06

And here we go:
MCP_Addr.jpg
MCP_Addr.jpg (309.26 KiB) Viewed 14549 times
Regards
Shardan

danmero
Normal user
Posts: 64
Joined: 11 May 2017, 01:19

Re: Increase number of devices

#18 Post by danmero » 28 Nov 2017, 21:00

Shardan wrote: 28 Nov 2017, 16:45 As said i use a similiar solution with two PCF8574, one as input, one as output, that works flawlessly.
As a note, you can use one device for both input and output(on different pins).
Shardan wrote: 28 Nov 2017, 16:45 Anyways i need much more then 8 or 16 inputs so i've requested a solution on github already, just one task per
PCD8574 or MCP23017 just reading the byte (PCF8574) or word (MCP23017) and giving the binary value back to the home control.
Great idea.

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

Re: Increase number of devices

#19 Post by Shardan » 28 Nov 2017, 22:35

danmero wrote: 28 Nov 2017, 21:00 As a note, you can use one device for both input and output(on different pins).
I know - it's a remote control that uses 8 buttons and 8 status LED's.
.
rc_8x8_1280.jpg
rc_8x8_1280.jpg (655.94 KiB) Viewed 14528 times
.
I was wondering if i should use a 23017 but the PCF8574 were in the shelf and PCB layout is easier for this configuration :)

Regards
Shardan
Regards
Shardan

Post Reply

Who is online

Users browsing this forum: No registered users and 27 guests