When I have LCD module on Core attached, buttons on core module are almost inaccessible. I have to unplug USB cable, remove LCD, plug USB, flash FW, unplug USB, attach LCD and finally plug back USB to power up and see the result.
How do you solved this?
Is it possible reset the Core module via USB (mqtt)?
Yes, it’s uncomfortable, so we are preparing a new version of the core.
Switch into dfu mode, it is possible with lcd:
Unplug power, press and hold button on lcd, plug in power, release button on lcd.
We have also implemented function to jump to DFU mode. We just did not decided how this function should be called. By MQTT message or special command over USB. It would also work only on gateway which is connected by USB.
We have not discussed this yet with @Karel. Mainly because internally we use debuggers to upload firmware. I’ve created that API jump to DFU, but there are some security concerns. It is not safe to have plain MQTT message which would stop the device working at the customer location. This secure functionality has to be also implemented in gateway service.
The best solution would be that the bcfutility in case you are flashing with --dfu sends message to gateway service by MQTT or by some other out-of-band mechanism. Then the gateway sends DFU switch command over USB and device boots to DFU. In any case there has to be alway implemented the bc_dfu_jump() instruction in the previous and the actually flashed firmware. If update fails or the firmware is unstable then you would need to start DFU mode by pressing the buttons.
Update:
This jump to DFU functionality will unfortunatelly not be implemented in BCF or bch-gateway. It is more complicated than it seemed. Also it will work only on USB connected Core Module which has enabled USB CDC. It will not work for remote nodes because they do not have USB stack in firmware because they don’t need it.
So this implementation will be only working in edge-cases and could lead to a confusion in explanation to the users when it would and would not work.
New core module will have USB implemented in a better way for automatic switch to bootloader. For older core modules there will be an option to get new programming module in case someone would really need flashing without physical button press.