FRIARIELLO: wrong node count

83 views
Skip to first unread message

Gabriele Ribichini

unread,
May 4, 2015, 6:12:34 PM5/4/15
to sou...@googlegroups.com
Ciao Dario,
tonight I've encounter another strange behavior.

In the GW I am setting up all nodes as follow:

 SetAsPeerNode(IP_ADDRESS_TESTB2,1);
 
SetAsPeerNode(RS485_ADDRESS_TESTB2,2);
// SetAsPeerNode(IP_ADDRESS_ROW1B1,1);
// SetAsPeerNode(RS485_ADDRESS_ROW1B2,2);
 
SetAsPeerNode(RS485_ADDRESS_ROW1B3,3);
 
SetAsPeerNode(RS485_ADDRESS_ROW1B4,4);


 
SetAsPeerNode(IP_ADDRESS_ROW2B1,5);
 
SetAsPeerNode(RS485_ADDRESS_ROW2B2,6);
 
SetAsPeerNode(RS485_ADDRESS_ROW2B3,7);
 
SetAsPeerNode(RS485_ADDRESS_ROW2B4,8);


 
SetAsPeerNode(IP_ADDRESS_BED1B1,9);


 
SetAsPeerNode(IP_ADDRESS_BED2B1,10);
 
SetAsPeerNode(RS485_ADDRESS_BED2B2,11);
 
SetAsPeerNode(RS485_ADDRESS_BED2B3,12);

So that I was expecting 13 nodes in SoulssApp.. but just 3 appeared.

Debugging all code portions I figured out that the problem occur ONLY when calling the following line

mInput(HEATING_MIX_VALVE_DIRECTION) = Souliss_T1n_OffCmd;

where HEATING_MIX_VALVE_DIRECTION is the last slot defined as 31

I double checked my network size and I found this at the top of my code:

#define NODESIZE_INSKETCH
#define MaCaco_NODES 30
#define MaCaco_SLOT 35

so I assume that slot 31 can be used.

what's wrong ?



Di Maio, Dario

unread,
May 4, 2015, 6:15:08 PM5/4/15
to sou...@googlegroups.com

All nodes share the same number of slot?

Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/souliss/a2f6b522-4f81-425f-9d0a-e8c6a167b655%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Gabriele Ribichini

unread,
May 4, 2015, 6:19:37 PM5/4/15
to sou...@googlegroups.com
For your better understanding, modifying the network size as follow does not solve the issue.

#define NODESIZE_INSKETCH
#define MaCaco_NODES 30
#define MaCaco_SLOT 40

The sketch is published at this link:

line 329 if uncommented shows the bug.

Gabriele Ribichini

unread,
May 4, 2015, 6:23:00 PM5/4/15
to sou...@googlegroups.com
Well they should (before my latest code modification).
Anyway I think it should not really matter since this is the GW code.

I am not looking at the communication with Peers, I just wish to see the right numbers of nodes in SoulssApp.

Di Maio, Dario

unread,
May 5, 2015, 4:40:44 AM5/5/15
to sou...@googlegroups.com
Are you sure that the new defines are before Souliss.h? I would suggest you to change them directly into the conf/frame/MaCacoCfg.h file and try again.

Let me know,
Dario.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Gabriele Ribichini

unread,
May 5, 2015, 4:56:06 AM5/5/15
to sou...@googlegroups.com
Yes !
they are defined in grhSoulissCommon.h and in the sketch I call the following:

[...]
#include "grhSoulissCommon.h"


#include <SPI.h>
#include <EEPROM.h>
#include "Souliss.h"
[...]

but nevertheless I'll give a try tonight.

Di Maio, Dario

unread,
May 5, 2015, 5:00:43 AM5/5/15
to sou...@googlegroups.com
Add also a Serial.println() and print the number of nodes and slots.

Dario.

Gabriele Ribichini

unread,
May 5, 2015, 7:55:38 AM5/5/15
to sou...@googlegroups.com
OK got the issue !

as mentioned, my code was calling

#define NODESIZE_INSKETCH
#define MaCaco_NODES 30
#define MaCaco_SLOT 35

but the correct syntax should be:

#define MaCaco_NODESIZE_INSKETCH

