tkem / carreralib Goto Github PK
View Code? Open in Web Editor NEWPython interface for Carrera(R) Digital 124/132 slotcar systems
License: MIT License
Python interface for Carrera(R) Digital 124/132 slotcar systems
License: MIT License
poll()
seems to be more intuitive when trying to retrieve the latest timing event.
Per Slotbaer's documentation, the reset command =
and the button press command T
should transmit the checksum. Note that in the documentation for reset, the full command is "=101$
where the last 1
plays the role of checksum.
Firmware update over serial line uses the "E" frame, i.e.
" E <N bytes of data> <CRC> $
With BLE/AppConnect, lines are split into chunks with at most 18 bytes of firmware data, and sent using
F <N> <N bytes of data>
where is the zero-based length of data as a byte, i.e. 0x12 for 18 bytes of data. Each "line" is terminated with a separate
E <CRC>
command,
In docs/conf.py
, the package version is retrieved from setup.cfg
and displayed on RTD as attr: carreralib.__version__
in the browser title bar.
Either use separate methods similar to ControlUnit.start()
, or add request strings as constants, e.g. KEY_ESC = b'T1'
.
pythonhosted doesn't seem to accept updates any longer.
Also clean up conf.py
and adjust copyright information.
Sorry, don't know if this is the right way to contact you, but I've not been able to find any other...
I've been trying to create my own RaceControl app using carreralab 0.4.1 - and I've noticed that the status line returned from cu.request() always has fuel=0 for all drivers:
[2017-05-08 17:37:11,383] dk.fafdifh.racecontrol.config.RaceControl.getStatus(RaceControl.java:86) [INFO] [pool-1-thread-1] status : Status(fuel=(0, 0, 0, 0, 0, 0, 0, 0), start=0, mode=2, pit=(False, False, False, False, False, False, False, False), display=8)
This is also the case when I use the RMS demo inside carreralib directly.
I've tried both the Fuel=On and Fuel=Real setting on my (physical) CU to no avail. Am I doing something wrong? All the demo screenshots present various % fuel...
As suggested by @grosssoftware, CU key-press simulation warrants its own method, and redefining *_KEY
constants to integer values makes sense.
On a Raspberry Pi 3 Model B+ with latest Pi OS (Debian "bullseye"):
>>> from carreralib import ControlUnit
>>> cu = ControlUnit('D3:14:BB:32:C5:75')
>>> Exception in thread Thread-1:
Traceback (most recent call last):
File "/usr/lib/python3.9/threading.py", line 954, in _bootstrap_inner
self.run()
File "/home/pi/.local/lib/python3.9/site-packages/carreralib/ble.py", line 28, in run
asyncio.run(self.main())
File "/usr/lib/python3.9/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.9/asyncio/base_events.py", line 642, in run_until_complete
return future.result()
File "/home/pi/.local/lib/python3.9/site-packages/carreralib/ble.py", line 78, in main
data = await self.__output.get()
File "/usr/lib/python3.9/asyncio/queues.py", line 166, in get
await getter
RuntimeError: Task <Task pending name='Task-1' coro=<BleakThread.main() running at /home/pi/.local/lib/python3.9/site-packages/carreralib/ble.py:78> cb=[_run_until_complete_cb() at /usr/lib/python3.9/asyncio/base_events.py:184]> got Future <Future pending> attached to a different loop
bleak seems to be the current Python BLE client implementation of choice.
Hi! Do you have any intentions or plans to make this lib compatible to the Carrera Go! + Controller?
From the limited research I did using a Bluetooth Terminal app, the protocol is quite similar for the basic stuff (i.e. getting lap times)
However, when I try to connect to it using this version of carreralib, I get a timeout while trying to get the CU version on program launch. I tried to increase the timeout to 5 seconds to no avail.
bluepy
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.