Hi,
I am working on a school projekt for the subjekt called Technology.
where we want to use Zigbee to make a smart wireless light switch.
our prototype of the product should enable you to control lights from a computer with a zigbee connected to a USB port and then sending a wireless signal to another Zigbee with a Latching relay and a LED
However looking through the Digi Python programming code i cannot get the examples to work.
this is the example as written in the guide
#
# This example binds to application endpoint 0xe8,
# receives a single frames at this endpoint and then
# sends the frame's payload back to the originator
# using the radio's proprietary mesh transport.
#
# include the sockets module into the namespace:
from socket import *
# Create the socket, datagram mode, proprietary transport:
sd = socket(AF_ZIGBEE, SOCK_DGRAM, ZBS_PROT_TRANSPORT)
# Bind to endpoint 0xe8 (232):
sd.bind(("", 0xe8, 0, 0))
# Block until a single frame is received, up to 72 bytes:
payload, src_addr = sd.recvfrom(72)
# Send the payload back to the source we received it from:
sd.sendto(payload, 0, src_addr)
however after running i get following error
Traceback (most recent call last):
File “C:\Python26\Zigbee projekt\read_write.py”, line 11, in
sd = socket(AF_ZIGBEE, SOCK_DGRAM, ZBS_PROT_TRANSPORT)
NameError: name ‘AF_ZIGBEE’ is not defined
why is that ?
how do i import or define
AF_ZIGBEE, SOCK_DGRAM and ZBS_PROT_TRANSPORT
I’m still only a python beginner so bear with me if it’s a little obvious.
what is the difference between
from Socket Import *
and
Import Socket ??
(i know this is general python but instead of having to inquire 2 different places)
how does address to a zigbee work?
we are only using 2 zigbee’s.
thanks in advance