Table of contents Table of contents Chapter 1: Getting Started ....................4 1.1 Introduction ...................... 4 1.2 Installing IDE ....................5 1.3 Setting up the MeshBee ..................8 1.4 Upgrade firmware ................... 10 1.5 Setting up the network ..................11 Chapter 2: Example of Mode Operation ............... 13 2.1 AT mode ......................
Introduction Chapter 1: Getting Started Introduction ® MeshBee is a 2.4 GHz wireless zigbee RF module. It use microchip JN516x from NXP that enables several different flvors of standards-based zigbee mesh networking. Our released firmware ® fully supports Zigbee Pro stack. You can use MeshBee in three different ways: Master Mode: the factory firmware warps the complicated Zigbee stack operation into a few easy to use serial commands(AT commands).
Installing IDE Installing IDE NXP provides full-scale development environment, tools and documents. The development environment consists of the SDK toolchain and the ZigBee stack SDK. Please visit NXP's website to get some detailed description: http://www.nxp.com/techzones/wireless-connectivity/smart-energy.html Note: MeshBee’s factory firmware is developed on top of the smart energy profile.
Page 6
Installing IDE Note: The developing toolchain supports windows only. For Linux and Mac users, a windows VM is recommended. When finished the installing, you can test the tool chain if you are not sure whether it is successful or not. Perform these steps: 1) Clone the latest firmware source code from github.
Page 7
Installing IDE If three binary files are generated successfully, congratulations, you have finished all the preparation work. Open eclipse IDE and import the project, you can catch a glimpse of the firmware: To edit the .oscfgdiag file and .zpscfg file, you should install the eclipse plugins according to the guide in section 6.2.2 <SDK Installation and User Guide.pdf>.
Upgrade firmware Upgrade firmware A wireless network comprises a set of nodes that can communicate with each other by means of radio transmissions according to a set of routing rules (for passing messages between nodes). ZigBee network includes three types of node: 1) Coordinator: This is the first node to be started and is responsible for forming the network by allowing other node to join the network through it.
Example of Mode operation Chapter 2: Example of Mode Operation MeshBee has four different types of mode: AT, API, DATA, MCU, illustrated in figure below: No matter which mode MeshBee works in, input “+++” can go back to AT command mode. AT mode The AT commands that MeshBee radios use for interactive are a descendant of hayes command set.
Example of Mode operation Note: The baud-rate must be set to 115200 in SecureCRT. Make sure MeshBee works in AT mode. Use AT commands is very easy. Here are the steps: 1) Input “+++” to go to AT command mode. 2) Wait for a MeshBee “ok”...
Example of Mode operation API Mode API is simply a set of standard interfaces created to allow other MCU to interact with MeshBee. For our purposes, API supports local operation and remote operation. For example, a host application can send an “ATIO” frame to Coordinator A, A will set its GPIO when it receives this frame. The most important thing to note is that APIs are specifically engineered to enable MeshBee to talk efficiently to other MCU.
Page 16
Example of Mode operation Install hardware like that: 1) Connect Arduino with MeshBee’s Coordinator through UART, switch ‘USB_UART_M8’ to M8 side, switch ‘D11/D12_XBEE_UART’ to UART side. 2) Connect MeshBee’s Router with UartBeeV5. This example will send API packet from Coordinator, and control the RSSI led on the UARTSBee where the Router is plugged in.
Example of Mode operation remoteATIO_Onoff(1); digitalWrite(led, LOW); delay(500); remoteATIO_Onoff(0); digitalWrite(led, HIGH); delay(500); /* Turn on/off remote Led */ void remoteATIO_Onoff(unsigned char onoff) { unsigned char remote_at_req[] = { 0x01, //frame ID 0x00, //option 0x70, //AT cmd index //-- start of 4 bytes 0x00, //read/write: 0x00 - write 0x09,...
Page 18
Example of Mode operation Arduino sketch: #include <Arduino.h> /* LED Pin */ int led = 13; /* declaration */ void sendDataPkt(); void setup() { pinMode(led, OUTPUT); /* open the serial port at 115200 bps */ Serial.begin(115200); void loop() { digitalWrite(led, LOW); delay(500);...
Example of Mode operation MCU Mode In order to simplify the development of application for user, we create an Arduino-ful user programming space(AUPS). The most important thing to note is AUPS is not a real Arduino because it doesn’t support Arduino-IDE. We only present two Arduino style functions: /* arduino setup */ void arduino_setup(void) {...
Example of Mode operation if(E_MODE_MCU == g_sDevice.eMode) /* Back-Ground to search AT delimiter */ uint8 tmp[AUPS_UART_RB_LEN]; uint32 avlb_cnt = suli_uart_readable(NULL, NULL); uint32 min_cnt = MIN(AUPS_UART_RB_LEN, avlb_cnt); /* Read,not pop,make sure we don't pollute user data in AUPS ringbuffer */ vHAL_UartRead(tmp, min_cnt); if (searchAtStarter(tmp, min_cnt)) /* Set AT mode */ setNodeState(E_MODE_AT);...
Example of Mode operation For more information about the function list that AUPS can call, please refer to the MeshBee User’s manual v0.1. Blink example in AUPS Blink demo in AUPS UartBeeV5’s Sleep/On Led will blink IO_T led_io; int16 state = HAL_PIN_HIGH; void arduino_setup(void) suli_pin_init(&led_io, //init led...
Handle a sleep node Chapter 3: Handle a sleep node An end device can join networks and participate in communications, but never act as a step stone for any other devices. End device always require a router or the coordinator to be their parent device. In the zigbee stack, only an end device can sleep.
Handle a sleep node Configuring Sleep There are three AT commands associated with sleep mode. An end device has four sleep behaviors, which can be set with ATSM commands. 1) ATSM0: Disable sleep mode The end device will never go to sleep in that mode even if you schedule a sleep in AUPS. 2) ATSM1,2,3: These modes are currently undefined, and retained for future use.
Make an RPC Chapter 4: Make an RPC A micro-RPC framework was implemented in MeshBee firmware. Here is the brief guide for your application programming. What's a micro-RPC? A method used for connecting two remotely placed functions by first using a protocol for connecting the processes. It’s used in the cases of distributed tasks. Micro-RPC is a tiny RPC framework on resource-limit embedded device.
Page 29
Make an RPC 4) Implement these RPC method. Rpc demo in rpc_usr.h modify to meet your request tsMethodEntity methodEntityA[] = { {0, "run", A_run}, {0, "stop", A_stop} tsMethodEntity methodEntityB[] = { {0, "run", B_run}, {0, "stop", B_stop} /* Step2, Rpc Entity: HashKey, objName, MethodArray, MethodNum */ tsRpcEntity rpcEntity[] = { {0, "home_obj1", methodEntityA, METHOD_ENTITY_SIZE(methodEntityA)}, {0, "office_obj2", methodEntityB, METHOD_ENTITY_SIZE(methodEntityB)},...
Need help?
Do you have a question about the MeshBee Series and is the answer not in the manual?
Questions and answers