# Any Python API to send frames to digimesh network?

**URL:** <https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665>\
**Category:** XBee - DigiMesh\
**Tags:** digimesh\
**Created:** [October 28, 2015, 8:51am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665 "2015-10-28T08:51:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![digilex](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@digilex](https://forums.digi.com/u/digilex)\
**Post date:** [October 28, 2015, 8:51am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/1 "2015-10-28T08:51:21Z")

</div>

Hi there,

Sorry if answers can be obvious, I’m just a complete newbie 🙂

I’ve got a digimesh network with several 865/868LP modules all configured in routers.  
As I need to address specific modules in the network, I understand I have to configure all modules in API mode …  
What I want to do is have a base station with one module in it communicating with the network.

It seems I will have to build API frames to embed data to be sent.  
Is there any python API that already exists to build digimesh frames?

Thanks!!

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 28, 2015, 9:19am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/2 "2015-10-28T09:19:23Z")

</div>

Yes there is but it is designed to work on the Digi Gateway products. You can find it in the ESP for Python on Digi’s web site.

As for all nodes being in API mode. No, not all nodes need to be in API mode. The reality is, is that the only node that should be in API mode is the master or central collector. Even then, it does not have to be in API mode. API mode only makes it so that you do not need to enter command mode to send data to different nodes. It also allows you to see the 64 bit address of the node that you receive the data from. Both of which are only helpful if you are not using an addressing protocol already.

---

<div class="post-metadata">

**Author:** ![digilex](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@digilex](https://forums.digi.com/u/digilex)\
**Post date:** [October 28, 2015, 11:03am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/3 "2015-10-28T11:03:45Z")

</div>

Thanks mvut for your answer.  
I found something from github for the python digimesh API, I’ll check how it works.  
[https://github.com/thom-nic/python-xbee/blob/master/xbee/digimesh.py](https://github.com/thom-nic/python-xbee/blob/master/xbee/digimesh.py)

However there’s still something I don’t understand in the mesh network configuration with my 865/868 LPs …  
If I want to be in digimesh config, do I have to have at least one module in API mode?  
I think I’m a bit confused with Digimesh and API 🙂

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 28, 2015, 11:15am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/4 "2015-10-28T11:15:18Z")

</div>

Absolutely No. API mode only affects the UART of that specific module. It has nothing to do with the modules function over the air. All API mode does is allow you to change destination address on the fly with each packet instead of having to enter command mode, issue the DL and DH and then exit command mode before sending the data. API mode also allows you to see who the data came from. That is all it does.

---

<div class="post-metadata">

**Author:** ![digilex](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@digilex](https://forums.digi.com/u/digilex)\
**Post date:** [October 28, 2015, 11:38am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/5 "2015-10-28T11:38:17Z")

</div>

OK I understand!  
So how do I consider my network is configured as a digimesh?  
Do I only have to set each node as a router?  
I saw some reference to digimesh in the transmit options bitfield of the transmit request frame.

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 28, 2015, 11:39am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/6 "2015-10-28T11:39:49Z")

</div>

You only need to set the TO to Mesh and the nodes as routers. The network will figure it out on their own on if you need to hop to get the data their or not.

---

<div class="post-metadata">

**Author:** ![digilex](https://avatars.discourse-cdn.com/v4/letter/d/bbce88/32.png) [@digilex](https://forums.digi.com/u/digilex)\
**Post date:** [October 28, 2015, 11:55am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/7 "2015-10-28T11:55:14Z")

</div>

last question maybe 🙂  
Suppose I want the following configuration:

1. module A from which orders will be sent either to a specific module or to all of them.
2. modules B, C, D , E which will receive data from A and must be able to send data to A.  
What would be the configuration?  
Let me try 😉

- TO t mesh for all modules
- Router for all modules  
API for A only (as it will have to change destination addresses) and Transparent for the others as I will set DL & DH to moduleA address

Am I right? …

---

<div class="post-metadata">

**Author:** ![mvut](https://sea2.discourse-cdn.com/flex016/user_avatar/forums.digi.com/mvut/32/31_2.png) [@mvut](https://forums.digi.com/u/mvut)\
**Post date:** [October 28, 2015, 11:56am UTC](https://forums.digi.com/t/any-python-api-to-send-frames-to-digimesh-network/15665/8 "2015-10-28T11:56:56Z")

</div>

Yes that would be fine.
