Giter Club home page Giter Club logo

Comments (9)

cjbe avatar cjbe commented on June 15, 2024

IMHO a JSON command/payload structure that passes the (JSON) payload on to various handler functions sounds like it will do everything we need, and give a good reward/effort ratio.

from stabilizer.

jordens avatar jordens commented on June 15, 2024

My suggestion and preference is to go to MQTT (or something else if there are good alternatives) as soon as possible. To me this seems much better for a bunch of reasons and it was the plan (#3) all along. There is the beginning of a no-std mqtt parser and some potentially reusable server code that may help. ffi-ing the paho bindings is probably not worth it. It doesn't look too hard to implement the rest. @astro seemed interested and I know @gkasprow has used mqtt for several of his projects. It would be great if we could get a student to lead this. no-std MQTT is a key building block for embedded Rust and I am pretty sure it would receive wide usage (certainly much wider than another cutsom json req-resp).

from stabilizer.

gkasprow avatar gkasprow commented on June 15, 2024

I used MQTT from Arduino libs. It is also STM32duino so porting should be trivial. But it is not RUST...

from stabilizer.

jordens avatar jordens commented on June 15, 2024

Or CoAP: Several implementations in Rust and no_std.

from stabilizer.

jordens avatar jordens commented on June 15, 2024

And now there is embedded-mqtt, thanks to @ryan-summers for pointing it out.

from stabilizer.

dnadlinger avatar dnadlinger commented on June 15, 2024

Do you have any examples for what you would consider a well-designed interface using MQTT?

I am primarily interested in two interfaces for Stabilizer:

  • A way to set system parameters such as IIR coefficients, reset error indicators, etc., easily extensible for different hardware variants (e.g. via an RPC-like interface), and
  • high-rate real-time streaming of data (at least one 16 bit channel at the full 1 MS/s rate continuously).

MQTT's pub-sub messaging model doesn't seem to be a good match for either, because of the obvious impedance mismatch in the first case, and the data rate in the second (particularly considering the limited on-device computing power).

from stabilizer.

jordens avatar jordens commented on June 15, 2024

Mqtt is perfectly fine for the first use case (IIR configuration, streaming configuration, flag management, enable/disable, commands, request-response) and also for status monitoring at ~Hz rate.
What do you mean by impedance mismatch? Compared to the requirements this device has a massive amount of unused computing power. It can easily saturate the Ethernet link and could also overwhelm any MQTT broker.

For full/high rate streaming data I see few other options than custom binary (using one of the many serialization options in rust). But streaming is not really within the scope of this issue. And JSON for streaming full-rate data is a terrible idea.

from stabilizer.

jordens avatar jordens commented on June 15, 2024

E.g. look at the AWS IoT Core mqtt topic design guide.

Example:

  • application is sinara or artiq
  • context is e.g. opticlock
  • thing-name is the name of a Stabilizer/Booster/Thermostat, e.g. clk-fiber

And then you could have the following MQTT topics (PUBLISH/SUBSCRIBE from device perspecitve):

  • publish ADC/DAC telemetry: dt/sinara/opticlock/clk-fiber/analog
  • publish filter error flags, digital state, counters dt/sinara/opticlock/clk-fiber/state
  • subscribe IIR coefficients and filter configuration: dt/sinara/opticlock/clk-fiber/iir1
  • subscribe to streaming configuration (target IPs, rate, etc): dt/sinara/opticlock/clk-fiber/stream
  • subscribe to save-settings or reset commands: cmd/sinara/opticlock/clk-fiber/req
  • publish to the command results to cmd/sinara/opticlock/clk-fiber/res

Payloads TBD but could well be some JSON for e.g. straight telegraf/influxdb ingest or AWS IoT core compat.

from stabilizer.

jordens avatar jordens commented on June 15, 2024

Forked into individual issues (see above).

from stabilizer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.