Newbie on Xbee and idigi need to read a var inside xbee via idigi

Hi there I need to read one variable inside my xbee s2b pro via idigi it will be done from 10 to 10 minutes witch command should i use to read the var and witch command shhould i use to delay in 10 minutes???


What you are looking for is called XBee Internet Gateway (XIG). The XIG is an open source piece of software that makes it easy to connect XBee radios to the Internet and the iDigi Device Cloud.

Next version of the Programmable XBee SDK will give some XIG integration with the kit. Among the things it will include you will find documentation about how to install the XIG, register it in iDigi, a couple of XBee application examples (upload data to iDigi and listen for commands comming from iDigi) and 2 web applications to directly interact with your programmable XBee from the web page.

Until the new version of the Programmable XBee SDK is released, you can go to the XIG official web page and give it a try, it is really easy to use.


Yeah I already have read about this app and I have downloaded too but I still didn’t found a way to read the variable that is inside my xbee I need to know how to configure them what kind of network at, api or mesh and the code because I have no knowledge about python.

I have one x4 gateway and 2 xbees xbp24bz7sitb.

Hello Danillo,

To set a 10 mins delay you can use the function delay_ticks(). It takes as argument the amount of system ticks (4 ms) to block the process (watchdog is fed automatically). The macro ‘HZ’ is defined to use it as argument, so delay_ticks(HZ * 60 * 10) block for 10 minutes.

Non-blocking ways are to use periodic tasks or rtc_set_timeout() and poll it with rtc_timeout_expired().

To push a variable value to iDigi refer to the documentation of the XIG. You only need to send it as a string to the coordinator (start with “Transmit Simple Frames” example if you don’t know how to do it from PXBee).


You can also upload data to iDigi using your own names by sending strings to the XIG formatted in the following way:


A full example on how to use the XIG and the Programmable XBee will be included in next release. Regards,


wow thanks man i was using the rtc to delay the time.
But the way to upload from xbee to idigi is just this idigi_data: (VAR)??

thank you so much

Quite easy, isn’t it? I suggest using sprintf to build the string and some code from Transmit Simple Frames to send it. Something linke:

wpan_envelope_t env;
char buffer[100]
int variable_1, variable_2, variable_3;

wpan_envelope_create(&env, &xdev.wpan_dev, WPAN_IEEE_ADDR_COORDINATOR, WPAN_NET_ADDR_UNDEFINED);
env.payload = buffer;
env.length= sprintf(buffer, "idigi_data:"
				"names=var1, var2, var3"
				variable_1, variable_2, variable_3);


thank you so much it is working and sorry for the bad english it is because I’m from brazil whem I finish the project i will make a video and post here.

You are welcome! sorte com o projeto! :wink:

Sorry for bother you again but how can i read the values sended by the xbee i’am trying the idigi web_services and the data stream but i can’t read i tried the read_data but still nothing

I would like to read all data received without need to configure the x4 because i will rave lots of xbees sending their varables to the gateway i would like to read all the information and the owner of it the i would like to share it via internet.

I’m sorry I think I was not specific I need to receive the payload from all xbees but when I receive the payload I will need to know the node.

Hello Danillo,

Could you explain a bit better where and what data are you trying to read?

Once the XIG sends the data to iDigi it is stored in your iDigi account. You can access that data using the iDigi web services (you can develop a web application that shows it), or directly from the iDigi Device Cloud using the Data Stream service. If what you are trying to do is to read the iDigi data from a programmable Xbee I’m afraid it is not possible ATM using the XIG.


Ok as I said I am newbie on the xbee and python programing What I need is simple i just need that the xbee programable send the value of one variable to the x4. ( OK this part of the project I finaly did buffering t and sending as payload like the spastor teached me).
Now I need to know how to read this payload and the name of the node that has sented to the x4 because the starting project uses just one xbee but in the future it can be one hundred of xbees.
So I just need the payload value and the node .
After getting those informations send it to the web.
After the data goes to the web i will have one web site that will display those infomations as a graph using the time of each reading.

I hope every one can understand

I found this example on the esp python for idigi

import sys, os
import xbee
from socket import *

