Aggregating data from multiple arduinos into one sensor
-
@gohan said in pairing nodes with each other:
but it still needs the gateway to route the messages
I'm not so sure about that ...
As the receiver in the ceiling (controlling the light) will be always on, it can be set in repeater mode.
So you can set node ID in "Control node" on the schema above, which is set as reapeater.
Then in the button nodes, you set the id of the node, and also the parent which is set to the node id of the "control node".
That way the "control node" will receive & process the messages from the button nodes.So let's imagine in control node :
#define MY_REPEATER_FEATURE #define MY_NODE_ID 10And in button nodes :
#define MY_PARENT_NODE_IS_STATIC #define MY_PARENT_NODE_ID 10 // id of "control node" #define MY_NODE_ID 11And of course when sending message to the "control node" from "button node" don't forget to use setDestination.
Pretty interesting! I've been also wondering for an implementation like that. In my case, I've made a node that monitorizes various signals at the same time. I use ADCs for each of them and they aren't as fast as I wanted. Due to that, all the values refresh so slow one after another. If each one delays 1s for a reading and there are 10 of them, the resolution drops to one reading every 9s.
I thought that instead of one big board with a single busy chip it could be better to use independent AT chips for each reading, but all of them require a voltage calibration that comes from the same place and also I have local LCD display and buttons.So the better could be independent arduinos doing readings and all of them sync to a common mys node that has the lcd and buttons and posts to the gateway.
But in my case the "repeater" must interpret and work data that is not for the GW.@nca78 Nice solution. In this approach, the repeater could cancel the messages and use them for it's sake?
I guess, for me, It could be better a wired solution. Does anyone knows about one?
-
Pretty interesting! I've been also wondering for an implementation like that. In my case, I've made a node that monitorizes various signals at the same time. I use ADCs for each of them and they aren't as fast as I wanted. Due to that, all the values refresh so slow one after another. If each one delays 1s for a reading and there are 10 of them, the resolution drops to one reading every 9s.
I thought that instead of one big board with a single busy chip it could be better to use independent AT chips for each reading, but all of them require a voltage calibration that comes from the same place and also I have local LCD display and buttons.So the better could be independent arduinos doing readings and all of them sync to a common mys node that has the lcd and buttons and posts to the gateway.
But in my case the "repeater" must interpret and work data that is not for the GW.@nca78 Nice solution. In this approach, the repeater could cancel the messages and use them for it's sake?
I guess, for me, It could be better a wired solution. Does anyone knows about one?
@sergio-rius I think trying to hack MySensors is not a good idea, you would have to reprogram your hack everytime you change version. I would use a wired solution between your different boards (you can program each board as an i2c sensor using the Wire library, for example) that would report to one "main" board that would be the the MySensors node reporting to gateway, and would also be the one with lcd and buttons.
-
@sergio-rius I think trying to hack MySensors is not a good idea, you would have to reprogram your hack everytime you change version. I would use a wired solution between your different boards (you can program each board as an i2c sensor using the Wire library, for example) that would report to one "main" board that would be the the MySensors node reporting to gateway, and would also be the one with lcd and buttons.
@nca78 said in pairing nodes with each other:
I would use a wired solution between your different boards (you can program each board as an i2c sensor using the Wire library, for example) that would report to one "main" board that would be the the MySensors node reporting to gateway, and would also be the one with lcd and buttons
That's a nice and elegant idea. I experimented with the AltSoftSerial library but it was so complicated or I didn't understand well how to make something different than a master-child com.
Do you know any example or writing on this? -
@gohan said in pairing nodes with each other:
Can't you use external and faster ADC chips?
The fact is that the ADCs are so fast, for a hobbist stuff. But I need them to also work as amplifier and in differential mode. So they end in 1.7sec for a reading.
I looked for industrial ones, but they were rare and the specs not clear.I hacked the ADCs resolution and "overclocked" the atmega and I reached working minimals. But I don't like having to do this.
I'm sorry for hijacking the thread.
-
@nca78 said in pairing nodes with each other:
I would use a wired solution between your different boards (you can program each board as an i2c sensor using the Wire library, for example) that would report to one "main" board that would be the the MySensors node reporting to gateway, and would also be the one with lcd and buttons
That's a nice and elegant idea. I experimented with the AltSoftSerial library but it was so complicated or I didn't understand well how to make something different than a master-child com.
Do you know any example or writing on this?@sergio-rius said in Aggregating data from multiple arduinos into one sensor:
Do you know any example or writing on this?
You can have a look at the basics here:
https://www.arduino.cc/en/Tutorial/MasterReaderMain board (screen/buttons/mysensors board) is "Master reader", and each adc board is a slave, with a different address (declared in Wire.begin(address)) so the main board just has to read data for each address one by one.
Don't know if it makes sense for your usage, and if you have enough pins, but you could also use an output on adc board/input on main board to act as interrupt and know when you have data to read from an adc board. -
@sergio-rius said in Aggregating data from multiple arduinos into one sensor:
Do you know any example or writing on this?
You can have a look at the basics here:
https://www.arduino.cc/en/Tutorial/MasterReaderMain board (screen/buttons/mysensors board) is "Master reader", and each adc board is a slave, with a different address (declared in Wire.begin(address)) so the main board just has to read data for each address one by one.
Don't know if it makes sense for your usage, and if you have enough pins, but you could also use an output on adc board/input on main board to act as interrupt and know when you have data to read from an adc board.@nca78 said in Aggregating data from multiple arduinos into one sensor:
you could also use an output on adc board/input on main board to act as interrupt and know when you have data to read from an adc board
Yes, in fact I do like this in my current board. I have all eight adc int pins wired to pin2 so I know when to stop reading. As it is sequential I don't bother. But in a discrete system would be different.
I read several articles, but all seemed to have the master-slave concept inverted for my understanding. Thank you.
I will give it a read as soon as I end with the dimmer for the living room. I always tend to complicate things, and I arrived to the third non-working iteration of the class vector for this parametric multi-dimmer. I'm going with the DimmableLedActuator sketch. ;)Edit: Seems that the link its wrong.
-
@nca78 said in Aggregating data from multiple arduinos into one sensor:
you could also use an output on adc board/input on main board to act as interrupt and know when you have data to read from an adc board
Yes, in fact I do like this in my current board. I have all eight adc int pins wired to pin2 so I know when to stop reading. As it is sequential I don't bother. But in a discrete system would be different.
I read several articles, but all seemed to have the master-slave concept inverted for my understanding. Thank you.
I will give it a read as soon as I end with the dimmer for the living room. I always tend to complicate things, and I arrived to the third non-working iteration of the class vector for this parametric multi-dimmer. I'm going with the DimmableLedActuator sketch. ;)Edit: Seems that the link its wrong.
@sergio-rius sorry I meant to post this link:
https://www.arduino.cc/en/Tutorial/MasterReader -
Perhaps using a different microcontroller could also be an option?
I'm personally not to deep in these things, so this might be completely wrong, but at first sight I'd try to get this working with a STM32F1 board. Seems that using them in conjunction with direct access to the ADC might speed up things, see http://wiki.stm32duino.com/index.php?title=API#Reading_from_.26_Writing_to_pins as a short reference.
And using MySensors with STM32F1 seems to be used by several users here.