Arduinojson: prettyPrintTo doesn't work on Arduino mkr1000

Created on 1 Aug 2016  路  9Comments  路  Source: bblanchon/ArduinoJson

root.prettyPrintTo(Serial);
this print

{
"sensor": "gps",
"time": 1,
"data": [
4.756080,
2.302038
]
}

but root.printTo(Serial);
print{"sensor":"gps","time":1351824120,"data":[48.756080,2.302038]}

The "time" is not right.
I use IDE 1.6.10
arduino mkr1000

bug

Most helpful comment

OK, I managed to reproduce the bug on mkr1000.
Give me some more time to figure out what going on.

All 9 comments

Here is a screen capture, I took this morning with Arduino IDE 1.6.10 and a Dueminalove:

image

There must be something special in your setup.

Can you provide more context?

54f79100-3dfb-46b4-8f4e-d48ffdb3f661
6ee983c3-9343-4d0f-b83d-58983330c4ff

It seems to be a problem with line-endings.

At first, I believed that this was because you are running on OSX.
So I installed Arduino on my Mac, but I don't have the same problem.

The issue must be somehow related to the mkr1000.
Please make sure you're using the latest core for SAMD (it seems to be 1.6.6).

If the problem persists, please try to run this:

Serial.println("line1");
Serial.println("line2");
Serial.print("line3");
Serial.println();
Serial.print("line4");
Serial.println();
Serial.print("line5");

And the output should be:

line1
line2
line3
line4
line5

I try this code and it work fine.
And the issue is the same on windows.

I ordered a mkr1000; hopefully, I'll manage to understand what going on here.
It's coming from the UK so I'll only have it next week.

I just received the board.
I'll test this ASAP.

OK, I managed to reproduce the bug on mkr1000.
Give me some more time to figure out what going on.

Thank u

That was not easy, but I found it!!!!

It was a bug in Arduino SAMD Core.
It's been fixed on May 27th by https://github.com/arduino/ArduinoCore-samd/commit/8ef9bb3d7bd026b57a8568030d8992644c9b8de8 and https://github.com/arduino/ArduinoCore-samd/commit/8d0c1674628df1c2c7592f4fc17467c694f5a1be.
Unfortunately, version 1.6.6 only includes modifications up to May 19th, so the fix is not available through the Arduino Boards Manager.

I recommend to apply the modification manually or wait until the next release of the Arduino SAMD Core.

PS: this information was added to the wiki

Was this page helpful?
0 / 5 - 0 ratings

Related issues

HilalAH picture HilalAH  路  3Comments

koffienl picture koffienl  路  3Comments

ligantx picture ligantx  路  4Comments

kylegordon picture kylegordon  路  6Comments

egadgetjnr picture egadgetjnr  路  3Comments