firmware merge requestshttps://git.flow3r.garden/card10/firmware/-/merge_requests2020-09-04T17:13:04Zhttps://git.flow3r.garden/card10/firmware/-/merge_requests/395fix(ble): Reduce scope of cricitcal section when initializing2020-09-04T17:13:04Zschneiderfix(ble): Reduce scope of cricitcal section when initializingCloses #203Closes #203schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/merge_requests/394Update CHANGELOG and Documentation2020-09-19T08:00:43Zrahixcard10@rahix.deUpdate CHANGELOG and DocumentationI've added all changes since 1.15 to the changelog, except all the BLE stuff. I'm not too sure what all the things were that have changed, so @schneider, if you can give me a rough list, I'll integrate them here as well.I've added all changes since 1.15 to the changelog, except all the BLE stuff. I'm not too sure what all the things were that have changed, so @schneider, if you can give me a rough list, I'll integrate them here as well.v1.16schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/merge_requests/392Show COVID-19 exposure notification statistics2020-07-19T09:34:48ZschneiderShow COVID-19 exposure notification statisticsBased on !390
Displays how many unique MACs (aka phones) which send exposure notifications have been seen during the last 100 seconds.
It tries to distinguish between Apple and Google devices based on a heuristic mentioned in http...Based on !390
Displays how many unique MACs (aka phones) which send exposure notifications have been seen during the last 100 seconds.
It tries to distinguish between Apple and Google devices based on a heuristic mentioned in https://github.com/znuh/microbit-corona-scanner. The user can choose if they want the LEDs and/or the vibration motor to show newly discovered MACs / exposure notifications.
Loosely based on:
- https://github.com/kauzu/CoronaAppDetector
- https://github.com/frankrieger/CoronaAppDetectorM5StickC
- https://github.com/znuh/microbit-corona-scanner
Most of the logic resides in a plain Python script and can be modified by the user as needed.
![IMG_20200628_005806](/uploads/d3554659c9bfc138cab80ec9c5ba22aa/IMG_20200628_005806.jpg)https://git.flow3r.garden/card10/firmware/-/merge_requests/391fix(ble): Turn off coded and 2M phys2020-06-30T21:11:28Zschneiderfix(ble): Turn off coded and 2M physThe 2M phy caused problems when turning on encryption. I'm also
disabling the coded phy as I don't know it it works and need to first
test it with a phone/central which has support.
Closes #172The 2M phy caused problems when turning on encryption. I'm also
disabling the coded phy as I don't know it it works and need to first
test it with a phone/central which has support.
Closes #172https://git.flow3r.garden/card10/firmware/-/merge_requests/390Bonding dialog2020-07-17T16:02:45ZschneiderBonding dialogCreates a makeshift interface between epicardium and pycardium to support a bonding dialog.
The dialog displays the confirmation value and shows if the bonding succeeded / failed.Creates a makeshift interface between epicardium and pycardium to support a bonding dialog.
The dialog displays the confirmation value and shows if the bonding succeeded / failed.https://git.flow3r.garden/card10/firmware/-/merge_requests/389feat(mp): Enable (u)bluetooth module using stubs2020-09-07T07:08:49Zschneiderfeat(mp): Enable (u)bluetooth module using stubsThis enables the `(u)bluetooth` module using some stubs to get it compiling. Will not do anything so far.This enables the `(u)bluetooth` module using some stubs to get it compiling. Will not do anything so far.Hauke MehrtensHauke Mehrtenshttps://git.flow3r.garden/card10/firmware/-/merge_requests/388change(micropython): Create weak link from `(u)module` to `module`2020-06-15T17:55:54Zschneiderchange(micropython): Create weak link from `(u)module` to `module`Create weak links from MicroPython specific implementations of
modules to standard names. I.e. allow `import time` to import
utime module.Create weak links from MicroPython specific implementations of
modules to standard names. I.e. allow `import time` to import
utime module.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/387feat(ble): write HCI layer log file2020-06-17T13:51:54Zschneiderfeat(ble): write HCI layer log fileAdds an option to write a btsnoop compatible log file containing BLE
traffic. A new file is created after each boot if BLE is activated and
the `ble_log_enable` option is set in `card10.cfg`. The last 10 logs are
kept via log rotation.Adds an option to write a btsnoop compatible log file containing BLE
traffic. A new file is created after each boot if BLE is activated and
the `ble_log_enable` option is set in `card10.cfg`. The last 10 logs are
kept via log rotation.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/386how-to-build.rst: 'crcmod' can be installed from Ubuntu, so 'pip' is not needed.2020-06-06T08:11:14ZAndreas Schildbachhow-to-build.rst: 'crcmod' can be installed from Ubuntu, so 'pip' is not needed.https://git.flow3r.garden/card10/firmware/-/merge_requests/385BLE fixes 2020-22020-06-12T20:33:35ZschneiderBLE fixes 2020-2Just some minor changes to more rigidly define the pairing requirements and behaviour. A secure implementation still needs https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/74Just some minor changes to more rigidly define the pairing requirements and behaviour. A secure implementation still needs https://git.card10.badge.events.ccc.de/card10/firmware/-/issues/74rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/384Upgrade to micropython v1.122020-06-13T07:18:10Zrahixcard10@rahix.deUpgrade to micropython v1.12No obvious regression up to MicroPython v1.12 ([Changelog](https://github.com/micropython/micropython/releases/tag/v1.12)). I did not yet have time to thoroughly test it though ...
I intentionally did not do any further adjustments yet...No obvious regression up to MicroPython v1.12 ([Changelog](https://github.com/micropython/micropython/releases/tag/v1.12)). I did not yet have time to thoroughly test it though ...
I intentionally did not do any further adjustments yet, to e.g. make use of new features. These will follow up in separate MRs.v1.16schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/merge_requests/383fix(usbcdc): Re-enable after lockup when attached again2020-05-21T13:02:44Zschneiderfix(usbcdc): Re-enable after lockup when attached againWhen opening an ACM device Linux sends the ACM_SET_CONTROL_LINE_STATE
with DTR and CTS high. We can use this re-enable the ACM device on our
side after a lockup.When opening an ACM device Linux sends the ACM_SET_CONTROL_LINE_STATE
with DTR and CTS high. We can use this re-enable the ACM device on our
side after a lockup.rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/382HID over BLE2020-12-23T01:30:46ZschneiderHID over BLEPressing buttons and moving the mouse of your computer via BLE.
Allows to use the Adafruit CircuitPython HID libary with the card10.
No driver required. I expect this to work under all operating systems.Pressing buttons and moving the mouse of your computer via BLE.
Allows to use the Adafruit CircuitPython HID libary with the card10.
No driver required. I expect this to work under all operating systems.https://git.flow3r.garden/card10/firmware/-/merge_requests/381BLE fixes 2020 12020-05-10T14:08:35ZschneiderBLE fixes 2020 1Just two random fixes.
- Introduce cccd.h which will make it easier to introduce new characteristics with notification support
- Prevent redundant writing of pairing information each time a device disconnectsJust two random fixes.
- Introduce cccd.h which will make it easier to introduce new characteristics with notification support
- Prevent redundant writing of pairing information each time a device disconnectshttps://git.flow3r.garden/card10/firmware/-/merge_requests/380BSEC support2020-12-24T21:39:59ZschneiderBSEC supportAdds basic Bosch BSEC support.
BSEC is a proprietary library from Bosch which uses the BME680 to calculate an estimation of an "Indoor Air Quality". It takes complete control of the BME680 and performs a measurement every 3 seconds. Thi...Adds basic Bosch BSEC support.
BSEC is a proprietary library from Bosch which uses the BME680 to calculate an estimation of an "Indoor Air Quality". It takes complete control of the BME680 and performs a measurement every 3 seconds. This consumes about 0.9 mA on the 1.8 V rail. A later iteration of this driver might also allow to change the interval to 300 seconds to save energy.
Two configuration options are introduced. One to enable the driver (as it is a binary blob) and one to enable the debug prints of the driver. If the library is active, calls to the BME680 API will stop using the sensor directly and return a subset of the data gathered by the BSEC library.
You can use this https://phyphox.org/ "experiment" to access the data:
![download__1_](/uploads/c5fc1dfc1189e56491730c21b2ee2bf2/download__1_.png)
![cwNiWbhBMDGanPdkseSkGBCn](/uploads/d6d4fed5084a53e2398a7f1087218575/cwNiWbhBMDGanPdkseSkGBCn.png)
In addition the pycardium BME680 API and the BLE Environmental Sensing Service have been extended.https://git.flow3r.garden/card10/firmware/-/merge_requests/379Remove legacy HW lock interface2020-04-29T12:26:56ZschneiderRemove legacy HW lock interfaceRemoves the old interface which was only a shim to the new one anymore.
HW locks are expected to eventually succeed or immediately return (if requested).Removes the old interface which was only a shim to the new one anymore.
HW locks are expected to eventually succeed or immediately return (if requested).rahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/378Linux script to transfer a file to a card10 via BLE2020-04-28T21:30:40ZschneiderLinux script to transfer a file to a card10 via BLEI got tired of going in and out of USB mode to transfer scripts to the card10. I also didn't want to use the more or less reliable serial connection.
This script used bluepy to open a connection and uploads the file using the same mec...I got tired of going in and out of USB mode to transfer scripts to the card10. I also didn't want to use the more or less reliable serial connection.
This script used bluepy to open a connection and uploads the file using the same mechanism that the apps are using.
Caveats:
- Linux seems to always use the slowest allowed connection speed that the device offers. This severely limits data transmission speeds with the currently released firmware. It specifies a 1 second maximum connection interval, leading to one transaction every 2 seconds. Android apparently does not care about the announced connection interval...
- Needs a pairing with the Linux machine. This can be done following the steps in `Documentation/bluetooth/card10.rst`.
- Does only work under Linux as bluepy only support Linux.
- Further documentation is missing
I'd like to merge this in it's current state.
Things to improve:
- Abstract a file transfer away into a class.
- Allow transmission of multiple files
- Allow transmission of directories
- Honor the `--silent` option
- Offer pipenv with the requirementsrahixcard10@rahix.derahixcard10@rahix.dehttps://git.flow3r.garden/card10/firmware/-/merge_requests/377Dispatch interrupts asynchroneously2020-06-02T18:22:49Zrahixcard10@rahix.deDispatch interrupts asynchroneouslyThis patch-set changes interrupt dispatching to happen asynchronously. This is a first step towards making API-calls interrupt safe. It also makes Epicardium more robust against a buggy payload as such a payload can no longer deadlock ...This patch-set changes interrupt dispatching to happen asynchronously. This is a first step towards making API-calls interrupt safe. It also makes Epicardium more robust against a buggy payload as such a payload can no longer deadlock tasks which try to send interrupts (in such an instance, now they will be scheduled but never leave the IRQ queue).
# Patch-List:
### chore(interrupts): Make api_interrupt_trigger() return void
api_interrupt_trigger() cannot fail except by a programmer error
(passing an invalid ID) in which case we should raise an assertion.
Thus, make it return `void` instead of `int`.
### fix(lifecycle): Don't trigger a reset during startup
This is a silent issue which I noticed during work in this patchset; we are sending a superfluous interrupt during boot. This patch changes this although it reduces readability of the code. I'd be ok with dropping it again if readability here is more important.
### chore(interrupts): Move api into an epicardium module
Our buildsystem prevents implementing the task in `epicardium/api` so I moved the interrupts API into an Epicardium module.
### chore(interrupts): Fix all modules to use new api
Update code-base to use new API.
### feat(interrupts): Dispatch interrupts asynchroneously
Instead of blocking the triggering task when core 1 is still busy
handling the previous interrupt, offload interrupt dispatching into
a separate task. This is the first step towards making API-calls
interrupt safe.
Next to the async triggering, the synchroneous mechanism is retained for
special cases where async does not work (e.g. because of spin-locks).
Currently, there is only one such case when resetting core 1 (triggering
EPIC_INT_RESET).
### docs(interrupts): Document new interrupt dispatcher task
Docs ...v1.16schneiderschneiderhttps://git.flow3r.garden/card10/firmware/-/merge_requests/376added documentation for accessing bluetooth services from linux2020-03-02T08:37:53Zfleuradded documentation for accessing bluetooth services from linuxsave somebody else the time i guess :Dsave somebody else the time i guess :Dhttps://git.flow3r.garden/card10/firmware/-/merge_requests/375Default main app selector2020-04-08T20:14:08ZschneiderDefault main app selectorAllows setting the default app via the main menu.Allows setting the default app via the main menu.v1.16rahixcard10@rahix.derahixcard10@rahix.de