Upload tot Nano clone works, to Nano Every does not work

Dear All,

I hope you are well!
I kindly ask your support for an issue I am facing with my new Arduino Nano Every. Thank you very much in advance for your kind support and feedback.

I have tried to find a solution in several fora, but I was not able to solve the issue. I have some experience with Arduino, but I am not that pro that I understand everything.

Background:
I am developing a weather station with an Arduino Mega. But to have some fun with the intermediate results I put my first working concept on an Arduino Nano (clone) and it works.
Configuration: Arduino Nano (clone), DHT-22 and a LCD12864 display.

Problem:
Because I was facing some issues some memory problems (Memory shortage during compilation, as next step I want to extend with a BMP280) I bought myself 2 Arduino Nano Every (make: Arduino). I copied the sketch to the new Every board. Result: I did not work. I looks like the sketch is not transferred to the Every. Of course I changed the settings in the IDE for this board.

I tried an alternative: I created a simple sketch for the Every: declared some variables, do some simple math and write the values with Serial.println to my laptop, result: it works fine! My conclusion: the new Every board is fine and also the settings in the IDE are correct to communicate with the board (or am I wrong?). I am also able to receive the board info.

When I went back to the first sketch (“the simple weather station”) it is again not working.

For the complete picture: I am working with a Macbook Pro and Big Sur, Arduino IDE 4.

I have also tried to start up again my laptop and IDE, but to positive result.

Attached I added 2 compilation reports (I don’t know this is the right name).

First: The report of the Arduino Nano clone which works fine.
Second: The report of the Arduino Nano Every which doesn’t work.

Of course I see some differences especially with the #-bars (Reading/Writing), but I am not able to judge this.

Your kind support is much appreciated. Thank you!!

Enjoy your day, kind regards, Pieter Verkerk - The Netherlands

compilation report.pdf (51.1 KB)

The sketch was uploaded successfully. So your sketch was transferred and is running on the Nano Every, it's just not behaving as you expect it to.

So in order to help, we'll need more information from you:


Please post your full sketch.

If possible, you should always post code directly in the forum thread as text using code tags:

  • Do an Auto Format (Tools > Auto Format in the Arduino IDE or Ctrl + B in the Arduino Web Editor) on your code. This will make it easier for you to spot bugs and make it easier for us to read.
  • In the Arduino IDE or Arduino Web Editor, click on the window that contains your sketch code.
  • Press "Ctrl + A". This will select all the text.
  • Press "Ctrl + C". This will copy the selected text to the clipboard.
  • In a forum reply here, click the "Reply" button.
  • click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum's code tags markup to your reply.
  • Press "Ctrl + V". This will paste the sketch between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.
  • Repeat the above process if your sketch has multiple tabs.

This will make it easy for anyone to look at it, which will increase the likelihood of you getting help.

If the sketch is longer than the 9000 characters maximum allowed by the forum, then it's OK to add it as an attachment (but please do it as a normal txt file, NOT a PDF). After clicking the "Reply" button, you will see an "Attachments and other settings" link that will allow you to make the attachment.

When your code requires a library that's not included with the Arduino IDE please post a link (using the chain links icon on the forum toolbar to make it clickable) to where you downloaded that library from or if you installed it using Library Manger (Sketch > Include Library > Manage Libraries in the Arduino IDE or Libraries > Library Manager in the Arduino Web Editor) then say so and state the full name of the library.


Please provide the exact connections between the Nano Every, DHT-22, and LCD12864

//simpel weerstation voor Nano
//inlezen van Temp en RV - indoor
//presenteren van de 2 waarden beide waarden
//actuele en vorige waarden van Temp en RV vergelijken
//en bij groter/kleiner/gelijk dit aangeven met +/-/=

#include <SimpleDHT.h>

#include <Arduino.h>
#include <U8g2lib.h>
#include <SPI.h>
#include <Wire.h>


//Pins on NANO for LCD display
U8G2_ST7920_128X64_1_SW_SPI u8g2(U8G2_R0, 13, 11, 12, 8);      //deze opnieuw ingesteld voor NANO

// pin configuration
// LCD12864          MEGA       NANO
// clock (pin 6)     42         D13
// data (pin 5)      44         D11
// CS (pin 4)        40         D12
// reset (pin 3)     GND        GND    not connected
//
// VCC 5VDC (pin 2)
// GND (pin 1)

// for DHT22 sensor
//      VCC: 5V or 3V
//      GND: GND
//      DATA-01: 2 - indoor

int pinDHT22_indoor = 2;

SimpleDHT22 dht22;

//declaratie van variabelen

