Index <= Page index / Phase => Phase 1 – Radio slice (non secure)

Details – Phase 1 – Radio slice (non secure)

Status: prereqs ready (endpoints, simple storage, ESP32 sketch to finalize).

Test procedure (server + ESP32)

1) Run FastAPI node (Station K on PC)

cd backend/obambu_node
uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload

Quick check:

curl http://localhost:8000/health

2) Test device flow (API)

curl -X POST http://localhost:8000/api/v1/device/hello \
  -H "Content-Type: application/json" \
  -d '{"device_id":"DEV-001","fw_version":"0.0.1","station_type":"S"}'

curl "http://localhost:8000/api/v1/device/config?device_id=DEV-001"

curl -X POST http://localhost:8000/api/v1/device/content_index

3) Flash the minimal ESP32 sketch

Fill WIFI_SSID, WIFI_PASS and API_BASE then flash:

// ESP32 Station S – Minimal test sketch (Wi-Fi + /health)
// Fill WIFI_SSID, WIFI_PASS and API_BASE before flashing.

#include <WiFi.h>
#include <HTTPClient.h>

const char* WIFI_SSID = "YOUR_WIFI_SSID";
const char* WIFI_PASS = "YOUR_WIFI_PASSWORD";
const char* API_BASE  = "http://192.168.1.10:8000"; // IP of FastAPI node

const int LED_PIN = 2; // Built-in LED on ESP32 DevKit

void setup() {
  Serial.begin(115200);
  pinMode(LED_PIN, OUTPUT);
  digitalWrite(LED_PIN, LOW);

  connectWiFi();
  pingHealth();
}

void loop() {
  delay(5000);
  pingHealth();
}

void connectWiFi() {
  WiFi.mode(WIFI_STA);
  WiFi.begin(WIFI_SSID, WIFI_PASS);
  Serial.print("WiFi...");
  int retries = 0;
  while (WiFi.status() != WL_CONNECTED && retries < 30) {
    delay(500);
    Serial.print(".");
    retries++;
  }
  
if (WiFi.status() == WL_CONNECTED) {
  Serial.println(" OK");
  Serial.print("SSID: "); Serial.println(WiFi.SSID());
  Serial.print("IP: "); Serial.println(WiFi.localIP());
  digitalWrite(LED_PIN, HIGH);
} else {
  Serial.println(" FAIL");
}

}

void pingHealth() {
  if (WiFi.status() != WL_CONNECTED) {
    Serial.println("WiFi not connected");
    return;
  }
  HTTPClient http;
  String url = String(API_BASE) + "/health";
  http.begin(url);
  int code = http.GET();
  Serial.printf("/health -> %d\n", code);
  if (code > 0) {
    String body = http.getString();
    Serial.println(body);
  }
  http.end();
}

Full source: plan-details/details-blockchain-security_code-per-device/esp32_station_s_min.ino/esp32_station_s_min.ino.

Wi-Fi connection result Phase 1

Note: sample shows “/health -> -1” (Wi-Fi OK, request failed) – to debug on network side.

Device endpoints: hello, config, content_index, content

Goal

Current implementation

Watch / Next