-
Notifications
You must be signed in to change notification settings - Fork 2
Wireless
Kravitz Lab edited this page Jan 26, 2026
·
1 revision
The FED4 supports wireless connectivity via Hublink, which uses BLE to connect nodes (FED4) to a gateway, and the gateway to hublink.cloud for time sync, file uploads, and alerts. FED4 is automatically configured for hublink.cloud through the meta.json file on the SD card—no Hublink-specific code is required beyond enabling it.
Automatic configuration (meta.json)
- The
meta.jsonschema is compatible with hublink.cloud. Ahublinksection configures BLE advertising and upload behavior:-
advertise— BLE advertising name (e.g."FED4"). -
advertise_every— seconds between advertising periods (e.g. 300). -
advertise_for— duration of each advertising period in seconds (e.g. 30). -
upload_path,append_path— where files go in cloud storage (e.g./FED,subject:id). -
disable— settrueto turn Hublink off.
-
-
subject,device, etc. inmeta.jsonare used for metadata and paths. The same file drives both FED4 metadata and Hublink; one config, automatically applied when Hublink is enabled.
Enabling Hublink
- Set
fed.useHublink = truebeforefed.begin(...).begin()then callsinitializeHublink()(readsmeta.json, starts Hublink).run()callssyncHublink()before sleep—sync is automatic each wake cycle. -
initializeHublink()— init Hublink (uses SD_CS pin); registersonHublinkTimestampReceivedfor RTC updates. -
syncHublink()— sets battery level, low-battery alerts, and runshublink.sync()(advertise/connect, upload files, receive time).
What runs automatically
-
RTC time sync — timestamps from Hublink update the RTC via
adjustRTC(). -
Low-battery alerts — battery under 20% triggers
hublink.setAlert("Low Battery!")before sync. -
File uploads — log files (and
meta.json) are uploaded according toupload_path/append_pathwhen the gateway is in range.
Optional exclusion
-
#define FED4_EXCLUDE_HUBLINKbefore#include <FED4.h>removes Hublink from the build to save code size.
Requirements: Hublink library, SD card with meta.json, gateway in range for BLE, and internet for the gateway → hublink.cloud.
See FED4_Hublink.cpp, Hublink examples, meta.json example. Full config and cloud usage: hublink.cloud/docs.