Olimex Support Forum

DUINO => PINGUINO => Topic started by: TuxD3v on May 16, 2013, 08:44:45 PM

Title: Running zigbee example in pinguino micro
Post by: TuxD3v on May 16, 2013, 08:44:45 PM
Hi guys,

i have a problem runnging zigbee module example for pinguino micro.

i downloaded the example code from pinguino micro page.

I have one zigbee module(it will be a End Device), ON, but not configured(I assume they are equal, i haven't touch the code inside the zigbee modules).

I copy & paste the code example in punguino ide, compiled it and send it to pic32 pinguino micro, attached to it are a zigbee module(I do NOT altered the code in it).

So my idea is see whats going on with this example, and how i can make things....



I can see when, I reset the pinguino micro, this in ttyACM0:


----------------------------------------//this was added by me                                       
Press a key to init the ZIGBEE module                                           
-----------------------------------------//this was added by me(i do not press any key, but it continue)
Connection to module is open. Now you need to:

1) Push the RST button on the MOD-ZIGBEE coordinator
---to start a fresh network. It should repost 'joining permitted'

2) Power up/reset your ZIGBEE sensors; they should find the
---network automatically; Pinguino will report adding a new device
---at the first available position. Note: Default free positions are 5
---but you can change that in the source code of the example

3) After connecting all your devices to the network, press the
---button next to the C17 resistor on your MOD-ZIGBEE coordinator

But I am unable to see what pinguino micro received from zigbee module (via uart2) in virtual console.

When we are following the instructions above, we can't see any repply from pinguino micro showing us  whats going on in zigbee module  :-\

the idea of this example is show us what devices are added to zigbee module, etc.
but I can't see it.

Pinguino micro uses a loop{} function, but this example use timers and interrupts instead.

where do you guys think that its the problem ??

thanks in advance.

regards
tux
Title: Re: Running zigbee example in pinguino micro
Post by: TuxD3v on May 17, 2013, 03:13:15 PM
Any help please?

thanks
tux
Title: Re: Running zigbee example in pinguino micro
Post by: maria_olimex on May 22, 2013, 09:05:52 AM
Hello TuxD3v,

The example for pinguino-micro and mod-zigbee requeres several zigbee boeards.
-- The one connected to pinguino should be programmed with a .hex file for a COORDINATOR (we sell it this way by default)
-- Zigbee sensors as separate boards, such as MOD-ZIGBEE-PIR. The ones who will be joining the network need to be programed with different .hex files so that they will have different MAC addresses.

This and more info can be found in the project README and on the Zigbee product pages.

As for your other question, I used an interrupt, because it provides a good way to continuously check the serial buffer and react to information from the Zigbee immediately. Meanwhile, something else can be done in the loop() function, but it won't in any way slow down the reaction to triggered sensors, because the interrupts happen however many times a second we choose at the right time regardless of what is happening.

Note: If the reaction you write for a particular device takes up a lot of time, you might want to start Timer1 before calling device_react or simply raise some flags and call device_react in loop()

Best Regards,
Maria/OLIMEX