bitcloud HADevice Application - Page 1
Forum section: electronics / general

author: sandeep.b2
author_rank: Contributor
timestamp: May 05, 2016, 10:10:50 am
content: HI guys,I have 3 zigbit explained extention boards(atmega256rfr2). Can i make demo for home automation profile using HADevice application provided in bitcloud setup.?Please tell me from where to proceed.Thanks in advance.

author: ataradov
author_rank: Super Contributor
timestamp: May 05, 2016, 09:17:30 pm
content: Just build the application. You will need Combined Interface (CI) for a gateway and then two other device. Dimmer Switch and Thermostat will do.You will have some logging and command line interface on the CI device.It is not a very interesting demo, because it is hard to come up with an HA demo that works well on devices without buttons or displays, but it is enough to get the point across.The rest depends on your final goal. Usually you want to have some HA system and only make one device to be a part of that system.

author: sandeep.b2
author_rank: Contributor
timestamp: May 13, 2016, 09:06:09 am
content: hi ,I have three zigbit xplained pro extention board which is having Atmega256rfr2. I want to send data wirelessly so i choose Atmel's light weight protocol. In first board, i downloaded peer@peer application code came with LWM stack with with APP_ADDR = 0 and in another with APP_ADDR=1.All remaining things kept same.But when i powered up nothing is received at APP_ADDR=1 node. Do i need to connect some antenna to extention boards.Link for extention board:http://www.atmel.com/Images/Atmel-42186-ZigBit%20Extension-User-Guide.pdf

author: ataradov
author_rank: Super Contributor
timestamp: May 13, 2016, 04:06:42 pm
content: How and where do you connect UART pins?

author: sandeep.b2
author_rank: Contributor
timestamp: May 13, 2016, 04:13:37 pm
content: Hi Alex,Thanks for quick reply.I have connected UART Rx and Tx tins to computer's COM port through Arduino Uno.(Using only Rx Tx of Arduino,Controller is removed.)

author: ataradov
author_rank: Super Contributor
timestamp: May 13, 2016, 04:17:02 pm
content: What exact pins of the module you have connected? Also what COM port settings you are using?I'm can't find the schematic for this board. Just for a quick test, can you change "#define HAL_UART_CHANNEL 1" to 0?

author: ataradov
author_rank: Super Contributor
timestamp: May 13, 2016, 04:23:52 pm
content: Ok, found the table. 13-USART_RX-28-PD3-TXD1 and 14-USART_TX-27-PD2-RXD1, so HAL_UART_CHANNEL == 1 is a correct setting.But if you are using a version from ASF, then default setting may be different, so check that.

author: sandeep.b2
author_rank: Contributor
timestamp: May 13, 2016, 05:15:41 pm
content: I have used HAL_UART_CHANNEL==1. And if i use HAL_UartWriteByte('s'); It prints properly on COM port.Actually i have slightly modified the code. I have written appSendData() in while loop in main after appTaskHandler of APP_ADDR=0.So it should send data directly to APP_ADDR =1 thru RF without taking input from COM port(right?).I have done this change because I am using Zigbit xplained pro extension board only(without zigbit xplained pro) and when i did simple blinking program it used to hang so i found solution by connecting pin 14-USART_TX-27-PD2-RXD1 to high. So i skipped recievng input from COM port.

author: ataradov
author_rank: Super Contributor
timestamp: May 13, 2016, 05:21:47 pm
content: Nothing should be hanging even withtout XPro. I have no idea how your modification might have affected anything, but if your RX channel does not work, then appUartBufferPtr will always be 0 and nothing will ever be sent.

author: sandeep.b2
author_rank: Contributor
timestamp: May 13, 2016, 06:58:30 pm
content: ok . I got it. But what should i do with hanging problem. I only connected power and gnd to Zigbit. Programming using JTAG. But as soon as as i download any code for ex. RED LED glowing,it hangs. All LEDs glows with very low intensity.

author: ataradov
author_rank: Super Contributor
timestamp: May 13, 2016, 07:13:47 pm
content: LEDs will probably not match, since the code is not written for that board, so don't pay attention to the LEDs.If you have JTAG, why not debug it and see where it is hanging?

author: sandeep.b2
author_rank: Contributor
timestamp: May 13, 2016, 07:33:37 pm
content: The board works properly in debug mode. And leds are not problem as it works perfectly in debug mode. Also everytging works fine if i connnect rx to high.

author: ataradov
author_rank: Super Contributor
timestamp: May 13, 2016, 07:35:54 pm
content: I have no idea what is going on. I can't help help unless you provide more information.It is impossible that works under the debugger and does not work on its own.

author: sandeep.b2
author_rank: Contributor
timestamp: May 15, 2016, 03:57:47 pm
content: Hi Sir,Everything is working fine now. I tested Peer2Peer application . LWM is really good and easy to understand.Thanks a lot for help.Now I am developing an application in which a node will transmit a string to another . I am using the code from SimpleRemote application to transmit data on button press event. I modified appSendMessage() function like below:static void appSendMessage(uint8_t state){// appMessage.buttonState = state;appNwkDataReq.dstAddr = 1 - APP_ADDR;appNwkDataReq.dstEndpoint = APP_ENDPOINT;appNwkDataReq.srcEndpoint = APP_ENDPOINT;appNwkDataReq.options = NWK_OPT_ACK_REQUEST;appNwkDataReq.data = "Hello World!!";//(uint8_t *)&appMessage;appNwkDataReq.size = 13;//sizeof(appMessage);appNwkDataReq.confirm = appDataConf;NWK_DataReq(&appNwkDataReq);appState = APP_STATE_WAIT_CONF;}But this transmits garbage characters to other node. I cant figure outwhy this is happening.

author: ataradov
author_rank: Super Contributor
timestamp: May 15, 2016, 06:19:18 pm
content: How do you know that garbage is transmitted?

author: sandeep.b2
author_rank: Contributor
timestamp: May 16, 2016, 08:44:04 am
content: I found problem , it was because i mistakenly connected 5 v instead of 3.3 v. (And i know it was garbage because i send it to PC's COM port for debug.)Now Will u please suggest me weather can I use Bitcloud HA profile for my application I explained below:I am designing a Home automation project in which there is a master and several slaves. Master and slave both will be Atmega256rfr2 operated nodes(mostly Zigbits). For one house there will be one master and there will be one slave per room.So if a house has 4 rooms so in that case 1 master 4 slaves. Every slave will have several devices connected to it like lights ,fans etc. Master will control all the devices on each room. It should send commands to ON/OFF particular light in particular room.So as per my understanding, in bitcloud HA profile, there is only one device connected to a zigbee radio but in my application there may be several devices connected to it. So can i use bitcloud here? if yes ,How?

author: ataradov
author_rank: Super Contributor
timestamp: May 16, 2016, 04:09:49 pm
content: Quote from: sandeep.b2 on May 16, 2016, 08:44:04 amIt is possible to have multiple devices on the same radio with ZigBee. But to use ZigBee HA you HAVE to be familiar with ZigBee protocol and ZigBee Cluster Library. Strong C coding is also a prerequisite.If your home automation project does not need to interoperate with off the shelf HA devices, then stick with LwMesh.

author: sandeep.b2
author_rank: Contributor
timestamp: May 19, 2016, 06:51:10 pm
content: Hi ,Can a LwMesh node and a digi's xbee node can communicate with each other.?

author: ataradov
author_rank: Super Contributor
timestamp: May 19, 2016, 08:12:43 pm
content: Quote from: sandeep.b2 on May 19, 2016, 06:51:10 pmNo, they can't.