Croduino NOVA Serial.print() stops working after pinMode() call

Customer:

I’m working on a project with Croduino NOVA. When I upload code via Arduino IDE, I have a problem with printing messages to the serial monitor. Sometimes messages don’t print at all, and sometimes they start printing but then stop completely. Other tasks I’ve programmed run successfully on NOVA. I’m using Serial.print() to write to the serial monitor. I need to see the messages to debug more complex programs. Is there a way to fix this?

Original message (Croatian)

Radim na jednom projektu sa Croduino Nova-om. Kada prebacim kod preko Arduino IDE-a, imam problem sa ispisom poruka na serial monitor. Nekada se uopće ne ispisuju, a nekada počne ispisivati poruke i u jednom trenutku samo stane. Ostale zadatke koje sam programirao Nova uspješno obavlja. Za pisanje na serial monitor koristim Serial.print() funkciju. Bitno mi je da vidim poruke na serial monitoru kako bi mogao debuggirati složenije programe. Da li postoji način da rješim ovaj problem? Hvala.

[name removed]

Originally submitted via email support on 31 August 2017. Migrated to the forum for community visibility.

Soldered Support:

NOVA always outputs strange characters to the Serial monitor during reset (at the start of code execution) because it uses an unusual baud rate at that moment. After that, it uses the baud rate you set with Serial.begin(), for example Serial.begin(9600). That same baud rate needs to be selected in the Serial monitor as well (bottom right). Please confirm that you have matching baud rates in both places.

Original message (Croatian)

NOVA u trenutku reseta(dakle početka izvođenja koda) uvijek ispisuje u Serial monitoru neobične znakove jer u tom trenutku koristi neuobičajnu brzinu serijske komunikacije(baud).

Nakon toga, koristi brzinu koju ste podesili u Serial.begin, npr. Serial.begin(9600);
ta ista brzina treba biti odabrana i u Serial monitoru(dolje desno)

Ovo je nešto što jednostavno radi, stvarno ne biste trebali imati ovakvih problema. Molim Vas da mi potvrdite da imate iste baud-e na ova dva spomenuta mjesta

Customer:

I have the same baud rate in the code and on the serial monitor. I tried printing characters in CoolTerm as well. The characters print until a moment when error 103: Break Condition appears. Looking at the hexadecimal output from NOVA, the last 3 characters are \n \r and BELL.

Original message (Croatian)

Imam iste baud-ove u kodu i na serial monitoru. Probao sam ispisivati znakove i na CoolTerm. Znakove se ispisuju do nekog trenutka kada odjednom javi error 103: Break Condition. Kada promatram u heksadekadskom zapisu što je Nova poslala, zadnja 3 znaka budu \n \r i BELL.

Soldered Support:

Can you send your Arduino code?

Original message (Croatian)

Možete poslati svoj Arduino kod?

Customer:

The Arduino code is attached. I tried gradually adding parts of the code and noticed that the pinMode command causes problems with printing to the serial monitor. The same code runs normally on nodeMCU ver 0.9.

Original message (Croatian)

Arduino kod je u privitku. Probao sam postepeno dodavati dijelove koda i primijetio sam da naredba pinMode uzrokuje probleme u ispisu znakova na serial monitor. Isti kod se najnormalnije izvršava na nodeMCU-u ver 0.9.

Attachment omitted in migration: HTTP_POST.ino

Soldered Support:

This is an error with LED_BUILTIN which is different for nodeMCU and Croduino NOVA. On NOVA, the LED is on pin 13, while LED_BUILTIN is defined as pin 1 (proof in attachment). When you set pin 1 to OUTPUT, serial communication no longer works because that pin is the TX for UART. The solution is to replace LED_BUILTIN with 13.

Original message (Croatian)

radi se o pogrešci u LED_BUILTIN koja je različita za NoduMCU i za Croduino NOVA pločicu. Na NOVOj se LEDica nalazi na pinu broj 13, dok je LED_BUILTIN definicija kao pin broj 1(dokaz u prilogu). Kada taj pin broj 1 postavite u OUTPUT, serijska komunikacija više ne radi jer je upravo to tx za UART.

Dakle, riješenje je zamijeniti LED_BUILTIN za brojku 13.

Attachment omitted in migration: Screen Shot 2017-09-03 at 21.38.28.png