This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How can I send RBG data over mesh?

Based on the demonstration video of Thingy, I can have a view on Thingy is changing its color when it is given different command using the apps. 

1. As if I want to send RBG( Red, blue, green) commands to nRF52832 with development kit of PCA10040 over mesh, is it practical?

2. Or, must I implement UART over mesh to send RBG (Red, Blue, Green) data command? 

Also, from the video of the period 0:47 to 1:00, I saw that it is told "The phone is connected to only 1 node and the node is a gateway, so when I send a command, the command goes to the Gateway and from the Gateway, it goes to all the nodes."

3. Does it show that we can implement 1-to-1 mesh but we may have many devices as output?

4. As I have known, Thingy is also using nRF52832 as well. But, it is shown that Thingy can be used to control the LEDs with different colors. Is there any example code for it? If I used the 'light switch' example in the folder 'nrf5_SDK_for_Mesh_v2.0.1_src', will it work as shown in the video?

  • send RBG( Red, blue, green) commands ... is it practical?

    Yes, of course - it would only require 3 bytes at most - 1 for Red, 1 for Green, 1 for Blue.

    It can be done in a single byte: en.wikipedia.org/.../8-bit_color

  • What I have mentioned in Question 1 is that the way to make it practical. Sorry that I have make the sentence quite confusing. anyway, thanks for the reply from awneil.

  • Hello,

    The Thingy:52's in the video that you linked to are not running the normal Thingy firmware, just so you are aware of this. They are running a Mesh demo, which you can find here. Note that it is written in the old Mesh SDK_v1.0.1. As Pratyush explains in the video, the phone is connected to a gateway node via BLE. The gateway node is running both BLE and Mesh, so it will forward commands from the phone to the Mesh network.

     

    1. The demo does not use RGB values. See the description of the communication protocol in the link above.

    2. The demo has a sort of UART protocol, but not over mesh.

    3. No. The phone is connected to the gateway node via "regular" BLE, not mesh.

    4. The demo uses the Thingy SDK, which has a driver for the lights. I haven't looked into exactly what it uses, but I assume it is some PWM driver for the LEDs with different colors.

     

    Please see the demo in the link. It has a quite thorough explanation on how to run the demo, and let me know if you run into any problems.

     

    All this being said, is correct. You can implement an RGB model in the lightswitch example. You would need to modify the model to contain 3 variables, or alternatively 1 variable  (byte) containing all 3 LEDs.

     

    Best regards,

    Edvin

     

    Best regards,

    Edvin

  • Thanks, Edwin. 

    Sorry, I am still new to this technology. I have doubts to be solved.

    1.Must I use Nordic Thingy to achieve UART over a gateway node to all device connected? But, how do I can implement that without using UART over mesh?

    2. For the answer of question 2,if the demo has a sort of UART protocol, so can I do the same process ( control 1 unit to light up any other bluetooth device) by using nRF528xx series. In more precise, it is PCA10040 development kit.

    3. For the answer of question 3, how do I link all the extra devices since UART is designed to have 1-to-1 communication? From the answer given, the phone is connected to the gateway node via "regular" BLE. But, in the video, the engineer used 1 gateway node to light up every device connected to the gateway node.

  • Hello,

    1: No. You don't need to use the Thingy:52 to achieve UART over Mesh. The Thingy has an nRF52832, along with a bunch of sensors. If you want to, you can only pick up the UART over mesh part, and it should work on either a nRF52832 DK (PCA10040). The project that I linked to is the demo that was used in the video, and it is written for a Thingy. It will not work directly on a DK, since it doesn't have all the different sensors, so you will probably get some errors during runtime if the project is not modified.

     

    2: In the video, the demo consists of 2 parts. One part is the phone app, using UART over BLE (Nordic Uart Service = NUS). The phone is connected to one of the Thingys running a project with both BLE and Mesh. The rest of the Thingys are running a project with only Mesh. The light control is, as far as I know, a proprietary Mesh model. So you can't turn on any Mesh device, but it should work on all nodes running that project.

     

    3: Mesh is built on something called Models. In a mesh network, it is the commissioner node that decides what models different nodes should listen to, or publish to. So if you have a model with "UART over Mesh", you can tell all the nodes to publish on one channel, which everyone else is listening to. This way, you can use the UART over Mesh to talk not only between 1-to-1 but many-to-many. We don't have an example in the mesh SDK doing exactly this, but you may be able to extract the parts that you need from the demo link that I sent, and use it in an example from the SDK.

     

    Best regards,

    Edvin

Related