#define MaCaco_NODES 30
#define MaCaco_SLOT 35

but now I have another question about the max network size.

Since VNET_MAX_PAYLOAD  is 46 and MaCaco_HEADER is 5 I was expecting a max number of slot of 40 (MaCaco_SLOT < VNET_MAX_PAYLOAD - MaCaco_HEADER)
but unfortunately it works only up to 37.
With MaCaco_SLOT set to 38 or more the code hangs at the very beginning.

I tried to increase VNET_MAX_PAYLOAD from 46 to 50 but it does not change.

Where this 37 limit comes from ?

thanks

Di Maio, Dario

unread,
May 5, 2015, 8:00:25 AM5/5/15
to sou...@googlegroups.com
Use Serial.println(MaCaco_MEMMAP,HEX); for 37 and for greather values.

Let me know,
Dario.

Gabriele Ribichini

unread,
May 5, 2015, 4:24:39 PM5/5/15
to sou...@googlegroups.com
MaCaco_NODES : 30
MaCaco_SLOT : 37
MaCaco_MEMMAP : FE

MaCaco_NODES : 30
MaCaco_SLOT : 38
MaCaco_MEMMAP : 102

MaCaco_NODES : 30
MaCaco_SLOT : 39
MaCaco_MEMMAP : 106

Di Maio, Dario

unread,
May 5, 2015, 4:26:20 PM5/5/15
to sou...@googlegroups.com

Probably we should not break the byte, I have to investigate.
Could you please open an issue?

Dario.

From Mobile.

Di Maio, Dario

unread,
May 5, 2015, 4:38:09 PM5/5/15
to sou...@googlegroups.com

Hi Gabriele,

please try this code:

uint8_t array[256];

setup(){
Serial.begin(9600);
}

loop(){
uint16_t i=0;

Serial.println(array[i],HEX);
i++;
}

Let me know if it works.

Regards,
Dario.

From Mobile.

Gabriele Ribichini

unread,
May 5, 2015, 4:44:05 PM5/5/15
to sou...@googlegroups.com
Not sure, I get all zeros printed.
It never ends and never crashes.

what were you expecting ?

Di Maio, Dario

unread,
May 5, 2015, 4:46:40 PM5/5/15
to sou...@googlegroups.com

So, looks that in our code we are addressing the array with a byte, this probably is creating throubles.

Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Gabriele Ribichini

unread,
May 5, 2015, 4:49:17 PM5/5/15
to sou...@googlegroups.com
I did a little modification of your code:

uint8_t array[256];

void setup(){
Serial.begin(9600);
}

void loop(){
uint16_t i=0;

while(i<256)
{
Serial.print(i);
Serial.print(" - ");
Serial.println(array[i],HEX);
i++;
}
}

and that's what I get:

