Commit Graph
9 Commits
Author SHA1 Message Date
scottp 144efe683e rbtest: timed small messages, one 50 kB message, and MT checks
`rbtest` in the shell sample sends test messages with a 16-byte header
and a counting ramp, so every byte can be checked at the other end.
`rbtest small` sends a few 32-byte messages and logs how long each took,
`rbtest large` sends one of up to 50000 bytes and only with `confirm`,
and `rbtest mt` shows the last MT and checks it. `rb9704 pattern make`
and `check` in python/ make and check the same messages.

rb9704_send_fill writes a message straight into the module's buffer, so
a large generated one is not held twice. overlay-large.conf raises the
limit to 50000 bytes; on the M5Stamp-C3 that links on the USB console
and not beside WiFi, which overflows by 11 kB.

Run against the fake modem on native_sim only; not yet on a real modem.
2026-10-27 11:07:53 +11:00
scottp 83aa6ebd8f Docs: the Stamp-C3 overnight on 0.3.0, the modem up for nearly 12 hours
Left out under the sky with P_EN wired and active low, the modem was up
and answering from 22:41 on 2026-10-25 to 10:35 the next morning, about
11 h 54 min, with no drop, and the Stamp did not reboot. With P_EN
driven the wrong way it had stopped within 5 minutes every time. The
board page, TESTING and CLOUDLOOP say so; the 0.3.0 entry in the
CHANGELOG is left as released, and this goes under Unreleased.
2026-10-26 10:41:07 +11:00
scottp a70e933b71 0.3.0: provisioning and messages to Cloudloop work, and P_EN is active low
The M5Stamp-C3 under open sky, driven over WiFi from its shell, found
the modem provisioned with topics 244 and 313 to 317 and sent two
messages on topic 244, 16 and 17 bytes. Each was with the network 6 to
10 s after the modem took it, and both arrived in Cloudloop whole.
docs/CLOUDLOOP.md, "What has run", records how Cloudloop shows one: the
same bytes in Base64 and in hex.

P_EN is the RockBLOCK's supercapacitor charge enable, header pin 6, and
it is active low. The sample's overlays had it GPIO_ACTIVE_HIGH, so every
begin switched the charger off: the modem ran down and went silent 2 to
5 minutes later, four times indoors and out. The overlays, the README
and the binding now say GPIO_ACTIVE_LOW. With P_EN wired again on the
new firmware the modem stayed up past every earlier drop and sent the
second message.

The control pins follow Ground Control's start-up and shutdown
sequence. I_EN starts and stops the modem and is what makes the pins
present (CONFIG_RB9704_POWER follows iridium-enable-gpios); P_EN and
I_BTD are optional beside it. Shutdown drives I_EN low and waits for
I_BTD to go low before anything else, as start-up waits for it to go
high, so I_EN never moves back before I_BTD has followed. P_EN is driven
only while the modem runs and released to an input while it is off.

docs/boards/stamp_c3.md has the header's pin numbers, V_IN+ against
V_BATT, and P_EN as the cause of the drops. The module, the sample and
the Python tools are 0.3.0.
2026-10-25 22:48:11 +11:00
scottp 0cda7335d6 The modem's UART heard from boot, and the Stamp-C3 under the sky
The module turned the modem UART's receive interrupt off whenever the
library was closed. With the power pins wired, the modem sends about
500 bytes of boot lines as it comes up, to nobody; on the M5Stamp-C3
they overflowed the UART's 128-byte FIFO, after which begin heard only
repeated fragments of old lines and failed with -EIO, and a second
begin crashed the board in the library's line parser (docs/JSPR.md,
section 8, item 2). The interrupt is now on from boot: bytes heard while
the library is closed are thrown away, and when it opens part-way
through a line the rest of that line is too. On the Stamp, 8 of 8 power
cycles and 12 of 12 with 0 to 5 s between power on and begin, where 1 of
6 and none had worked.

The fake modem's raw and before commands write any bytes, now or just
ahead of its next reply, and test_a_boot_burst_while_closed sends a
680-byte boot burst before begin: that overflow on a board through the
rig, a check that it does no harm on native_sim.

