I am having trouble with a simple ESP to ESP serial comms. The enclosed is a cut down from a larger project passing 200 int values (MV) from one ESP to another.. To demonstrate the problem I am passing these one at a time. At a high baud rate the best I can do is 27 reads of 200 sends. (Serail2.zip is the sender and Serial1.zip the receiver programs)
Each send is via a SendArray(20) with SendArray(0) being a key (3 in this case) to the type of data being sent
Played with changes to the #StackBufferSize, MaxBufferSize and baud rate with little effect.
Of note in Capture 1 the buffer length changes from 23 to 24 and then fails on the be(60) call
Any help appreciated.. I've been on this simple thing for ages.
(As a footnote the reason I am using two ESP is one to transmit WIFI and one as a straight processor with I2C involved.. If I use WIFI and I2C in one ESP I get continuous crashes!)
Two other clarifications please.
a) Is there another way of coding ser.ConvertArraytoBytes) for say SendArray(20) rather than
Serial1_astream.write(ser.ConvertArrayToBytes(Array(SendArray(0),SendArray(1),SendArray(2),SendArray(3),SendArray(4),SendArray(5),SendArray(6),SendArray(7),SendArray(8),SendArray(9),SendArray(10),SendArray(11),SendArray(12),SendArray(13),SendArray(14),SendArray(15),SendArray(16),SendArray(17),SendArray(18),SendArray(19))))
b) I realize I can pack more variables into SendArray(20) to reduce the number of sends for 200 variables but is there a more efficient way of sending 200 variables
Each send is via a SendArray(20) with SendArray(0) being a key (3 in this case) to the type of data being sent
Played with changes to the #StackBufferSize, MaxBufferSize and baud rate with little effect.
Of note in Capture 1 the buffer length changes from 23 to 24 and then fails on the be(60) call
Any help appreciated.. I've been on this simple thing for ages.
(As a footnote the reason I am using two ESP is one to transmit WIFI and one as a straight processor with I2C involved.. If I use WIFI and I2C in one ESP I get continuous crashes!)
Two other clarifications please.
a) Is there another way of coding ser.ConvertArraytoBytes) for say SendArray(20) rather than
Serial1_astream.write(ser.ConvertArrayToBytes(Array(SendArray(0),SendArray(1),SendArray(2),SendArray(3),SendArray(4),SendArray(5),SendArray(6),SendArray(7),SendArray(8),SendArray(9),SendArray(10),SendArray(11),SendArray(12),SendArray(13),SendArray(14),SendArray(15),SendArray(16),SendArray(17),SendArray(18),SendArray(19))))
b) I realize I can pack more variables into SendArray(20) to reduce the number of sends for 200 variables but is there a more efficient way of sending 200 variables