I tried running my lego passenger train using bricknil on my Windows 10 machine. I followed the following steps.
pip install bircknil
I ran a simple program to control the train and this is the error I got.
My program had the following lines
`from curio import sleep
from bricknil import attach, start
from bricknil.hub import PoweredUpHub
from bricknil.sensor import TrainMotor
from bricknil.process import Process
import logging
@attach(TrainMotor, name='motor')
class Train(PoweredUpHub):
async def run(self):
self.message_info("Running")
for i in range(2):
self.message_info('Increasing speed')
await self.motor.ramp_speed(80,5000)
await sleep(15)
self.message_info('Coming to a stop')
await self.motor.ramp_speed(20,1000)
await sleep(2)
async def system():
train = Train('My train')
if name == 'main':
logging.basicConfig(level=logging.INFO)
start(system)
`
On running the program, I got the following error.
File "train.py", line 26, in
start(system)
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bricknil\bricknil.py", line 214, in start
ble.run()
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bricknil\bleak_interface.py", line 52, in run
self.loop.run_until_complete(self.asyncio_loop())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bricknil\bleak_interface.py", line 71, in asyncio_loop
await device.connect()
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bleak\backends\dotnet\client.py", line 86, in connect
raise BleakError(
bleak.exc.BleakError: Connection to 90:84:2B:15:88:DB was not successful!
I tried running my lego passenger train using bricknil on my Windows 10 machine. I followed the following steps. pip install bircknil
I ran a simple program to control the train and this is the error I got.
My program had the following lines
`from curio import sleep from bricknil import attach, start from bricknil.hub import PoweredUpHub from bricknil.sensor import TrainMotor from bricknil.process import Process import logging
@attach(TrainMotor, name='motor') class Train(PoweredUpHub):
async def system(): train = Train('My train')
if name == 'main': logging.basicConfig(level=logging.INFO) start(system) `
On running the program, I got the following error.
File "train.py", line 26, in
start(system)
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bricknil\bricknil.py", line 214, in start
ble.run()
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bricknil\bleak_interface.py", line 52, in run
self.loop.run_until_complete(self.asyncio_loop())
File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.8_3.8.1520.0_x64__qbz5n2kfra8p0\lib\asyncio\base_events.py", line 616, in run_until_complete
return future.result()
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bricknil\bleak_interface.py", line 71, in asyncio_loop
await device.connect()
File "C:\Users\axavier\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\LocalCache\local-packages\Python38\site-packages\bleak\backends\dotnet\client.py", line 86, in connect
raise BleakError(
bleak.exc.BleakError: Connection to 90:84:2B:15:88:DB was not successful!