A small package to send/receive fragmented data with XBee 900
Project description
xbee900_HIT
Installation
python3 -m pip install xbee900_HIT
Example
send
from xbee900_HIT import xbee
import logging
logging.basicConfig(filename='xbee.log',
format='%(asctime)s %(message)s', level=logging.INFO)
def send():
device = xbee.Xbee('/dev/tty.usbserial-2', 9600)
with open('3KB.txt', 'rb') as f:
data = f.read()
# broadcast
device.send_packet(data)
with open('1KB.txt', 'rb') as f:
data = f.read()
# point2point
device.send_packet(data, remoteAddr="0013A20041BB7684")
send()
receive
from xbee900_HIT import xbee
import logging
logging.basicConfig(filename='xbee.log',
format='%(asctime)s %(message)s', level=logging.INFO)
def receive():
device = xbee.Xbee('/dev/tty.usbserial-1', 230400)
while True:
data, remote = device.receive_packet()
print(f'from {remote} :length of data:{len(data)},receive data: {data}')
receive()
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
xbee900_HIT-0.1.2.tar.gz
(5.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xbee900_HIT-0.1.2.tar.gz.
File metadata
- Download URL: xbee900_HIT-0.1.2.tar.gz
- Upload date:
- Size: 5.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4d3b8a0d227e618c055197133f8b36aa6f0719e38739ae65e04391a17310f0d
|
|
| MD5 |
87f2e48d6519817552b2fe58e1374a98
|
|
| BLAKE2b-256 |
cd82267b2cef0bdc089e234ebed6431f78e1be776d9ff45fd8c6190d7891b0c6
|
File details
Details for the file xbee900_HIT-0.1.2-py3-none-any.whl.
File metadata
- Download URL: xbee900_HIT-0.1.2-py3-none-any.whl
- Upload date:
- Size: 7.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e09c3ef14d135070d468ab007893daed4086596f47af489f4379a407badfd23c
|
|
| MD5 |
b2fbc7c45a94831c5257c24b5771ac8e
|
|
| BLAKE2b-256 |
69302f25f3352e439fe83dd9f73d73db20fb8c67c3f63a1a665a12f6395848cb
|