float temp_new_in = 0; //variabele voor nieuwe temperatuur, moet float zijn ivm cijfers achter de komma
float temp_old_in = 0;

int delaytime = 2000;

int RV_new_in = 0;     //variabele voor nieuwe RV, integer is voldoende
int RV_old_in = 0;     //variabele voor oude RV, integer is voldoende

void setup() {
  Serial.begin(9600);
  u8g2.begin();

}

void loop() {

  //====BEGIN======PAGE02=======ACTUAL TEMPERATURE INDOOR=============
  //use read2 to get a float data, such as 10.1*C - read INDOOR temp and humidity

  float temperature_in = 0;
  float humidity_in = 0;

  int err2 = SimpleDHTErrSuccess;
  if ((err2 = dht22.read2(pinDHT22_indoor, &temperature_in, &humidity_in, NULL)) != SimpleDHTErrSuccess) {
    return;
  }

  u8g2.firstPage();
  do {

    //write screen title
    u8g2.setFont(u8g2_font_7x14_mr);                      //set font
    u8g2.drawStr(26, 13, "TEMPERATUUR grC");             //print title

    u8g2.setFont(u8g2_font_logisoso24_tf);                //set font
    u8g2.setCursor(10, 60);                               //gaan naar verderop op 2e regel
    temp_new_in = temperature_in, 1;
    u8g2.print(temp_new_in, 1);                          //schrijf waarde temperatuur met 1 decimaal nauwkeurig

    //geef met symbolen weer of daalt, stijgt of stabiel is

    u8g2.setFont(u8g2_font_7x14_mr);                //set font;
    if (temp_old_in > temp_new_in)                  //als de oude temperatuur groter is dan de nieuwe temperatuur, dan daalt de temperatuur
    {
      u8g2.drawStr(1, 13, "-");
    }

    if (temp_old_in < temp_new_in)                  //als de oude temperatuur kleiner is dan de nieuwe temperatuur, dan stijgt de temperatuur
    {
      u8g2.drawStr(1, 13, "+");
    }

    if (temp_old_in == temp_new_in)         //als de oude temperatuur gelijk is aan de nieuwe temperatuur, dan is de temperatuur stabiel
    {
      u8g2.drawStr(1, 13, "=");
    }


  } while (u8g2.nextPage());

  delay(delaytime);



  //indoor humindity

  u8g2.firstPage();
  do {

    u8g2.setFont(u8g2_font_7x14_mr);                   //set font
    u8g2.drawStr(30, 13, "% LUCHTVOCHT");              //print screen title

    u8g2.setFont(u8g2_font_logisoso24_tf);
    u8g2.setCursor(30, 60);                           //go to position
    RV_new_in = humidity_in, 0;
    u8g2.print(RV_new_in);                           //print RH data with 0 decimal

    Serial.print("temp is: ");
    Serial.println(RV_new_in);

    //geef weer met pijlen of de outdoor RV daalt, stijgt of stabiel is

    u8g2.setFont(u8g2_font_7x14_mr);                   //set font

    if (RV_old_in > RV_new_in)                 //als de oude RV groter is dan de nieuwe RV, dan daalt de RV
    {
      u8g2.drawStr(1, 13, "-");
    }

    if (RV_old_in < RV_new_in)     //als de oude RV kleiner is dan de RV temperatuur, dan stijgt de RV
    {
      u8g2.drawStr(1, 13, "+");
    }

    if (RV_old_in == RV_new_in)         //als de oude RV gelijk is aan de nieuwe RV, dan is de RV stabiel
    {
      u8g2.drawStr(1, 13, "="); // presenteer RV stabiel - 2197 arrow right up *  2198 arrow down    2192 = arrow horizonta
    }

  }

  while (u8g2.nextPage());

  delay(delaytime);

  //====END====== HUMIDITY INDOOR=============



  temp_old_in = temp_new_in;  //vorige indoor temperatuur bewaren

  RV_old_in = RV_new_in;     //vorige outdoor RV bewaren

}

Thank you for your reply. Attached the sketch, not very beautiful, but it should work, I hope. Thank you for your feedback.

Short update: I installed the last version of the U8g2lib.h. I found out there was a newer version. After starting the IDE again and compiling&uploading the sketch again there was no visible change. I left the Arduino Nano Every with the empty screen. But when I looked again after about 15 minutes there was one time the temperature presented and 1 times the humidity. Then screen freezed. After a hard reset on the board and a hard reset with power interruption it did not start again..... only again an empty screen was the result.

Update: I have replaced the SimpleDHT.h by DHT.h. Now it is working well. So problem solved.