Total Noob to mysensors Looking at feasibility of a project
-
I just stumbled across the MySensors Library and I think it will work for a project I am working on. This library has made me think of a different implementation of an existing project. Essentially I want to control multiple Arduinos wirelessly using one Master Arduino with multiple slave Arduinos using NRF240l01 radio transcievers. The master would send commands to the slaves and each slave would control digital potentiometers using I2C. Basically I'm just wondering if MySensors will allow me to do this.
-
Hi @Danton-Barnes, welcome to the community.
Yes, you can send messages between nodes like you describe in your scenario.
-
Awesome! So I'm trying to figure out this architecture. I would have a Arduino Gateway which can have N slaves is that correct? Also the controller thing. I'm just trying to understand. I need a Controller for the gateway correct? Would it be possible to make the Gateway itself the controller with a TFT touchscreen interface? Even better a custom android/IOS/windows UWP app? Is any of this possible?
Thanks in advance
-
You only need a controller if you want to be able to use the id-handout feature or requesting time from your nodes. If you need fancy stuff like apps, a controller is also needed.
If you don't need these features (and use static ids!), just skip it.
-
@hek Awesome. Thanks man. For now I think I'm just going to use Static IDs. Is there a starter tutorial for creating a small network like what I am talking about? Or even a tutorial just for master to a single slave comms would help me get started.
-
@hek Also how many devices can you talk to from a single gateway?
-
@Danton-Barnes the "Getting started" link at the top of this page could be a good start
It leads to https://www.mysensors.org/about/network which says you can have 254 devices in a single radio network. (This includes the gateway, so 253 sensor nodes.)
Many controllers have app or mobile web interface so you can probably just try a controller and see if you like it.
You can also create a node that acts as "control panel" (which is not the same as a controller). See these examples for inspiration:
https://www.openhardware.io/view/23/In-wall-LCD-SwitchScene-controller-for-MySensors
https://www.mysensors.org/build/scene_controller
-
@mfalkvidd Thanks. I looked through and read that page, but couldn't find any code examples on how to assign an id address or any of that. Is there a resource for that?
-
@mfalkvidd The node as a control panel is exactly what I have in mind. Thanks for the direction.
-
@Danton-Barnes use #define MY_NODE_ID 42 before including MySensors.h to give the node id 42. Details on https://www.mysensors.org/download/sensor_api_20
-
@mfalkvidd Ok I'm beginning to understand it. I'm currently in Afghanistan for my job and will be until April. I started researching for this project before I left then stumbled across all this. Sorry for all the question I'm just trying to wrap my head around where this works. So in the example with the "Control Panel." Is the control panel the gateway as well? Also what would the other end look like? How would I send a command to node 42 is what I am asking.
-
@Danton-Barnes said:
@mfalkvidd Ok I'm beginning to understand it. I'm currently in Afghanistan for my job and will be until April. I started researching for this project before I left then stumbled across all this. Sorry for all the question I'm just trying to wrap my head around where this works. So in the example with the "Control Panel." Is the control panel the gateway as well? Also what would the other end look like? How would I send a command to node 42 is what I am asking.
No worries. We've all been new to this stuff
The control panel can be the gateway, but doesn't need to. It can be a node just like anything else.
Maybe this code, a pump with a remote, is a better example for your use case. The remote sends commands to the pump. The pump has node id 7.
The other end could be like in the pump code, or like the led dimmer example, except that you would send a value to your potentiometer instead of setting the pwm level for a led.
-
@mfalkvidd Yes! Perfect place to start. I will look at the controller as a node later. Could the "remote" in the example you just provided still communicate to the 254 total nodes or is it limited? Please tell me it can... My mind will be blown.
-
@Danton-Barnes any node on a MySensors network can send a message to any other node. Messages will be routed automatically by MySensors.
If you have multiple MySensors networks (due to >254 nodes or geographically separated networks) you'll need a controller to route messages between the networks though.
-
@mfalkvidd Very cool. I'm not looking at more than that so the setup I have in mind should work. Thanks for the help! I'll probably bug you guys more in April-May when i get back home.