I'm trying since few days to implement a Mesh provisioner with your library for test purpose. According to the bluez mesh-api.txt file the CreateNetwork method is "This is the first method that an application calls to becomea Provisioner node, and a Configuration Client on a newly created Mesh Network."
I tried to do the operation with your library with the following code :
import asyncio
import logging
import secrets
from time import sleep
from bluetooth_mesh.bluez.application import Application, Element, Capabilities
from bluetooth_mesh.crypto import ApplicationKey, DeviceKey, NetworkKey
from bluetooth_mesh.messages.config import GATTNamespaceDescriptor, StatusCode
from bluetooth_mesh.models import ConfigClient, ConfigServer, HealthClient, HealthServer
class PrimaryElement(Element):
LOCATION = GATTNamespaceDescriptor.MAIN
MODELS = [
ConfigClient,
ConfigServer,
HealthClient,
]
class SampleApplication(Application):
COMPANY_ID = 0x025E
PRODUCT_ID = 1
VERSION_ID = 1
ELEMENTS = {
0: PrimaryElement,
}
CRPL = 32767
PATH = "/fr/scheiber/mesh"
@property
def dev_key(self):
return DeviceKey(secrets.token_bytes(16))
@property
def net_key(self):
return 0, NetworkKey(secrets.token_bytes(16))
@property
def app_keys(self):
return {0: ApplicationKey(secrets.token_bytes(16))}
async def main():
# Set up logging
logging.basicConfig(level=logging.INFO)
# Create an event loop
loop = asyncio.get_event_loop()
# Create an instance of the Application class
app = SampleApplication(loop=loop)
try:
# Connect to BlueZ
await app.dbus_connect()
app.address = 0x0001
await app.create_network()
except Exception as e:
logging.error("Error occurred: %s", e)
# Run the asynchronous function
asyncio.run(main())
When I run the python file I get the following error :
Hello,
I'm trying since few days to implement a Mesh provisioner with your library for test purpose. According to the bluez mesh-api.txt file the CreateNetwork method is "This is the first method that an application calls to becomea Provisioner node, and a Configuration Client on a newly created Mesh Network."
I tried to do the operation with your library with the following code :
When I run the python file I get the following error :
Here is my bluetooth-mesh.service status :
According the provided code, Do you have any idea how to solve my problem?
Thank you for your reply.