[{"data":1,"prerenderedAt":302},["ShallowReactive",2],{"blog-posts-en":3,"blog-post-where-the-battery-goes-on-an-lte-m-sensor":80},[4,17,28,34,44,53,64,72],{"path":5,"stem":6,"title":7,"description":8,"date":9,"tags":10,"readingTime":15,"lang":16},"/blog/what-cra-compliance-takes-for-a-small-hardware-team","blog/what-cra-compliance-takes-for-a-small-hardware-team","What CRA compliance actually takes for a small hardware team","I turned every Cyber Resilience Act obligation for device makers into one checklist. What it asks of a connected product, and what I would do first.","2026-10-04",[11,12,13,14],"cra","iot","security","compliance","8 min read","en",{"path":18,"stem":19,"title":20,"description":21,"date":22,"tags":23,"readingTime":27,"lang":16},"/blog/one-golden-certificate-for-the-whole-production-line","blog/one-golden-certificate-for-the-whole-production-line","One golden certificate for the whole production line","Give every device its own X.509 identity in AWS IoT Core without flashing certificates unit by unit, using a shared claim certificate and fleet provisioning.","2026-10-01",[12,24,13,25,26],"aws","provisioning","esp32","9 min read",{"path":29,"stem":30,"title":31,"description":32,"date":22,"tags":33,"readingTime":27,"lang":16},"/blog/the-cra-clock-is-already-running","blog/the-cra-clock-is-already-running","The CRA clock is already running on devices you shipped years ago","Since 11 September 2026 the CRA's 24-hour reporting duty covers every connected product on the EU market, old ones too. What it means for a small hardware team.",[11,12,13,14],{"path":35,"stem":36,"title":37,"description":38,"date":39,"tags":40,"readingTime":43,"lang":16},"/blog/updating-firmware-on-a-fleet-without-bricking-it","blog/updating-firmware-on-a-fleet-without-bricking-it","Updating firmware on fifty thousand ESP32s without bricking any","Over-the-air updates for a large ESP32 fleet: partition layout and rollback, signed images, staged rollouts and the cost of sending a megabyte to every device.","2026-09-30",[12,26,41,42],"firmware","ota","7 min read",{"path":45,"stem":46,"title":47,"description":48,"date":39,"tags":49,"readingTime":43,"lang":16},"/blog/where-the-battery-goes-on-an-lte-m-sensor","blog/where-the-battery-goes-on-an-lte-m-sensor","Where the battery goes on an LTE-M sensor","The power budget of a battery powered LTE-M sensor, why the radio dominates it, and the settings that decide whether a battery lasts one year or five.",[12,50,51,52],"embedded","lte-m","low-power",{"path":54,"stem":55,"title":56,"description":57,"date":58,"tags":59,"readingTime":63,"lang":16},"/blog/building-an-llm-trading-bot","blog/building-an-llm-trading-bot","So everyone is building LLM trading bots now","I kept hearing about language models that trade on their own, so I dug into how these bots work, where they fall apart and what I would build instead.","2026-09-29",[60,61,62],"ai","llm","trading","6 min read",{"path":65,"stem":66,"title":67,"description":68,"date":58,"tags":69,"readingTime":71,"lang":16},"/blog/jev-a-model-that-only-decides","blog/jev-a-model-that-only-decides","JEV: a model that only decides","TypeSafe AI's JEV returns typed answers with calibrated probabilities and never writes a word. What it is, where it fits, and what to be careful about.",[60,61,70],"jev","5 min read",{"path":73,"stem":74,"title":75,"description":76,"date":58,"tags":77,"readingTime":15,"lang":16},"/blog/storing-a-reading-a-minute-from-100k-devices","blog/storing-a-reading-a-minute-from-100k-devices","Storing a reading a minute from 100,000 devices","What it actually takes to ingest, deduplicate and keep a year of per-minute telemetry from a fleet of a hundred thousand devices, and where the costs hide.",[12,78,79],"data-engineering","timescaledb",{"original":81,"pl":194},{"id":82,"title":47,"author":83,"body":84,"date":39,"description":48,"extension":187,"lang":16,"meta":188,"navigation":189,"path":45,"readingTime":43,"seo":190,"sitemap":191,"stem":46,"tags":192,"updated":22,"__hash__":193},"blog/blog/where-the-battery-goes-on-an-lte-m-sensor.md","Bartosz Szczepanik",{"type":85,"value":86,"toc":175},"minimark",[87,91,94,99,102,105,108,112,115,118,122,125,128,132,135,138,142,145,148,152,155,158,162,165,169,172],[88,89,90],"p",{},"Almost every battery powered cellular product I have worked on started with a spreadsheet that promised five years on a single cell. The first prototypes then came back from the field with batteries that were half empty after four months. The spreadsheet was usually right about the sleep current and wrong about nearly everything the modem does when it wakes up, and the modem is where the battery actually goes.",[88,92,93],{},"This post walks through how I build a power budget for an LTE-M or NB-IoT sensor now, and the handful of decisions that move it the most.",[95,96,98],"h2",{"id":97},"start-with-energy-per-report","Start with energy per report",[88,100,101],{},"The number that matters is how much charge the device spends every time it sends something. Sleep current gets a lot of attention because it is easy to measure and appears on the first page of every datasheet, and a good design will sit somewhere in the single digit microamps between reports. Over a day that works out to around a tenth of a milliamp hour, which is small.",[88,103,104],{},"A report is a different story. The modem wakes, finds the network, possibly reattaches, opens a connection, sets up TLS, sends a few hundred bytes, waits for the acknowledgement and then lingers for a while before the network lets it sleep. During transmission a cellular module can pull several hundred milliamps for short bursts, and the whole sequence often takes a few seconds even when everything goes well. If a report averages around a hundred milliamps over two seconds, that is about 0.055 mAh each time.",[88,106,107],{},"Now take a sensor that reports every fifteen minutes. That is 96 reports a day and a little over five milliamp hours, roughly fifty times what the device spends asleep. A lithium AA cell of around 2,600 mAh would last about a year and a quarter on that profile, and that is before temperature and ageing take their share. Almost all of that budget is spent on reports, so the number of reports and the cost of each one decide how long the device lives.",[95,109,111],{"id":110},"report-less-often-and-say-more-each-time","Report less often and say more each time",[88,113,114],{},"The cheapest improvement is almost always to batch. Most sensors that measure every fifteen minutes do not need to deliver every reading within fifteen minutes. If the device stores four readings and sends them once an hour, it pays the wake up cost 24 times a day instead of 96, and the extra bytes in each message cost next to nothing because the fixed overhead of connecting dwarfs the payload. On the example above that alone takes the daily budget from over five milliamp hours to around one and a half.",[88,116,117],{},"Alarms are the exception. A device can batch routine readings and still send immediately when a value crosses a threshold. That split between routine data and events tends to be the single most valuable conversation to have with the product team early, because it sets the whole power budget.",[95,119,121],{"id":120},"let-the-network-put-you-to-sleep-properly","Let the network put you to sleep properly",[88,123,124],{},"LTE-M and NB-IoT have two features built for devices like this. Power Saving Mode lets the device stay registered on the network while its radio is fully off, so it can wake later and send without a full attach. Extended discontinuous reception, usually shortened to eDRX, lets a device that needs to stay reachable check for incoming data only every so often instead of listening constantly.",[88,126,127],{},"With PSM, the device asks the network for two timers. One sets how long it stays reachable after sending, and the other sets how long it can sleep before it must check in with the network again. The detail that catches people out is that these are requests. The network decides what it grants, the values differ between operators and sometimes between cells of the same operator, and the modem reports what it actually got. I always log the granted values from the field, because a device that asked for a short active window and silently received a much longer one can burn a surprising amount of charge listening for nothing after every report.",[95,129,131],{"id":130},"protocols-that-fight-the-radio","Protocols that fight the radio",[88,133,134],{},"A standard MQTT client over TCP was designed for devices that stay online. Its keepalive pings arrive every minute or two by default, which is 120 seconds in the ESP-IDF client, and each one wakes the radio, which defeats the purpose of PSM entirely. A device that keeps an MQTT connection open around the clock will sit in a much higher power state than one that connects, sends and disconnects.",[88,136,137],{},"TLS has a similar cost. A full handshake involves several round trips and a fair amount of data for certificates, and on a cellular link each round trip keeps the radio awake a little longer. Session resumption helps, as do smaller certificate chains. For the lowest power products, CoAP over UDP with DTLS and connection identifiers can cut the exchange down to a single short burst, at the price of a less familiar stack and a backend that speaks CoAP. Many teams keep MQTT and simply connect only when they have something to send, which is a reasonable middle ground.",[95,139,141],{"id":140},"coverage-changes-everything","Coverage changes everything",[88,143,144],{},"The numbers above assume decent signal. LTE-M and NB-IoT handle poor coverage by repeating transmissions, sometimes many times over, so that a device deep inside a building can still get through. Every repetition keeps the radio on for longer, so a device in a basement can spend many times more energy per report than the same device on a windowsill.",[88,146,147],{},"For this reason I always ask the modem for signal quality and coverage information with each report and send it to the backend. Once the fleet is live, those figures explain most of the battery outliers. They also make installation guidance concrete, since moving a device a metre or two can sometimes make a large difference to its battery life.",[95,149,151],{"id":150},"the-battery-has-opinions-too","The battery has opinions too",[88,153,154],{},"Lithium thionyl chloride cells are the usual choice for long life sensors because of their capacity and very low self discharge. They do not like sudden high current pulses, especially when cold or after a long quiet period, and the voltage can sag enough under a modem transmit burst to cause a brownout reset in the middle of a report. The common fix is a capacitor or a hybrid layer capacitor next to the cell, which supplies the short peaks while the battery tops it up slowly. It is worth planning for in the hardware design, because adding it later means a new board revision.",[88,156,157],{},"Capacity ratings also assume gentle conditions. Cold temperatures, high pulse loads and years of shelf time all reduce what you actually get, so I apply a generous margin to the datasheet figure before I trust any lifetime estimate.",[95,159,161],{"id":160},"measure-it","Measure it",[88,163,164],{},"Once there is a prototype, I want a measurement of the real device on a real network. A power profiler that can capture both microamp sleep current and the fast high current bursts of a transmission shows exactly where each report spends its charge, and it usually surprises someone. I like to capture a few dozen complete wake cycles on the target operator, with good and poor signal, then feed the measured charge per report back into the budget.",[95,166,168],{"id":167},"what-it-adds-up-to","What it adds up to",[88,170,171],{},"When I put all of this together, the plan for a long life cellular sensor tends to look similar. The device batches routine readings into a few reports a day and sends events straight away, sleeps in PSM with timers that someone has checked against what the network actually grants, and keeps each connection as short as the protocol allows. It records its signal quality with every report so the outliers can be explained later, and its power supply is designed around the modem's peaks. Then the whole thing gets measured before anyone promises a battery lifetime to a customer.",[88,173,174],{},"If you are sizing a battery for a cellular product and the numbers do not quite add up, I would be glad to take a look.",{"title":176,"searchDepth":177,"depth":177,"links":178},"",2,[179,180,181,182,183,184,185,186],{"id":97,"depth":177,"text":98},{"id":110,"depth":177,"text":111},{"id":120,"depth":177,"text":121},{"id":130,"depth":177,"text":131},{"id":140,"depth":177,"text":141},{"id":150,"depth":177,"text":151},{"id":160,"depth":177,"text":161},{"id":167,"depth":177,"text":168},"md",{},true,{"title":47,"description":48},{"loc":45},[12,50,51,52],"Tuyl_erv83HE5Ty5mBftBdEbkY7x57ryHZpRCzrKc2o",{"id":195,"title":196,"author":83,"body":197,"date":39,"description":295,"extension":187,"lang":296,"meta":297,"navigation":189,"path":45,"readingTime":298,"seo":299,"stem":46,"tags":300,"updated":22,"__hash__":301},"blogPl/blog/where-the-battery-goes-on-an-lte-m-sensor.md","Na co czujnik LTE-M zużywa baterię",{"type":85,"value":198,"toc":285},[199,202,205,209,212,215,218,222,225,228,232,235,238,242,245,248,252,255,258,262,265,268,272,275,279,282],[88,200,201],{},"Niemal każde urządzenie bateryjne z modemem komórkowym, przy którym pracowałem, zaczynało się od arkusza kalkulacyjnego obiecującego pięć lat pracy na jednym ogniwie. Potem z terenu wracały pierwsze prototypy z bateriami rozładowanymi do połowy po czterech miesiącach. Prąd uśpienia arkusz zwykle liczył dobrze, za to mylił się niemal we wszystkim, co modem robi po wybudzeniu, a to właśnie modem zjada baterię.",[88,203,204],{},"Poniżej opisuję, jak dziś liczę budżet energetyczny czujnika LTE-M lub NB-IoT, i kilka decyzji, które wpływają na niego najmocniej.",[95,206,208],{"id":207},"zacznij-od-energii-na-jeden-raport","Zacznij od energii na jeden raport",[88,210,211],{},"Najważniejsza liczba to ładunek, który urządzenie zużywa przy każdej wysyłce danych. Prąd uśpienia przyciąga sporo uwagi, bo łatwo go zmierzyć i widnieje na pierwszej stronie każdego datasheetu, a w dobrym projekcie między raportami nie przekracza kilku mikroamperów. W skali doby daje to około jednej dziesiątej miliamperogodziny, czyli niewiele.",[88,213,214],{},"Z raportem jest zupełnie inaczej. Modem się budzi, szuka sieci, czasem ponownie wykonuje attach, otwiera połączenie, zestawia sesję TLS, wysyła kilkaset bajtów, czeka na potwierdzenie, a potem jeszcze przez jakiś czas pozostaje aktywny, zanim sieć pozwoli mu zasnąć. W trakcie nadawania moduł komórkowy potrafi impulsowo pobierać kilkaset miliamperów, a cała sekwencja nawet przy bezproblemowym przebiegu trwa często kilka sekund. Przy średnim poborze rzędu stu miliamperów przez dwie sekundy wychodzi około 0,055 mAh na raport.",[88,216,217],{},"Weźmy teraz czujnik, który wysyła raport co piętnaście minut. To 96 raportów na dobę i nieco ponad pięć miliamperogodzin, mniej więcej pięćdziesiąt razy więcej niż zużycie w uśpieniu. Litowe ogniwo AA o pojemności około 2600 mAh wytrzyma przy takim profilu mniej więcej rok i trzy miesiące, i to zanim swoje zabiorą temperatura i starzenie. Niemal cały budżet pochłaniają raporty, więc o czasie życia urządzenia decydują ich liczba i koszt pojedynczego raportu.",[95,219,221],{"id":220},"raportuj-rzadziej-ale-wysyłaj-więcej-naraz","Raportuj rzadziej, ale wysyłaj więcej naraz",[88,223,224],{},"Najtańsza optymalizacja to prawie zawsze grupowanie danych. Większość czujników, które mierzą co piętnaście minut, wcale nie musi dostarczać każdego odczytu w ciągu piętnastu minut. Jeśli urządzenie zbierze cztery odczyty i wyśle je raz na godzinę, koszt wybudzenia ponosi 24 razy na dobę zamiast 96, a dodatkowe bajty w wiadomości nie kosztują prawie nic, bo stały narzut na zestawienie połączenia wielokrotnie przewyższa sam payload. W naszym przykładzie już to jedno zmniejsza dobowy budżet z ponad pięciu do około półtorej miliamperogodziny.",[88,226,227],{},"Wyjątkiem są alarmy. Urządzenie może grupować rutynowe odczyty, a mimo to wysłać dane natychmiast po przekroczeniu progu. Ten podział na dane rutynowe i zdarzenia to zwykle najcenniejszy temat do omówienia z zespołem produktowym na wczesnym etapie, bo od niego zależy cały budżet energetyczny.",[95,229,231],{"id":230},"niech-sieć-porządnie-cię-uśpi","Niech sieć porządnie cię uśpi",[88,233,234],{},"LTE-M i NB-IoT mają dwa mechanizmy zaprojektowane właśnie z myślą o takich urządzeniach. Power Saving Mode (PSM) pozwala urządzeniu pozostać zarejestrowanym w sieci przy całkowicie wyłączonym radiu, dzięki czemu po wybudzeniu może wysłać dane bez pełnej procedury attach. Extended discontinuous reception, w skrócie eDRX, pozwala urządzeniu, które musi pozostać osiągalne, tylko co jakiś czas sprawdzać, czy czekają na nie dane, zamiast nasłuchiwać bez przerwy.",[88,236,237],{},"W PSM urządzenie prosi sieć o dwa timery. Pierwszy określa, jak długo po wysłaniu danych pozostaje osiągalne, drugi, jak długo może spać, zanim znów będzie musiało zgłosić się do sieci. Haczyk, na którym wiele osób się wykłada, polega na tym, że to tylko prośby. Wartości przydziela sieć i różnią się one między operatorami, czasem nawet między komórkami tego samego operatora. Modem podaje, co faktycznie dostał. Przydzielone wartości zawsze loguję z urządzeń w terenie, bo urządzenie, które poprosiło o krótkie okno aktywności, a po cichu dostało dużo dłuższe, potrafi po każdym raporcie spalić zaskakująco dużo ładunku na nasłuchiwanie, w którym nic nie przychodzi.",[95,239,241],{"id":240},"protokoły-które-walczą-z-radiem","Protokoły, które walczą z radiem",[88,243,244],{},"Standardowy klient MQTT po TCP projektowano z myślą o urządzeniach stale podłączonych do sieci. Domyślnie wysyła pingi keepalive co minutę lub dwie (w kliencie ESP-IDF co 120 sekund), a każdy z nich budzi radio, co całkowicie przekreśla sens PSM. Urządzenie, które całą dobę trzyma otwarte połączenie MQTT, będzie tkwić w stanie o znacznie wyższym poborze mocy niż takie, które łączy się, wysyła dane i rozłącza.",[88,246,247],{},"Podobnie kosztowny jest TLS. Pełny handshake to kilka round tripów i sporo danych na certyfikaty, a na łączu komórkowym każdy kolejny round trip trzyma radio włączone trochę dłużej. Pomagają wznawianie sesji i krótsze łańcuchy certyfikatów. W produktach o najniższym poborze energii CoAP po UDP z DTLS i connection ID potrafi zredukować całą wymianę do jednego krótkiego impulsu, kosztem mniej znanego stosu i backendu, który musi obsługiwać CoAP. Wiele zespołów zostaje przy MQTT i po prostu łączy się dopiero wtedy, gdy ma coś do wysłania. Uważam to za rozsądny kompromis.",[95,249,251],{"id":250},"zasięg-zmienia-wszystko","Zasięg zmienia wszystko",[88,253,254],{},"Powyższe liczby zakładają przyzwoity sygnał. Przy słabym zasięgu LTE-M i NB-IoT powtarzają transmisje, czasem wielokrotnie, żeby urządzenie schowane głęboko w budynku nadal mogło się połączyć. Każde powtórzenie wydłuża czas pracy radia, więc urządzenie w piwnicy może na jeden raport zużyć wielokrotnie więcej energii niż to samo urządzenie na parapecie.",[88,256,257],{},"Dlatego przy każdym raporcie zawsze odpytuję modem o jakość sygnału i parametry zasięgu, a wyniki wysyłam do backendu. Kiedy flota już działa, te dane tłumaczą większość przypadków nietypowo szybkiego rozładowania baterii. Pozwalają też sformułować konkretne wytyczne montażowe, bo przesunięcie urządzenia o metr czy dwa potrafi czasem mocno wpłynąć na czas pracy na baterii.",[95,259,261],{"id":260},"bateria-też-ma-coś-do-powiedzenia","Bateria też ma coś do powiedzenia",[88,263,264],{},"Ogniwa litowo-chlorkowo-tionylowe to typowy wybór do czujników o długim czasie pracy ze względu na pojemność i bardzo niskie samorozładowanie. Źle znoszą jednak nagłe impulsy dużego prądu, zwłaszcza w niskiej temperaturze albo po długim okresie bezczynności, a podczas impulsu nadawczego modemu napięcie potrafi spaść na tyle, że w trakcie raportu dochodzi do resetu brownout. Typowe rozwiązanie to kondensator albo HLC (hybrid layer capacitor) przy ogniwie, który dostarcza krótkie szczyty prądu, a bateria powoli go doładowuje. Warto to uwzględnić już na etapie projektu sprzętu, bo dodanie go później oznacza nową rewizję płytki.",[88,266,267],{},"Deklarowana pojemność również zakłada łagodne warunki. Niska temperatura, duże obciążenia impulsowe i lata leżakowania w magazynie zmniejszają to, co faktycznie da się z ogniwa wyciągnąć, więc zanim uwierzę w jakikolwiek szacunek czasu pracy, odejmuję od wartości z datasheetu solidny zapas.",[95,269,271],{"id":270},"zmierz-to","Zmierz to",[88,273,274],{},"Kiedy mam już prototyp, chcę zmierzyć prawdziwe urządzenie w prawdziwej sieci. Power profiler, który rejestruje zarówno mikroamperowy prąd uśpienia, jak i szybkie impulsy dużego prądu podczas transmisji, pokazuje dokładnie, na co każdy raport wydaje ładunek, i zwykle kogoś zaskakuje. Lubię nagrać kilkadziesiąt pełnych cykli wybudzenia w sieci docelowego operatora, przy dobrym i słabym sygnale, a potem wstawić zmierzony ładunek na raport z powrotem do budżetu.",[95,276,278],{"id":277},"co-z-tego-wszystkiego-wynika","Co z tego wszystkiego wynika",[88,280,281],{},"Składając to wszystko w całość, dochodzę zwykle do podobnego planu dla czujnika komórkowego, który ma długo działać na baterii. Urządzenie zbiera rutynowe odczyty w kilka raportów na dobę, a zdarzenia wysyła od razu. Śpi w PSM z timerami, które ktoś porównał z tym, co sieć faktycznie przydziela, a każde połączenie utrzymuje tak krótko, jak pozwala protokół. Przy każdym raporcie zapisuje jakość sygnału, żeby później dało się wyjaśnić przypadki odstające, a jego zasilanie zaprojektowano pod szczytowy pobór modemu. Potem całość się mierzy, zanim ktokolwiek obieca klientowi konkretny czas pracy na baterii.",[88,283,284],{},"Jeśli dobierasz baterię do urządzenia z modemem komórkowym i liczby nie do końca się zgadzają, chętnie na nie spojrzę.",{"title":176,"searchDepth":177,"depth":177,"links":286},[287,288,289,290,291,292,293,294],{"id":207,"depth":177,"text":208},{"id":220,"depth":177,"text":221},{"id":230,"depth":177,"text":231},{"id":240,"depth":177,"text":241},{"id":250,"depth":177,"text":251},{"id":260,"depth":177,"text":261},{"id":270,"depth":177,"text":271},{"id":277,"depth":177,"text":278},"Budżet energetyczny czujnika LTE-M na baterii: dlaczego dominuje w nim radio i które ustawienia decydują, czy bateria wytrzyma rok, czy pięć lat.","pl",{},"7 min czytania",{"title":196,"description":295},[12,50,51,52],"6mqNuJSy7DtW90UNvTQhjO7aesObisQXXcGUd8-_Ww8",1792141329501]