The Format of the tuple is:

(address_string, endpoint, profile_id, cluster_id)

The values for the endpoint, profile_id, and

cluster_id given below are the values used to write

to the serial port on an Ember-based XBee module.

DESTINATION=(“00:0d:6f:00:00:06:89:29!”, 0xe8, 0xc105, 0x11)

Create the socket, datagram mode, proprietary transport:


Bind to endpoint 0xe8 (232):

sd.bind((“”, 0xe8, 0, 0))

Send “Hello, World!” to the destination node, endpoint,

using the profile_id and cluster_id specified in


sd.sendto(“Hello, World!”, 0, DESTINATION)

the problem is i need to read what the xbee’s are sending and them from witch node

this is what I have inside my xbee now i need to read it with my x4 gateway

if (now1 < 60-rtc_get_uptime())
now1 = rtc_get_uptime();

		wpan_envelope_create(&amp;env1, &amp;xdev.wpan_dev, WPAN_IEEE_ADDR_COORDINATOR, WPAN_NET_ADDR_UNDEFINED);
		env1.payload =(buffer1);
		env1.length = sprintf(buffer1, "names=var2" "&amp;values= %d ""&amp;units=/n",variableA);

	if (now2 &lt; 30-rtc_get_uptime())
				now2 = rtc_get_uptime()-30;	
				wpan_envelope_create(&amp;env2, &amp;xdev.wpan_dev, WPAN_IEEE_ADDR_COORDINATOR, WPAN_NET_ADDR_UNDEFINED);
				env2.payload =(buffer2);
				env2.length = sprintf(buffer2, "names=var1" "&amp;values= %d ""&amp;units=/n",variableB);



As far as I understand, you want to read the data in the ConnectPort and send it to iDigi, isn’t it? If so, you can use the XIG, it will upload the data to iDigi automatically every time it receives data from any XBee module connected to the ConnecPort X4.

When the XIG uploads data to iDigi, it will generate Data Streams, one for each XBee module and variable. The data stream generated can be identified by the latest 6 digits of the XBee module’s MAC Address and the name of the value updated, so it is unique.

I have attached a couple of screenshots about the Data Streams service that iDigi offers. In the screenshots you will see that there are 4 Data Streams corresponding to an XBee module whose MAC Address ends with 406CBE07. The variables represented are temperature, level, valveIN and valveOUT. In that page you can see the values in a chart or in a data table.

Also, this data can be retrieved by an application or web page using the iDigi web sevices, you can take a look to them in the following document:

Refer to the 10. Dia Web Services API section to know how to retrieve the data.

Hope that helps.


that’s what i need but I don’t know what I need to do to make it work ,because my xbee rssi leds are on and sending the data but I still can’t read the data on the idigi.
I don’t know which python program should I upload to the x4 gateway to make it send the data directly to the idigi.

Did you get my doubts?

there is a lot of things i don’t know if I’m doing right like the type of connection api or at I dont really get the diference.

And finally if my .c code that I posted here is right and it is sending the data to the x4.

can some one support me I’m stuck


this is the command that I was trying to use to read the values

I am starting to think that the data that the xbee is sending is not going to the idigi but it is going to the serialport how can i read my serial port with idigi as an stream?


if (now < 20-rtc_get_uptime())
now = rtc_get_uptime();

		wpan_envelope_create(&amp;env, &amp;xdev.wpan_dev, WPAN_IEEE_ADDR_COORDINATOR, WPAN_NET_ADDR_UNDEFINED);
		env.payload = buffer;
		env.length = sprintf(buffer, "idigi_data:""names=saiuAtoB, saiuBtoA""&amp;values=%d,%d""&amp;units=C,C",saiuAtoB, saiuBtoA);


This was my last modification on my xbee .C code.

Now I’m having some troubles to use the xig to stream data to the idigi the xig is not connecting to my x4. I don’t know if it is some kind of network problem like proxy or it is configuration problems.

I am receiving a message

Poll error: Error:
Unable to load /poll?dojo.preventCache=1355159007364 status:500

even if there is no one to answer my questions i will keep posting because I know that maybe one day someone may find this usefull.