The hardware I’m using is a Connectport X8 and a singular Xbee module in one of the dev boards.
I’m having trouble communicating across them so I wanted to test out just the simple communication snippets of code to make sure I was implementing them properly.
Its just a basic extension of zb_ex2_rw.py just in reverse. Where I do the following:
As bind problems have come up once or twice before, I’ll pose the common question: are any python scripts set to run at startup?
One can not bind to the same endpoint twice, so an existing, running script could cause a bind to fail.
The “who” command at the CLI can help determine whether there are running scripts.
The “set python” command can be consulted to determine whether any scripts are enabled to run at startup.
If you’ve already checked all of these things, and the bind continues to fail, it would be useful to start with the actual failure returned by the bind. That might indicate the necessary direction to be taken.
If you are using ZNet 2.5 or ZB modules you will have to bind to endpoint e8 or change the DE parameter of your remote modules to 0.
I am guessing that your bind to e8 is failing because you have another Python application running concurrently when you are trying to bind to 0xe8. If you go to “Connections” on the Web UI do you see other Python threads running?
If you go to Python->Auto Start Settings is there a checkbox next to one or more script in that configuration area?
It was odd in that the example code would work as long as it didn’t block and force me to hard reset the router. You were correct in that there was a script set to run at start up. I canceled that and now bind no longer fails at all.
I had read about some bind problems, but they all seemed to be related to Linux and what version of python you were using.
As someone unfamiliar with Python, and especially the TCP/socket stuff. I don’t completely understand what 0xe8 stands for. I read that it is the Maxstream serial data endpoint. So if I had to explain what I think is happening it would be: socket( … ) creates a sd class with all the socket methods, bind is a method that ties a specific data path to it, and then I just send/wait for data. Is that about correct?