1 - 0
2 - 0
3 - 0
4 - 0
5 - 0
6 - 0
7 - 0
8 - 0
9 - 0
10 - 0
11 - 0
12 - 0
13 - 0
14 - 0
15 - 0
16 - 0
17 - 0
18 - 0
19 - 0
20 - 0
21 - 0
22 - 0
23 - 0
24 - 0
25 - 0
26 - 0
27 - 0
28 - 0
29 - 0
30 - 0
31 - 0
32 - 0
33 - 0
34 - 0
35 - 0
36 - 0
37 - 0
38 - 0
39 - 0
40 - 0
41 - 0
42 - 0
43 - 0
44 - 0
45 - 0
46 - 0
47 - 0
48 - 0
49 - 0
50 - 0
51 - 0
52 - 0
53 - 0
54 - 0
55 - 0
56 - 0
57 - 0
58 - 0
59 - 0
60 - 0
61 - 0
62 - 0
63 - 0
64 - 0
65 - 0
66 - 0
67 - 0
68 - 0
69 - 0
70 - 0
71 - 0
72 - 0
73 - 0
74 - 0
75 - 0
76 - 0
77 - 0
78 - 0
79 - 0
80 - 0
81 - 0
82 - 0
83 - 0
84 - 0
85 - 0
86 - 0
87 - 0
88 - 0
89 - 0
90 - 0
91 - 0
92 - 0
93 - 0
94 - 0
95 - 0
96 - 0
97 - 0
98 - 0
99 - 0
100 - 0
101 - 0
102 - 0
103 - 0
104 - 0
105 - 0
106 - 0
107 - 0
108 - 0
109 - 0
110 - 0
111 - 0
112 - 0
113 - 0
114 - 0
115 - 0
116 - 0
117 - 0
118 - 0
119 - 0
120 - 0
121 - 0
122 - 0
123 - 0
124 - 0
125 - 0
126 - 0
127 - 0
128 - 0
129 - 0
130 - 0
131 - 0
132 - 0
133 - 0
134 - 0
135 - 0
136 - 0
137 - 0
138 - 0
139 - 0
140 - 0
141 - 0
142 - 0
143 - 0
144 - 0
145 - 0
146 - 0
147 - 0
148 - 0
149 - 0
150 - 0
151 - 0
152 - 0
153 - 0
154 - 0
155 - 0
156 - 0
157 - 0
158 - 0
159 - 0
160 - 0
161 - 0
162 - 0
163 - 0
164 - 0
165 - 0
166 - 0
167 - 0
168 - 0
169 - 0
170 - 0
171 - 0
172 - 0
173 - 0
174 - 0
175 - 0
176 - 0
177 - 0
178 - 0
179 - 0
180 - 0
181 - 0
182 - 0
183 - 0
184 - 0
185 - 0
186 - 0
187 - 0
188 - 0
189 - 0
190 - 0
191 - 0
192 - 0
193 - 0
194 - 0
195 - 0
196 - 0
197 - 0
198 - 0
199 - 0
200 - 0
201 - 0
202 - 0
203 - 0
204 - 0
205 - 0
206 - 0
207 - 0
208 - 0
209 - 0
210 - 0
211 - 0
212 - 0
213 - 0
214 - 0
215 - 0
216 - 0
217 - 0
218 - 0
219 - 0
220 - 0
221 - 0
222 - 0
223 - 0
224 - 0
225 - 0
226 - 0
227 - 0
228 - 0
229 - 0
230 - 0
231 - 0
232 - 0
233 - 0
234 - 0
235 - 0
236 - 0
237 - 0
238 - 0
239 - 0
240 - 0
241 - 0
242 - 0
243 - 0
244 - 0
245 - 0
246 - 0
247 - 0
248 - 0
249 - 0
250 - 0
251 - 0
252 - 0
253 - 0
254 - 0
255 - 0

Di Maio, Dario

unread,
May 5, 2015, 4:50:16 PM5/5/15
to sou...@googlegroups.com

Try with >256 please

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Gabriele Ribichini

unread,
May 5, 2015, 4:52:43 PM5/5/15
to sou...@googlegroups.com
Please note that your code was addressing just the first byte of the array since the variable i was destroyed at any loop cycle.

Di Maio, Dario

unread,
May 5, 2015, 4:56:47 PM5/5/15
to sou...@googlegroups.com

Ok keep it out of loop()

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Gabriele Ribichini

