Author Topic: bitcloud HADevice Application  (Read 3940 times)

0 Members and 1 Guest are viewing this topic.

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
bitcloud HADevice Application
« on: May 05, 2016, 10:10:50 am »
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #1 on: May 05, 2016, 09:17:30 pm »
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.
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #2 on: May 13, 2016, 09:06:09 am »
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
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #3 on: May 13, 2016, 04:06:42 pm »
How and where do you connect UART pins?
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #4 on: May 13, 2016, 04:13:37 pm »
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.)
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #5 on: May 13, 2016, 04:17:02 pm »
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?
« Last Edit: May 13, 2016, 04:20:57 pm by ataradov »
Alex
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #6 on: May 13, 2016, 04:23:52 pm »
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.
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #7 on: May 13, 2016, 05:15:41 pm »
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #8 on: May 13, 2016, 05:21:47 pm »
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.
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #9 on: May 13, 2016, 06:58:30 pm »
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #10 on: May 13, 2016, 07:13:47 pm »
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?
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #11 on: May 13, 2016, 07:33:37 pm »
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.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #12 on: May 13, 2016, 07:35:54 pm »
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.
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #13 on: May 15, 2016, 03:57:47 pm »
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 out
   why this is happening.
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #14 on: May 15, 2016, 06:19:18 pm »
How do you know that garbage is transmitted?
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #15 on: May 16, 2016, 08:44:04 am »
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?

 
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #16 on: May 16, 2016, 04:09:49 pm »
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?
It 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.
Alex
 

Offline sandeep.b2Topic starter

  • Contributor
  • Posts: 14
  • Country: in
Re: bitcloud HADevice Application
« Reply #17 on: May 19, 2016, 06:51:10 pm »
Hi ,
Can a LwMesh node and a digi's xbee node can communicate with each other.?
 

Online ataradov

  • Super Contributor
  • ***
  • Posts: 11269
  • Country: us
    • Personal site
Re: bitcloud HADevice Application
« Reply #18 on: May 19, 2016, 08:12:43 pm »
Can a LwMesh node and a digi's xbee node can communicate with each other.?
No, they can't.
Alex
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf