No, Your Device Doesn't Have to Send JSON

A common Serial Studio misconception: because the project file is JSON, the device must send JSON. It doesn't. Send CSV, binary, or anything a parser reads.

A device sending plain CSV and binary bytes, and a separate JSON project file on the host that describes the dashboard

No, your device does not have to send JSON to work with Serial Studio. It never did. The misconception is one of the most common ones about the app, and it has tripped up a lot of people over the years. Somebody sees the Project Editor described as editing "JSON project files," or notices the project saves as a .ssproj (which is JSON), and concludes that their microcontroller has to output JSON. Then they go write a JSON serializer on an 8-bit micro, watch it eat their flash and their loop time, and wonder why such a simple task got so hard. It didn't have to.

Two different files, two different jobs

The confusion comes from mixing up two separate things that both happen to involve the word "format."

  • The project file (.ssproj) lives on your computer. It is a JSON document, and it describes the dashboard: the groups, datasets, widgets, alarms, and layout. It is configuration, written and read by Serial Studio, not by your device. Think of it as the blueprint.
  • The wire format is whatever your device actually sends down the cable or the socket. That is entirely up to you.

These two never have to match. The JSON in the project file is the host's description of what to draw. It says nothing about how your bytes arrive.

What your device can actually send

The bridge between the two is the frame parser, which takes each incoming frame and turns it into the array of values your datasets expect. Because of that, the wire format can be almost anything:

  • Plain comma-separated numbers. The simplest option, and the one Quick Plot reads with no project file at all.
  • Binary packets. Fixed-layout structs, with a DataView or Lua string.unpack pulling out the fields.
  • Delimited text with any separator, via a built-in template and no code.
  • Established formats like MAVLink, NMEA 2000, MessagePack, TLV, COBS, or SLIP, which the built-in templates already cover.
  • JSON, if you genuinely want to. It is allowed, it is just never required.

The one-line proof is Quick Plot. Print this from an Arduino:

Serial.println("24.7,61,3.9");

Connect, pick Quick Plot, and you get three live plots. There is no project file, and there is not a single byte of JSON anywhere near your device.

The mental model

Keep the two roles separate and it stops being confusing:

  • The .ssproj file is JSON because it is a host-side blueprint for the dashboard.
  • Your device just sends values, in whatever format is cheapest for it.
  • The frame parser maps the wire format onto the datasets the blueprint defines.

So when you build a project, you are describing what you want to see, not dictating what your firmware must speak. Send the simplest thing your device can produce. If that is a line of comma-separated numbers, you are already done. Operation Modes covers Quick Plot versus Project File, and How Serial Studio Turns Bytes Into Datasets explains where the parsing fits.

Frequently asked questions

But my project file (.ssproj) is JSON, doesn't that mean my device has to send JSON too?

No. The .ssproj file is JSON because it is the host-side blueprint, the description of groups, datasets, and widgets that Serial Studio reads. Your device never touches that file. It only needs to send values in whatever wire format the frame parser is set to read: CSV, binary, or anything else it can produce cheaply.

Is CSV really enough for real telemetry?

Yes, for most projects. A line like 24.7,61,3.9 is exactly what Quick Plot reads with zero setup, and the same comma-separated format works fine inside a full project too. Reach for binary packets only when you have a concrete reason, such as bandwidth limits or a sensor format that's awkward to print as text.

Can my device send JSON anyway, if I already parse it for something else?

Sure. JSON is a supported wire format; it is just never mandatory. If your firmware already builds JSON for another reason, the frame parser can read it like any other format. The lesson here isn't that JSON is banned, it's that nothing about the project file forces it on your device.

Comments

Copied to clipboard!