unread,
May 5, 2015, 4:57:51 PM5/5/15
to sou...@googlegroups.com
0 - 0
256 - 8
257 - 2
258 - 0
259 - 0
260 - E8
261 - 3
262 - 0
263 - 0
264 - 0
265 - 0
266 - 0
267 - 0
268 - C5
269 - 0
270 - C4
271 - 0
272 - C0
273 - 0
274 - C1
275 - 0
276 - C2
277 - 0
278 - C6
279 - 0
280 - 1
281 - 0
282 - 0
283 - 10
284 - 1B
285 - 0
286 - 0
287 - 0
288 - 0
289 - 0
290 - 0
291 - 0
292 - 0
293 - 0
294 - 0
295 - 0
296 - 0
297 - 0
298 - 0
299 - 0
300 - 0
301 - 0
302 - 0
303 - 0
304 - 0
305 - 0
306 - 0
307 - 0
308 - 0
309 - 0
310 - 0
311 - 0
312 - 0
313 - 0
314 - 0
315 - 0
316 - 0
317 - 0
318 - 0
319 - 0
320 - 0
321 - 0
322 - 0
323 - 0
324 - 0
325 - 0
326 - 0
327 - 0
328 - 0
329 - 0
330 - 0
331 - 0
332 - 0
333 - 0
334 - 0
335 - 0
336 - 0
337 - 0
338 - 0
339 - 0
340 - 0
341 - 0
342 - 0
343 - 0
344 - 0
345 - 0
346 - 0
347 - 0
348 - 0
349 - 30
350 - D
351 - A
352 - 33
353 - 33
354 - 35
355 - 33
356 - 20
357 - 2D
358 - 20
359 - 33
360 - 36
361 - 30
362 - 20
363 - 2D
364 - 20
365 - 33
366 - 36
367 - 37
368 - 20
369 - 2D
370 - 20
371 - 33
372 - 37
373 - D
374 - 2D
375 - 20
376 - 32
377 - 44
378 - D
379 - A
380 - 33
381 - 37
382 - D
383 - A
384 - 33
385 - 38
386 - 32
387 - 20
388 - 2D
389 - 38
390 - 39
391 - 20
392 - 2D
393 - 20
394 - 33
395 - 38
396 - 36
397 - 20
398 - 2D
399 - 20
400 - 33
401 - 36
402 - D
403 - 2D
404 - 20
405 - 32
406 - 44
407 - D
408 - A
409 - 34
410 - 30
411 - D
412 - A
413 - 78
414 - B3
415 - E
416 - 0
417 - 0
418 - 81
419 - E
420 - 0
421 - 0
422 - 0
423 - 0
424 - 0
425 - 0
426 - 0
427 - 0
428 - 0
429 - 0
430 - 0
431 - 0
432 - 2
433 - 0
434 - 0
435 - 0
436 - 0
437 - 0
438 - 0
439 - 0
440 - 0
441 - 0
442 - 0
443 - 0
444 - 0
445 - 0
446 - 0
447 - 0
448 - 0
449 - 0
450 - 28
451 - 17
452 - 64
453 - 0
454 - 64
455 - 0
456 - 6E
457 - 0
458 - D8
459 - 5
460 - 0
461 - 0
462 - 0
463 - 0
464 - 0
465 - 0
466 - 0
467 - 0
468 - 0
469 - 0
470 - 0
471 - 0
472 - 0
473 - 0
474 - 0
475 - 0
476 - 0
477 - 0
478 - 0
479 - 0
480 - 0
481 - 0
482 - 0
483 - 0
484 - 0
485 - 0
486 - 0
487 - 0
488 - 0
489 - 0
490 - 0
491 - 0
492 - 0
493 - 0
494 - 0
495 - 0
496 - 0
497 - 0
498 - 0
499 - 0

Di Maio, Dario

unread,
May 5, 2015, 5:02:04 PM5/5/15
to sou...@googlegroups.com

You need to keep the value at 37 for now.

Dario.

From Mobile.

Gabriele Ribichini

unread,
May 5, 2015, 5:08:21 PM5/5/15
to sou...@googlegroups.com
no problem, I will.

Di Maio, Dario

unread,
May 6, 2015, 1:55:05 AM5/6/15
to sou...@googlegroups.com

Why are you using a so large number of slot?

Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Gabriele Ribichini

unread,
May 7, 2015, 1:24:34 AM5/7/15
to sou...@googlegroups.com
The mega i/o allows it, I have 24 relays connected to it.
I need some slots for room and terrace lights.
Some slot for puffer temperatures (5x2), some slots for heating/cooling valve zone (8) others for mix valves actuation.. And so on.

Of course it could be optimized with T1A.. Right ?

Di Maio, Dario

unread,
May 7, 2015, 1:45:19 AM5/7/15
to sou...@googlegroups.com

Simple digital input can be handled via T1A, Fulvio has used this for door and window status.

Dario.

From Mobile.

--
You received this message because you are subscribed to the Google Groups "souliss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to souliss+u...@googlegroups.com.
To post to this group, send email to sou...@googlegroups.com.

Di Maio, Dario

unread,
May 7, 2015, 1:51:38 AM5/7/15
to sou...@googlegroups.com

The IDE 1.6.4 has been released, so you can use that one if you want.

Dario.

From Mobile.

Reply all
Reply to author
Forward
0 new messages