#!/usr/bin/python
import socket
import serial
import zigbee
#crashes here
sd = socket.socket(socket.AF_XBEE, socket.SOCK_DGRAM, socket.XBS_PROT_APS)
DESTINATION = ("[00:00:00:00:00:00:10:10]!", 0xe8, 0xc105, 0x11)
sd.bind(("", 0xe8, 0, 0))
sd.sendto("Hello, World!", 0, DESTINATION)
Traceback (most recent call last):
File "./test.py", line 11, in
sd = socket.socket(socket.AF_XBEE, socket.SOCK_DGRAM, socket.XBS_PROT_APS)
File "/home/pi/xbee/zigbee.py", line 1522, in __init__
self.__xb_init(family, type, proto, xbee)
File "/home/pi/xbee/zigbee.py", line 1528, in __xb_init
self.family = family
AttributeError: can't set attribute
I’m attempting this on a RasPi B+ running Raspbian wheezy. For some reason the library seems to be trying to override socket.family, socket.type, and socket.proto, which are defined as read-only in the documentation for sockets.
Does anyone know how to prevent this from happening?