profile
viewpoint
Benoît Blanchon bblanchon France https://blog.benoitblanchon.fr 🐂 Pathological Yak Shaver

bblanchon/ArduinoJson 4823

📟 JSON library for Arduino and embedded C++. Simple and efficient.

bblanchon/ArduinoTrace 99

📓 A dead-simple tracing library to debug your Arduino programs

bblanchon/ArduinoStreamUtils 66

💪 Power-ups for Arduino streams

bblanchon/dllhelper 27

How to GetProcAddress() like a boss 😎

bblanchon/cpp4arduino 22

Samples files for cpp4arduino.com

bblanchon/BuckOperator 10

:heavy_dollar_sign: The C++ "buck" operator (aka the dollar sign operator)

bblanchon/BlogRipper 7

Get links to all articles of a blog

bblanchon/disable-windows-keys 3

A tiny application that disables the Windows keys of your keyboard. Very useful in games!

bblanchon/CodeJam 2

My attempts to solve the puzzles of Code Jam

bblanchon/CsharpLeetSpeak 2

Proof of concept: modify literal strings of an assembly at runtime

issue openedbblanchon/ArduinoJson

Json writing directly to a stream

Is it possible to write directly to a stream with AduinoJson, like a JsonWriter class? Is it at all possible to directly write to a stream using your library and do serialization on the fly?

Much like the JsonWriter classes out there: e.g. https://github.com/timnew/ArduinoJsonWriter

I have seen many "direct writing" classes out there, but to me it is really not clear if your library always writes to memory first, and then serializes into a (buffered) stream.

How does that work with your library, maybe I am just missing something.

Thanks for explaining.

created time in an hour

created repositorysteeve/ryzentosh

OpenCore Configuration for Ryzen 3950x with ASUS Crosshair VIII Hero (Wi-Fi) X570

created time in 6 hours

created repositorysteeve/ryzentosh

created time in 6 hours

PublicEvent

issue commentbblanchon/ArduinoJson

cannot enable STD_STRING

@bblanchon Thanks for your reply! Done that but still not working...

fabioinfo44

comment created time in 10 hours

startedbblanchon/ArduinoJson

started time in 10 hours

issue openedbblanchon/ArduinoJson

ESP8266, PubSubClient - Speed parity between publish methods.

Before I begin, this is a fantastic library and the eBook has been a huge game changer for me with respect to optimizing the use of this library in my projects, so thanks 👍.

This issue, is not exactly a bug but more an observation which I would appreciate some help in understanding / resolving.

Essentially, if I use the method of sending a payload using the PubSubClient as described here everything works as expected and the data finishes publishing rapidly.

However, the PubSubClient has a write method --> DOCS, that means we don't have to create a char buffer before sending, helping preserve some precious memory. Below is my usage

   mqttClient.beginPublish(topic, measureJson(payload), false);
   serializeJson(payload, mqttClient);
   if (mqttClient.endPublish()) {
           DEBUG_APP("MQTT Send Success to %s\n", topic);
           return true;
    } else {
           DEBUG_APP("MQTT Send Failed: Len --> %d Topic:%s\n",measureJson(payload), topic);
           return false;
    }    

This works, the data gets sent as expected, however there is a huge time penalty, in the order of seconds for the same payload. (I haven't had a chance to get the actual time penalty.)

Would you have any pointers as to what I can look into to use this method and gain the speed back, not creating temp buffers to me seems like a win, but not at the speed penalty.

Many Thanks,

created time in 12 hours

issue openedbblanchon/ArduinoJson

cannot enable STD_STRING

lib\ArduinoJson\src/ArduinoJson/Serialization/Writer.hpp:18:26: error: 'const class String' has no member named 'write'
     return _dest->write(c);
                          ^

```Searching here for this issue I came across on PlatformIO, I found that I should do the following defines, but I tried both together and once at a time and the error persists.

#define ARDUINOJSON_ENABLE_STD_STREAM 1 #define ARDUINOJSON_ENABLE_STD_STRING 1 #include <ArduinoJson.h>


created time in 15 hours

starteddandavison/delta

started time in 15 hours

startedbblanchon/cpp4arduino

started time in 16 hours

created tagbblanchon/pdfium-binaries

tagchromium/4334

📰 Binary distribution of PDFium

created time in 18 hours

startedalexeagle/ts-from-bazel

started time in a day

startedbblanchon/ArduinoJson

started time in a day

fork tyzjames/ArduinoJson

📟 JSON library for Arduino and embedded C++. Simple and efficient.

https://arduinojson.org

fork in a day

startedandybrewer/mvp

started time in a day

startedbblanchon/ArduinoJson

started time in 2 days

startedbblanchon/ArduinoJson

started time in 2 days

startedbblanchon/ArduinoJson

started time in 2 days

startedbblanchon/ArduinoJson

started time in 3 days

startedbblanchon/ArduinoJson

started time in 3 days

fork YSChoi123/ArduinoJson

📟 JSON library for Arduino and embedded C++. Simple and efficient.

https://arduinojson.org

fork in 3 days

startedbblanchon/django31-sse-demo

started time in 3 days

startedbblanchon/ArduinoJson

started time in 3 days

startedbblanchon/ArduinoTrace

started time in 4 days

startedbblanchon/cpp4arduino

started time in 4 days

startedbblanchon/ArduinoJson

started time in 5 days

startedbblanchon/ArduinoJson

started time in 5 days

startedbblanchon/ArduinoJson

started time in 5 days

startedoctol/vim-cpp-enhanced-highlight

started time in 5 days

more