Skip to content

feat: ✨ pico ground station for micrometer launch - #203

Open
ayecptn wants to merge 1 commit into
mainfrom
chris-pico-man
Open

feat: ✨ pico ground station for micrometer launch#203
ayecptn wants to merge 1 commit into
mainfrom
chris-pico-man

Conversation

@ayecptn

@ayecptn ayecptn commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Description

For testing the rec_zephyr.py has to be slightly edited:

SM_UPDATE_FMT = "<IBBBB7dffBBBB"
...
def queue_frame(ftype, mv, plen, crc_ok):
    tag = "OK " if crc_ok else "BAD"
    if ftype == HC12_TYPE_SM_UPDATE and plen == SM_UPDATE_LEN and crc_ok:
        # float lat, float lon, uint8_t sats, uint8_t h, uint8_t m, uint8_t s
        (ts, state, armed, sm_type, _resv,
         altitude, accel, accel_vert, velocity,
         yaw, pitch, roll, lat, lon, sats, h, m, s) = struct.unpack_from(SM_UPDATE_FMT, mv, 0)
        states = SM_STATE_TABLES.get(sm_type)
        name = (states[state] if states and state < len(states)
                else "?%d" % state)
        tname = SM_TYPE_NAMES.get(sm_type, "?%d" % sm_type)
        out_lines.append(
            "[OK ] SM[%s] t=%d ms  state=%-9s armed=%d  alt=%+.2f  "
            "a=%+.2f  av=%+.2f  v=%+.2f  ypr=%+.2f/%+.2f/%+.2f "
            "lat=%f lon=%f sat=%s %s:%s:%s"
            % (tname, ts, name, armed, altitude, accel, accel_vert,
               velocity, yaw, pitch, roll, lat, lon, sats, h, m, s))
    else:
        out_lines.append("[%s] type=0x%02x len=%d" % (tag, ftype, plen))

Related Issues

Closes #

Type of Change

  • feat — new feature
  • fix — bug fix
  • docs — documentation only
  • refactor — no behavior change
  • build / ci — build system or CI changes
  • tests — adding or updating tests

Testing

How was this tested? Which boards / targets were used?

  • west twister -T tests -v --inline-logs passes
  • Tested on hardware: Pico
  • Docs build without warnings: cd doc && make html

Checklist

c = (c >> 1) ^ 0x8408 if c & 1 else c >> 1
tbl.append(c)
return tbl
_CRC_TABLE = _build_crc_table()
"""

from machine import UART, Pin
import utime, time
if GPStime:
try:
h, m, s = [int(x) for x in GPStime.split(':')]
except ValueError:
satellites = parts[7]
GPStime = parts[1][0:2] + ":" + parts[1][2:4] + ":" + parts[1][4:6]
FIX_STATUS = True
except Exception as e:

if FIX_STATUS:
print("\n--- GPS DATA ---")
print("Latitude: " + latitude)
if FIX_STATUS:
print("\n--- GPS DATA ---")
print("Latitude: " + latitude)
print("Longitude: " + longitude)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants