#7: Screen streaming and input injection
this is our dev log where we share how the development of flipper one is going in this dev log screen streaming and input injection, terminal based screen viewer, recovery os, fuel gauge calibration, 3d printed pcb fit checks, and more kernel patches going upstream we've also found a usb teardown bug we'd love help investigating screen streaming and input injection this week, we've enabled screen streaming and input signal injection https //github com/flipperdevices/flipperone mcu firmware/pull/210 , allowing us to build automated tests for flipper one's ui see how it works! screen streaming runs over usb or a flipper one debug probe docid sztz3zvgs4oloqvugz3p and uses rpc (remote procedure call), the same protobuf based protocol as on flipper zero streaming over a debug probe is available both in the mcu mode (low power consumption) and the cpu mode (running boot menu and linux), while usb only works in the mcu mode (as the cpu takes control of usb when it starts) the debug probe connection uses uart, which limits speed to around 1 5 mbd (146 kb/s) with a frame size of 37 kb (255px ร 144px ร 1 byte for grayscale), it allows a frame rate of 3 9 fps, which reduces to 3 2 fps in practice, due to the data processing lag that's not a lot, but more than enough for ui testing terminal based screen viewer our community contributor @hobbitthecat added a screen command to the flipper one cli https //github com/flipperdevices/flipperone mcu firmware/pull/179 this command streams the flipper one display straight into a terminal over the same vcp/uart cli pipeline, and lets you control the device from there โ arrow keys or wasd to navigate, number keys for the bottom buttons, and enter/backspace to confirm or go back cli screen viewer showing the flipper one ui rendered with unicode braille patterns frames are rendered using unicode braille patterns we also tried a one character per pixel grayscale approach, but it needed the terminal font shrunk so much that the ui's fine text became unreadable โ braille encoding keeps pixel accuracy without touching the font size recovery os you can now boot into recovery os on flipper one recovery os is a minimal linux build whose job is to help you get a broken flipper one to work again u boot boot menu with flipperos recovery as the first entry recovery os image is stored in flipper one's persistent storage (ufs), separately from the boot record and os profiles it boots into ram and then creates and exposes a ram disk (using half of the available ram) you can use this disk to upload the latest flipper os installer or your backed up profiles we're now working on adding the flipper os installer and profile management tools straight into recovery os recovery os message of the day, showing board info, network setup commands, and usb storage gadget commands recovery os is currently available as a boot menu option, but we're working to make it reachable from an mcu level menu, even before the boot menu starts once that's in place, even if the boot record is damaged and the boot menu doesn't start, you'll still be able to run recovery os and reinstall the system this method skips u boot entirely the mcu will use falcon mode docid\ l7ubpkbtfzttrlryowslg to tell the cpu which partition to boot from directly tracking remaining battery level flipper one has a 2 cell battery pack with a capacity of 3250 mah at 8 9v (however, it's charged only up to 8 6v for longer life) but how does flipper one know how much battery charge is left? the dedicated chip called a fuel gauge docid\ jduwp85kjnjq9 rsvhllt does the job there it is on the battery's own board flipper one's battery fpc and fuel gauge adapter board the fuel gauge continuously measures the battery voltage, current, and temperature data, and calculates remaining charge but all batteries behave differently, so the fuel gauge needs to be calibrated with a battery chemistry id this week we ran a series of battery discharge tests and fed the logged data into ti's impedance track chemistry id selection tool to find the closest chemistry match below is a part of the tool's output chemistry id selection tool, rev=2 57 	 configuration used in present fit processingtype = 2 numcellseries = 2 elapsedtimecolumn = 0 voltagecolumn = 1 currentcolumn = 2 temperaturecolumn = 3 best chemical id 3702 best chemical id max deviation, % 1 39 max deviations for best id is within recommended range chosen best chemical id is suitable for programming the gauge 	 the best match is chemistry id 3702 , with a maximum depth of discharge deviation of just 1 39% you can view the deviation as a measure of confidence a number like 1โ2% (our winning id is at 1 39%) is a very close match, while something like 10% means that the fuel gauge would make mistakes if calibrated with this chemistry id the work doesn't stop on the fuel gauge calibration as a next step, we're going to check how the battery degrades over multiple recharge cycles we'll keep you updated on this research 3d printed pcb fit checks last week we released the pcb revision 2 f0b1c2 as a part of pre release testing, we 3d printed all pcb models to make sure they fit in the body and the whole device could be assembled on the photo you can see the main board model, the small touchpad board, and the control board 3d printed models of pcbs main, touchpad, and control board more patches going upstream we've upstreamed a fix to the linux code that controls fractional pll rate generation for the system clock controller on the rk3576 (the cpu in flipper one) and rk3588 this further enables driving arbitrary display clocks for monitors connected over a type c cable via displayport alt mode it uses a system pll as the source for its pixel clock docid dx3kqdetbrqzwvvutkp0 , and that clock has to be matched precisely within about 0 1%, or you get a black screen see the patch on the linux rockchip mailing list https //lore kernel org/linux rockchip/178532348703 455945 4872478819710322236 b4 ty\@sntech de/t/#m08b2e299f412d031e2e9c2ec5b86e147aa5047f7 another usb bug โ \[help wanted] last week, we found and fixed a bug that rendered usb unusable docid\ zlfshmnynr9uy lqejsai this new week brought us a new one, not so severe, but slightly annoying every time a usb gadget (like our mtp/mass storage/ncm composite docid\ zlfshmnynr9uy lqejsai ) is torn down, the kernel logs a was not queued to ep0out error the request has already completed by the time it's dequeued, so nothing leaks and no transfer is affected, but this message drowns out real usb errors in the logs if you're in contribution mood, we invite you to help us with this bug see flipperdevices/flipper linux kernel#20 https //github com/flipperdevices/flipper linux kernel/issues/20 join flipper one development and make your contribution we have tasks open to the community! see the full list on the ๐ง open tasks https //docs flipper net/one/open tasks page building a project that helps test or improve flipper one? add it to the community projects docid\ xqaz9zzclnbl0awu3zh6q page 3rd party module contributions are welcome! check out the contribution guide docid 0ddvbioawjaz2p653x569 and open a pull request in flipperdevices/flipperone mechanics https //github com/flipperdevices/flipperone mechanics see you in the next dev log!
Have a question?
Our support team and an awesome community will get you an answer in a flash. Please leave your questions in English.
To ask a question or participate in discussions, you'll need to authenticate first.