docs/boards/stamp_c3.md records the first run under open sky: the
constellation visible and 3 to 5 bars within seconds of begin. It also
records what is open: on the Stamp's 5V the modem stopped answering 2 to
5 minutes after each begin, four times, indoors and out, most likely
its supply; not yet measured, and the tests that would settle it are
listed there. Not yet provisioned, and no message sent.
2026-10-25 22:21:17 +11:00
scottp 4f5834a467 0.2.0: USB-C and the header share a port, and a real 9704 on the Stamp-C3
The 9704's USB-C goes through an FTDI chip to the modem's UART, on the
same lines as the header. With the cable plugged in, that chip drives
the modem's RX: a board on the header hears the modem but cannot reach
it, and the computer on USB gets no answer either. Unplug the USB-C and
power the 9704 from the header. The README says so beside the overlay
example, and docs/CLOUDLOOP.md lists it under "When begin fails".

The M5Stamp-C3 is the first microcontroller to run against a real 9704:
TX and RX only, the modem powered from the Stamp's 5 V pin. begin, info
and signal all answer, with nothing dropped. docs/boards/stamp_c3.md
has the power section and what has run.

no-control-pins.overlay takes P_EN, I_EN and I_BTD out of any board's
overlay at build time, for a modem on four wires. The modem node is
labelled rb9704 in every overlay so it can.

The module, the sample and the Python tools are 0.2.0.
2026-10-25 16:02:45 +11:00
scottp d08364ce58 Sample: the M5Stamp-C3, the shell over WiFi, and the control lines wired
overlay-wifi.conf puts the shell on telnet on any ESP32. At boot it joins
the network stored in flash with `wifi cred add`, and rejoins it after a
drop, for a board out under the sky with no USB.

The M5Stamp-C3 (ESP32-C3, RISC-V) has an overlay: the modem on uart1,
GPIO4 and GPIO5, with P_EN, I_EN and I_BTD on GPIO10, 6 and 7. Its RGB
LED, driven by spi2 on GPIO2, shows the modem's state, and its button
begins, asks for the signal and ends. docs/boards/stamp_c3.md has the
pins, the WiFi commands and the LED's colours. So far it has run WiFi
and telnet, not yet the modem.

The ESP32-S3-DevKitC, ESP32 DevKitC and NUCLEO-U575ZI-Q overlays now
wire the three control lines as well; the table is in docs/TESTING.md.

The README gives the Gitea home and the GitHub mirror, and the boards
as a table of CPU and what each has run.
2026-10-25 13:54:09 +11:00
scottp f97fcab74b Cancel the message in flight, and the small things from the review
rb9704_cancel() and `rb9704 cancel` ask the modem to abandon the MO in
flight; the modem's final status reaches mo_done as -ECANCELED. The
library's async path has no timeout, so this is how an application
frees a modem that has gone quiet mid-send. The status snapshot carries
the in-flight message's id and start time for the application to decide
with.

rb9704_begin zeroes moQueuedMessages: rbBegin empties the queue but not
the count, and a count above zero makes every later send queue without
transmitting.

The fake modem's mo-hold and mo-release stand in for a modem that has
taken a message and said nothing more; a test drives cancel through it.

Also: the shell's send buffer is a shell line, not a fourth message
buffer; the bridge's TX-disable race has a comment; the CLI turns a
Cloudloop error (a bad token's 200 reply included), an unopenable port
and a one-word jspr line into one line and exit 1; conftest reads
request.node; pyproject uses the current license spelling.
2026-10-21 22:43:05 +11:00
scottp 509b9b5b6d Power pins on by default, and a request slot that came back
CONFIG_RB9704_POWER's default read a DT_COMPAT_ variable nothing defined,
so it was never y on its own and the pins went undriven; define it.

A request that ended in -ETIMEDOUT of its own accord, a begin whose
modem never signalled booted, looked to the caller like one it had
abandoned, so neither side gave the slot back and every later call got
-EAGAIN. submit() now reports abandonment apart from the result.

On that boot timeout the supply and enable pins are dropped again, so the
next attempt starts from off. The CLI's messages named paths from the
tree it was carried over from.

Checked on native_sim: the suite against the fake, and begin twice with
the pins on the GPIO emulator, where the second begin now times out
instead of returning EAGAIN.
2026-10-21 22:38:00 +11:00
scottp beb22fb70c Docs: the README, JSPR, Cloudloop, testing
README says what the module adds to Ground Control's library and what it
works around, and how to use it. JSPR.md is the protocol as the library
speaks it, from its source, with its surprises. CLOUDLOOP.md is account
to first message, from WII6's IRIDIUM.md. TESTING.md is the levels, the
rig, and what has passed: Python, native_sim, an ESP32-S3 and an STM32U5
against the fake, and free checks against a real 9704.
2026-10-09 12:48:16 +11:00