Do you have "technical" documentation for examples executed with Python?
I need to send those packets from my host controller, which does not run python.
Something like for the 'echo' test, raw bytes: 06 02 48 65 6c 6c 6f
Below for reference your doc page from the "Sending mesh packets" test.
At the moment only option I see is decoding of the aci_cmd.py
Piotr
This tutorial shows how you can use two devices running the serial example to demonstrate a communication between them over mesh.
Table of contents
Requirements
- Two boards running Serial example
Configuration and testing
To configure sending mesh packets:
- Set up a tiny mesh network by connecting two devices and starting the serial interface:
$ python interactive_pyaci.py -d /dev/ttyACM0 /dev/ttyACM1 --no-logfile
- Add a network key, application key, and a local unicast address with the
quick_setup()
method:In [1]: for dev in d: dev.quick_setup()2017-08-02 10:01:53,154 - INFO - ttyACM0: SubnetAdd: {'subnet_handle': 0}2017-08-02 10:01:53,157 - INFO - ttyACM0: AppkeyAdd: {'appkey_handle': 0}2017-08-02 10:01:53,158 - INFO - ttyACM0: Success2017-08-02 10:01:53,161 - INFO - ttyACM1: SubnetAdd: {'subnet_handle': 0}2017-08-02 10:01:53,162 - INFO - ttyACM1: AppkeyAdd: {'appkey_handle': 0}2017-08-02 10:01:53,166 - INFO - ttyACM1: Success - Disable the
access.py
module that hides the raw message events using an event filter (and is enabled by default on the device):In [2]: d[0].event_filter_disable()In [3]: d[1].event_filter_disable() - Add publish addresses:
In [4]: d[0].send(cmd.AddrPublicationAdd(d[1].local_unicast_address_start))2017-08-02 10:10:11,502 - INFO - ttyACM0: AddrPublicationAdd: {'address_handle': 0}In [5]: d[1].send(cmd.AddrPublicationAdd(d[0].local_unicast_address_start))2017-08-02 10:10:13,132 - INFO - ttyACM1: AddrPublicationAdd: {'address_handle': 0}
- Store the handles in variables:
In [6]: publish_handle = 0In [7]: appkey_handle = 0
- Define some variables for the following parameters of
PacketSend()
API:ttl
,force_segmented
,transmic_size
, andfriendship_credentials_flag
.In [8]: ttl = 1In [9]: segmented = 0In [10]: mic_size = 0In [11]: friendship_credentials_flag = 0