Core
Core firmware: the fw class, device helpers and free functions.
Everything below is verbatim from the device firmware
(firmware_core.py of Logger Pro and the findyIoT module). fw deliberately has no
start()/measure() - those are plain functions in the
user-editable last.py, attached with fw.start = start and
fw.measure = measure.
Note
Methods reference the firmware module globals (modem,
protocol, db, counter, buffer, wdt, led…)
exactly as on the device.
- findylab.core.Psda = 18
I2C pins of the external ADC (address 104).
- findylab.core.Preed = 15
Reed-switch input (EXT0 deep-sleep wakeup).
- findylab.core.Pinput4 = 4
Direct digital inputs (counted by the ULP as RTC GPIO 10/16).
- class findylab.core.fw[source]
Main firmware class. Verbatim from
firmware_core.py.__init__()does the first-boot bootstrap (IMEI + database defaults).start()andmeasure()are not defined here - they live in the user-editablelast.pyand are attached withfw.start = start/fw.measure = measure.- __init__()[source]
First-boot bootstrap.
Reads the IMEI parameter (200); when empty, powers the modem (power-cycling it once via
findylab.modem.eg915.reset()if it stays silent), reads the real IMEI, initializes the database defaults, re-opens the database and sends thedefaultsreport. Reassigns the module-leveldbin that path.
- seconds_to_next_wakeup(period_seconds)[source]
Computes the seconds until the next wakeup time.
Aligns wakeups to round boundaries of the RTC clock so reports arrive at predictable times.
- Parameters:
period_seconds (int) – The period; one of 60, 300, 900, 1800, 3600 (anything else falls back to 900).
- Returns:
Seconds until the next boundary.
- Return type:
int
- report(alarm=False, datalist=None)[source]
Sends a report to the HiGPS server.
Powers/registers the modem, refreshes the GSM info parameters, then sends
samplingsAlarmorsamplings; on a build error falls back to the minimaldataBatreport. After a confirmed connection the alarm flag, ring-buffers and wakeup counter are reset, the database is stored and a just-committed OTA update is reported back to the server (53 = 0, 54 = 1) via_notifyUpdateResult().- Parameters:
alarm (bool) – Send the alarm variant of the report.
datalist (list) – Parameter IDs to send (defined by the user in
last.py). None keeps the previously set list (protocol.datalist).
- prepareSleep(t, trig)[source]
Releases the pins and enters deep sleep.
Turns the modem off, reconfigures all peripheral pins as inputs and arms the reed-switch EXT0 wakeup when
trigis set, then callsgoodNight().- Parameters:
t (int) – Sleep time in seconds.
trig (bool) – Arm the reed-switch wakeup.
Note
eg915 has no PSM support, so this is a plain
machine.deepsleep()- no network PSM negotiation.
- class findylab.core.device[source]
Device-level helpers. Never instantiated - the methods take no
selfand are called directly:device.getTimestamp()
Verbatim class from
firmware_core.py.- serialNumber()[source]
Returns the unique chip ID.
- Returns:
Hex-encoded
machine.unique_id().- Return type:
str
- memoryTotal()[source]
Returns the allocated heap in KB.
- Returns:
Allocated RAM in kilobytes.
- Return type:
int