Welcome!

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together.


0
Avatar

Juergen Kienhoefer

--Juergen Kienhoefer--

2534
| 4 1 2
Santa Cruz, United States
--Juergen Kienhoefer--
Juergen Kienhoefer
On 12/30/15, 12:00 AM

We designed the AIRcable SmartBeacon as a test tool for the CSRmesh as well as a CSRmesh light switch, running on batteries. The commands allow to configure it as well as issue commands into the mesh. Responses are printed in clear text to the serial port. We also added other additional SmartMesh commands to it.

In addition the SmartBeacon can be used as a light switch. The button can be configured to send mesh commands when triggert, allowing light switching, dimming as well as mesh association.

CSRmesh Commands

The CSRmesh is implemented in broadcast mode. When broadcasting is enabled the SmartBeacon will listen for mesh commands for a certain amount of time. The broadcast interval can be set between 100ms and 109 minutes. If broadcast type is mesh only then the SmartBeacon will only run the mesh scanner for an amount of time.

Scanning

The CSRmesh uses the standard BLE advertisement scanner for receiving messages. It is possible to see them without affecting the mesh functionality

 

OK> I3

scan 3 seconds for iBeacons, raw mesh packages and our specific mesh member status packages:

iBeacon addr=f2545f06a474 name=CSRmesh tx=6 uuid=fef1 rssi=-43

mesh=53e27a83ff3dc4fa24336c84fad563ae2ca079a07c2c58

member=0xcd7b power=0x1 light=0x0, temp=28

 

Configuration

This example configures the SmartBeacon for CSRmesh only at a fast rate. The CSRmesh relay is able to retransmit packages. If a reply for a command is not heard by any of the nodes that received the mesh package, it will be retransmitted until the time to live counter is exhausted. The CSRmesh relies on scanning to receive messages. The messages are

 

OK> @bm1

configure broadcast interval for 100ms in mesh only mode

OK> #t8

configure the mesh scanner to run for 80ms

OK> #T8this command also enables the CSRmesh relay mode, to retransmit packages in the network to increase range.

 

See, if the SmartBeacon is associated to a CSRmesh

OK> #

check the CSRmesh parameters:

CSRmesh 80ms associated, id=0xcd7b, dst=0x8021

OK>

OK> @b

check for broadcast type and timing:

broadcast=100ms, type=mesh at 80ms

 

Association

At bootup, the SmartBeacon starts a 30 second association procedure. If it was associated before, it will send its association to other devices that are looking for it.

To start the mesh association procedure manually, use this command. After the SmartBeacon is associated in the network it receives the assigned device ID. The device ID tells the SmartDimmer to receive and process mesh commands for this ID.

 

OK> #a

Start CSRmesh Association

 

OK>

OK> #

check the CSRmesh association:

CSRmesh 900ms associated, id=0x8021, dst=0x0000, grp=0x0001

OK>



 

Destination, Members and Groups

Deatination is a 16 bit device ID number. Destinations are devices you are sending commands to. The first bit set notates an individual light. A group is a number between 0 and 0x7FFF. The destination number 0 is received by all members in the network. A CSRmesh member is a unique ID the CSRmesh scanner is listening for commands. You can dynamically overwrite the CSRmesh member ID and receive commands for that device. A group membership is also a device ID the SmartBeacon is listening for. Set the group number and you can receive message for this particular group.

 

Set the destination of the mesh commands

 

OK> #d8010

temporarily set destination of the mesh commands to device id 0x8010

OK> #D8010set destination of the mesh commands to device id 0x8010 and save it
OK> #g2set group number to 2
OK> #i8010overwrite own device ID with 0x8010

 

Mesh Commands

 

CSRmesh light set to 100

 

OK #l100

send a light intensity command to 100, range 0-255.

In our SmartDimmer, this means 100% power.

Toggle light is #l128 and step light is #l129


Mesh Color Command

Even though we are not using colors in our standard light switch, you can still send color commands. The arguments are in hex.

 

OK> #cff ff ffsend color command, 3 bytes for RGB to the destination without a reply

OK> #C60 60 60

Send color R G B to decimal 96 for all colors.

This is the response to the command from a mesh member that implements the color command

OK> Received Light State 0x010060606000000002

 

Stream Messages

 

OK> #sHALLO

send a message "HALLO\r" to the configured destination

OK> #r

enable raw mode, just like SPP over GATT, all typing goes over the CSRmesh to the configured destination

 

Configuring The Button

The button on some editions of the SmartBeacon can be configured to send mesh commands.

 

OK> @km

A button press will send CSRmesh power command. Depending on a received state, the command is on or off. If no state is received it toggles between on and off.

OK> @kl

Configure the button for light commands. Clicks send light toggle command and long press will repeatedly send light step commands to the configured destination.


 

Receiving CSRmesh Commands

When running in CSRmesh mode, mesh commands to the device id are printed in text. In addition the digital output pin on the SmartBeacon is switched on:

 

OK>

mesh_power=1

 

mesh_light=0x64

 mesh_color=0x646464

OK> #L100

Sending a light command with return response will print the response package (light model data structure)

OK> Received Light State 0x006400000000000001

OK> #P1

The power command can repeat the message until the result is received.

OK> Received Power State 0x1

Received Power State 0x1

Received Power State 0x1

 


Keep Informed

About This Community

This community is for professionals and enthusiasts of our products and services. Share and discuss the best content and new marketing ideas, build your professional profile and become a better marketer together. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 12/29/15, 11:54 PM
Seen: 4513 times
Last updated: 12/30/15, 12:52 AM