# Phyton script for X2 reading from ZB and posting to IDIGI

**URL:** <https://forums.digi.com/t/phyton-script-for-x2-reading-from-zb-and-posting-to-idigi/2796>\
**Category:** Python\
**Created:** [July 18, 2011, 1:34pm UTC](https://forums.digi.com/t/phyton-script-for-x2-reading-from-zb-and-posting-to-idigi/2796 "2011-07-18T13:34:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![massimo.marcon](https://avatars.discourse-cdn.com/v4/letter/m/eb8c5e/32.png) [@massimo.marcon](https://forums.digi.com/u/massimo.marcon)\
**Post date:** [July 18, 2011, 1:34pm UTC](https://forums.digi.com/t/phyton-script-for-x2-reading-from-zb-and-posting-to-idigi/2796/1 "2011-07-18T13:34:31Z")

</div>

Hi, I got a X2-Z11-EC-W that I’m tryng to program to read a string of data coming from serial port of a Arduino board connected to a Xbee-PRO S2 by a Sparkfun Xbee shield.  
I want to post the data received by X2 to IDigi possibly in the form of a TCPCSV presentation.  
Question: can you address me to a phyton example similar to what I want to do?  
regards

---

<div class="post-metadata">

**Author:** ![shahrj1988](https://avatars.discourse-cdn.com/v4/letter/s/c4cdca/32.png) [@shahrj1988](https://forums.digi.com/u/shahrj1988)\
**Post date:** [July 18, 2011, 6:12pm UTC](https://forums.digi.com/t/phyton-script-for-x2-reading-from-zb-and-posting-to-idigi/2796/2 "2011-07-18T18:12:48Z")

</div>

Try Binding two zigbee nodes as described at the following link:

[http://www.digi.com/wiki/developer/index.php/ZigBee\_Extensions\_to\_the\_Python\_socket\_API](http://www.digi.com/wiki/developer/index.php/ZigBee_Extensions_to_the_Python_socket_API)

and than go through iDigi Web Service Programming guide to upload data to the iDigi data storage or you can use built in cwm function to upload data to idigi data storage as described in one of the sample project in Digi ESP for python.

For uploading data to iDigi Data storage, you can use http put request along with base64 encoded user name and password. You can also go through following link for your reference.

[http://www.digi.com/wiki/developer/index.php/ConnectPort\_X3\_-\_GPRS%2C\_232\_interface\_-\_Demo\_Application](http://www.digi.com/wiki/developer/index.php/ConnectPort_X3_-_GPRS%2C_232_interface_-_Demo_Application)
