OpenZB module
Moderator: paolo.gai
OpenZB module
Hi everybody,
I have a question for you over the wireless module.
I have seen on the web site that the new version (1.4.3) is released with the module named: \"OpenZB Zigbee stack\".
There is a demo or a manual to use it? I have searched on the web site but I have found nothing.
Thank you, and compliments for the good work done!
Marco
I have a question for you over the wireless module.
I have seen on the web site that the new version (1.4.3) is released with the module named: \"OpenZB Zigbee stack\".
There is a demo or a manual to use it? I have searched on the web site but I have found nothing.
Thank you, and compliments for the good work done!
Marco
Re:OpenZB module
Hi Marco,
The OpenZB module has been developed thanks to a collaboration between the IPP-HURRAY! group from the University of Porto in portugal and the ReTiS Lab of the Scuola Superiore S. Anna.
Version 1.4.3 contains a preliminary version of the stack, together with an integration with Scilab and Scicos that we showed in an example at the Microchip MASTERS in phoenix last July.
Moreover, a set of examples have been developed my the guys at the ReTiS Lab, and presented in the Training Course we organized in Pisa in June.
But you are right... for some reason the OpenZB demos slipped out of the ERIKA Enterprise release 1.4.3. In effect, they discovered it just a few days ago, and the situation will be probably fixed in a few days... We\'ll send you another message here on the forum when some demo will be available...
Ciao,
PJ
The OpenZB module has been developed thanks to a collaboration between the IPP-HURRAY! group from the University of Porto in portugal and the ReTiS Lab of the Scuola Superiore S. Anna.
Version 1.4.3 contains a preliminary version of the stack, together with an integration with Scilab and Scicos that we showed in an example at the Microchip MASTERS in phoenix last July.
Moreover, a set of examples have been developed my the guys at the ReTiS Lab, and presented in the Training Course we organized in Pisa in June.
But you are right... for some reason the OpenZB demos slipped out of the ERIKA Enterprise release 1.4.3. In effect, they discovered it just a few days ago, and the situation will be probably fixed in a few days... We\'ll send you another message here on the forum when some demo will be available...
Ciao,
PJ
Re:OpenZB module
I have tried to use the library \"ieee802154\" adding in the conf.oil file this code:
EE_OPT = \"__ADD_LIBS__\";
LIB = ENABLE { NAME = \"ieee802154\"; };
and then in the file that I use to run the library, I have add the command #include \"...\"
The problem is that building the project the compiler don\'t find the file of the library.
Is correct the configuration I have used to add library, or there is something incorrect?
Marco
EE_OPT = \"__ADD_LIBS__\";
LIB = ENABLE { NAME = \"ieee802154\"; };
and then in the file that I use to run the library, I have add the command #include \"...\"
The problem is that building the project the compiler don\'t find the file of the library.
Is correct the configuration I have used to add library, or there is something incorrect?
Marco
Re:OpenZB module
Hi Marco,
I think that you included the file without mentioning the directory. for eg: #include \"Nwl.h\" will not work. You have to add
#include \"nwl/Nwl.h\".
Please find attached a demo example of ieee802154 application.
You should put the unzipped directory inside ee/examples/pic30/
Then you can create a new ieee80154 project from the RT-Druid templates in eclipse.
Also remember to change the device type inside the conf.oil.
Use CFLAGS = \"-DDEVICE_TYPE_COORDINATOR\"; for the coordinator,
CFLAGS = \"-DDEVICE_TYPE_END_DEVICE\"; for the end device.
If the problem persists send us the compilation error.
Regards
Mangesh.
I think that you included the file without mentioning the directory. for eg: #include \"Nwl.h\" will not work. You have to add
#include \"nwl/Nwl.h\".
Please find attached a demo example of ieee802154 application.
You should put the unzipped directory inside ee/examples/pic30/
Then you can create a new ieee80154 project from the RT-Druid templates in eclipse.
Also remember to change the device type inside the conf.oil.
Use CFLAGS = \"-DDEVICE_TYPE_COORDINATOR\"; for the coordinator,
CFLAGS = \"-DDEVICE_TYPE_END_DEVICE\"; for the end device.
If the problem persists send us the compilation error.
Regards
Mangesh.
- Attachments
-
- pic30_openzb_demo.zip
- (24 KiB) Downloaded 529 times
Re:OpenZB module
Thanks mangesh!
Marco: a small note on how to use the file: just copy it into a subdirectory of the examples directory in the Evidence installation. Then, you\'ll be able to access the example when creating a new project...
bye
PJ
Marco: a small note on how to use the file: just copy it into a subdirectory of the examples directory in the Evidence installation. Then, you\'ll be able to access the example when creating a new project...
bye
PJ
Re:OpenZB module
Thank you for the demo.
Now the system works, anyway I still have a compiler error because it marks as not found the header Nwl.h, here there is the compilator error:
- nwl/Nwl.h: No such file or directory,
anyway the compilation terminate successfully, I think it\'s only a bug of the compiler and so I want to point out it.
I need to manage the radio channel and the GTS mechanism. I have difficulty to understand the code without a guide, so can you tell me how can I set the GTS?
Thanks,
Marco
Now the system works, anyway I still have a compiler error because it marks as not found the header Nwl.h, here there is the compilator error:
- nwl/Nwl.h: No such file or directory,
anyway the compilation terminate successfully, I think it\'s only a bug of the compiler and so I want to point out it.
I need to manage the radio channel and the GTS mechanism. I have difficulty to understand the code without a guide, so can you tell me how can I set the GTS?
Thanks,
Marco
Re:OpenZB module
For the compiler you are quite right, it shall be fixed in future, so don\'t care.
In order change the default radio channel, which is 26, you can use the this compiler directive -DOPENZB_CHANNEL=25; in this example I selected channel 25.
You can set this in the .oil (here there\'s an example).
Now let\'s go the GTS problem.
Since the 802.15.4 stack has been released in preliminary version the GTS allocation mechanism is statically implemented in the library source code.
To allocate GTS you should modify the Mac.c file in the ieee 802.15.4 library path.
So open the file evidence_root_dir/ee/contrib/ieee802154/libsrc/mac/Mac.C, where evidence_root_dir is tipically c:\\Evidence\\Evidence, end change the init_mac() function in the section reported below.
You can explicitly specify the allocation of the GTSs by means of the add_gts_entry() function.
The usage of the function is:
[ul]
[*]The start_slot_index is a test parameter, sorry :( ,and it shall be removed in future. Set this so that the gts_length does not overflow the 15th slot.
[*]The addresses are statically defined in the source code: 0x1234 is the coordinator, 0x0002 is the device.
[*]The allocation of the GTS must be done for both transmission and reception.
[/ul]
Let\'s consider the example above to make it clear.
The first line allocate one GTS in reception mode for the coordinator in the 11th slot, the second line allocate the same GTS in transmission mode for the coordinator.
Don\'t forget that to send in GTS mode you have to set to one the last parameter in the openZB_send_bytes() function.
I hope that\'s will help you.
Regards,
Christian.
In order change the default radio channel, which is 26, you can use the this compiler directive -DOPENZB_CHANNEL=25; in this example I selected channel 25.
You can set this in the .oil (here there\'s an example).
Code: Select all
CPU mySystem {
OS myOs {
LIB = ENABLE { NAME = "ieee802154"; };
CFLAGS = "-DDEVICE_TYPE_COORDINATOR";
CFLAGS = "-DOPENZB_CHANNEL=25";
};
};
Since the 802.15.4 stack has been released in preliminary version the GTS allocation mechanism is statically implemented in the library source code.
To allocate GTS you should modify the Mac.c file in the ieee 802.15.4 library path.
So open the file evidence_root_dir/ee/contrib/ieee802154/libsrc/mac/Mac.C, where evidence_root_dir is tipically c:\\Evidence\\Evidence, end change the init_mac() function in the section reported below.
Code: Select all
#ifdef DEVICE_TYPE_COORDINATOR
init_GTS_db();
init_GTS_null_db();
init_gts_slot_list();
init_available_gts_index();
//add_gts_entry(4,1,0x1234,7);
//add_gts_entry(4,0,0x0002,7);
add_gts_entry(1,1,0x1234,11);
add_gts_entry(1,0,0x0002,11);
#endif
The usage of the function is:
NOTE:add_gts_entry(gts_length, direction, dest_address, start_slot_index)
[ul]
[*] gts_length: Number of slots to allocate (max 15)
[*] direction: 0=send, 1=receive
[*] dest_address: destination address
[*] start_slot_index: starting slot for the allocation of the GTSs (from 1 to 15)
[/ul]
[ul]
[*]The start_slot_index is a test parameter, sorry :( ,and it shall be removed in future. Set this so that the gts_length does not overflow the 15th slot.
[*]The addresses are statically defined in the source code: 0x1234 is the coordinator, 0x0002 is the device.
[*]The allocation of the GTS must be done for both transmission and reception.
[/ul]
Let\'s consider the example above to make it clear.
Code: Select all
add_gts_entry(1,1,0x1234,11);
add_gts_entry(1,0,0x0002,11);
Don\'t forget that to send in GTS mode you have to set to one the last parameter in the openZB_send_bytes() function.
I hope that\'s will help you.
Regards,
Christian.
Re:OpenZB module
Hello,
I have two c2420 radios connected to two Flex.
I use for the comunication the demo released in this topic and I have followed your instructions to set the GTS mechanism, but it does\'t work correctly. Whithout GTS the comunication works, while using GTS the radios don\'t comunicate.
I have watched the code and I have seen that in file \"mac.c\" the function \"start_coordinator_gts_send()\" is fully commented and the task \"send_gts_after_interframearrivalTask\" probably isn\'t complete.
So I want ask you if the GTS mechanism is completly implemented in the demo or not. If not, what is done?
Bye,
Stefano
I have two c2420 radios connected to two Flex.
I use for the comunication the demo released in this topic and I have followed your instructions to set the GTS mechanism, but it does\'t work correctly. Whithout GTS the comunication works, while using GTS the radios don\'t comunicate.
I have watched the code and I have seen that in file \"mac.c\" the function \"start_coordinator_gts_send()\" is fully commented and the task \"send_gts_after_interframearrivalTask\" probably isn\'t complete.
So I want ask you if the GTS mechanism is completly implemented in the demo or not. If not, what is done?
Bye,
Stefano