Hi All. I hope someone can help me out with this one: I am working on a project with the Hexiwear platform and I am very happy with all the possibilities that Zerynth offers but I also have a big issue, namely that the battery performance sucks big time. I can get at most 4h battery life even with a very stripped down version of Zerynth’s Hexiwear example whereas the device can easily run 10h on the stock firmware. If this is normal, it suggests the the VM is quite power-inefficient
In general, Running a Python Virtual Machine on a microcontroller allows to have a lot of cool high-level functionalities but also requires some features that are not needed when running bare-metal code (like an RTOS layer, garbage collector…).
Anyway, if you need power efficiency you can leverage the possibility to use C code with the same environment.
Have a look at the C hybrid programming example.
I suspected so much. I’ll have a look at hybrid programming too, thanks for the hint. At any rate, I am currently trying with mbed (hence “pure” C, no?) and it looks like I still get poor power performance compared to the stock firmware. I therefore suspect the stock firmware uses some sort of “magic” (aggressive, brutal optimization?) but I shall look into its source code to confirm it which is somewhat a gigantic task
Could you tell me which functionalities/peripherals are you using to achieve low power consumption with the stock firmware?
does this aggressive optimization work when using a lot of peripherals for instance.
AFAIK, there is not much you can customize in the stock firmware whitout first understanding its code and modifying it: it is more like a demo version intended for the final user and to show the capabilities of the platform. I suspect this is also why the code base is huge.
At any rate, in the stock firmware you can activate from the GUI a sensor-tag mode where all sensors are probed a few times a minute and pushed per BLE. If I try to do something similar with Zerynth or even with mbed, the battery is drained much faster and the internal temperature sensors indeed read much higher values than with the stock firmware, which leads instead to temperatures very close to ambient. This suggests that there is indeed something running under the hood both with Zerynth and mbed, whereas the stock firmware can successfully send the microprocessor to sleep when not in use.
It’s all a guess from my side as I couldn’t yet make a sense of the stock firmware’s code-base. The fact that I am an amateur at C/C++ programming and an absolute newbie in microcontrollers is not helping either…