Hussat
December 1, 2017, 9:37am
1
Hi,
I’m trying to view frame data that is being delivered to a ConnectPort X2 from a network of Xbee 900HP DigiMesh radios configured in API1 mode. I can see the Tx/Rx lights flashing on ConnectPort and the ASSC light is flashing, so I think I’m close to seeing data somewhere. I’m guessing that I have to load a python script to the ConnectPort to send the packets on to a local port, but am struggling to understand the concepts and see some simple examples.
Can you please provide me with an example of how to configure the Connect Port to send e serial data on to a local socket?
Thanks.
mvut
December 1, 2017, 9:52am
2
This is pulled directly from the Digi Python ESP Hello World XBee Example:
############################################################################
Copyright (c)2009, Digi International (Digi). All Rights Reserved.
Permission to use, copy, modify, and distribute this software and its
documentation, without fee and without a signed licensing agreement, is
hereby granted, provided that the software is used on Digi products only
and that the software contain this copyright notice, and the following
two paragraphs appear in all copies, modifications, and distributions as
well. Contact Product Management, Digi International, Inc., 11001 Bren
Road East, Minnetonka, MN, +1 952-912-3444, for commercial licensing
opportunities for non-Digi products.
DIGI SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED
TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
PARTICULAR PURPOSE. THE SOFTWARE AND ACCOMPANYING DOCUMENTATION, IF ANY,
PROVIDED HEREUNDER IS PROVIDED “AS IS” AND WITHOUT WARRANTY OF ANY KIND.
DIGI HAS NO OBLIGATION TO PROVIDE MAINTENANCE, SUPPORT, UPDATES,
ENHANCEMENTS, OR MODIFICATIONS.
IN NO EVENT SHALL DIGI BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
DIGI HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
############################################################################
“”"
XBee Hello World! demo for Digi devices
This example performs a "Hello, World!" message using the Digi proprietary
mesh transport to a fixed node address.
“”"
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:
sd = socket(AF_XBEE, SOCK_DGRAM, XBS_PROT_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
DESTINATION:
sd.sendto(“Hello, World!”, 0, DESTINATION)