Module Integration Guides
...
Rust ESP-IDF
Pushing data to Bytebeam
1 min
you can use bytebeam client to push data to docid\ y7umxyghxnlxyfcevoggc follow docid\ qlmwlqu6zjj6ena bffhw guide to create streams pub fn publish to stream( \&self, // bytebeam client stream name \&str, sequence u32, payload impl serialize, ) > anyhow result\<u32> payload you want to publish must be something that can be serialized to json lets say you have " led status " stream with field " status " you can create a struct and use serde serialize attribute \#\[derive(serialize)] struct ledstream { // your custom fields! status string, } fn main() { // let bytebeam client = bytebeamclient init()?; let sequence = 1; let message = ledstream { status "on" into(), }; // you can remove expect and handle the error bytebeam client publish to stream("led status", sequence, message) expect("published successfully"); // } note every stream has id and timestamp fields as well, we add them internally, so it is recommended to not include them in your custom struct!
