Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Weatherduino_AQM_ESP8266_ASK_v320_b003 Compile Problems
#1

I am trying to compile the latest AQM code but have run into problems. Using Arduino 1.8.13 and ESP8266 Boards Manager 2.7.4, all libraries removed except those provided in the download.. Selected Generic ESP8266 Module as the board(maybe this is wrong?)

I have a Z19B C02 sensor installed, and a HTU21D fitted. AQM is a 7003. Wifi enabled and credentials set. No display.

Here are the error messages. - It's got to be something simple I'm sure but can't see it. Huh
 Arduino: 1.8.13 (Windows 10), Board: "Generic ESP8266 Module, 80 MHz, Flash, Legacy (new can return nullptr), All SSL ciphers (most compatible), dtr (aka nodemcu), 26 MHz, 40MHz, DOUT (compatible), 1MB (FS:64KB OTA:~470KB), 2, nonos-sdk 2.2.1+100 (190703), v2 Lower Memory, Disabled, None, Only Sketch, 115200"          WeatherDuino_AQM_ESP8266_ASK_v320_b003:71:25: error: 'D6' was not declared in this scope #define DUST_RX         D6   // D6 - GPIO12                         ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\WeatherDuino_AQM_ESP8266_ASK_v320_b003.ino:241:30: note: in expansion of macro 'DUST_RX'   SoftwareSerial Dust_Serial(DUST_RX, -1);           // define serial for PMS7003 sensor                              ^WeatherDuino_AQM_ESP8266_ASK_v320_b003:73:25: error: 'D7' was not declared in this scope #define CO2_RX          D7   // D7 - GPIO13                         ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\WeatherDuino_AQM_ESP8266_ASK_v320_b003.ino:249:29: note: in expansion of macro 'CO2_RX'   SoftwareSerial CO2_Serial(CO2_RX, CO2_TX);    // define serial for CO2 sensor                             ^WeatherDuino_AQM_ESP8266_ASK_v320_b003:74:25: error: 'D5' was not declared in this scope #define CO2_TX          D5   // D5 - GPIO14                         ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\WeatherDuino_AQM_ESP8266_ASK_v320_b003.ino:249:37: note: in expansion of macro 'CO2_TX'   SoftwareSerial CO2_Serial(CO2_RX, CO2_TX);    // define serial for CO2 sensor                                     ^WeatherDuino_AQM_ESP8266_ASK_v320_b003:69:25: error: 'D0' was not declared in this scope #define TXData_PIN      D0   // D0 - GPIO16                         ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\WeatherDuino_AQM_ESP8266_ASK_v320_b003.ino:252:25: note: in expansion of macro 'TXData_PIN' RH_ASK ask433(1000, -1, TXData_PIN, -1); // ESP8266: do not use pin 11                         ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\WeatherDuino_AQM_ESP8266_ASK_v320_b003.ino: In function 'void setup()':WeatherDuino_AQM_ESP8266_ASK_v320_b003:69:25: error: 'D0' was not declared in this scope #define TXData_PIN      D0   // D0 - GPIO16                         ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\WeatherDuino_AQM_ESP8266_ASK_v320_b003.ino:365:11: note: in expansion of macro 'TXData_PIN'   pinMode(TXData_PIN, OUTPUT);             ^WeatherDuino_AQM_ESP8266_ASK_v320_b003:70:25: error: 'D4' was not declared in this scope #define PMS7003_SetPin  D4                                ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\WeatherDuino_AQM_ESP8266_ASK_v320_b003.ino:401:11: note: in expansion of macro 'PMS7003_SetPin'   pinMode(PMS7003_SetPin, OUTPUT);           ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\Functions.ino: In function 'void WakeUpDustSensor()':WeatherDuino_AQM_ESP8266_ASK_v320_b003:70:25: error: 'D4' was not declared in this scope #define PMS7003_SetPin  D4                                ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\Functions.ino:64:18: note: in expansion of macro 'PMS7003_SetPin'     digitalWrite(PMS7003_SetPin, HIGH);  // PMS7003 Wakeup the sensor - turns the fan ON                  ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\PMS7003.ino: In function 'void read_PMS7003()':WeatherDuino_AQM_ESP8266_ASK_v320_b003:70:25: error: 'D4' was not declared in this scope #define PMS7003_SetPin  D4                                ^D:\My Documents\Arduino\WeatherDuino_AQM_ESP8266_ASK_v320_b003\PMS7003.ino:43:16: note: in expansion of macro 'PMS7003_SetPin'   digitalWrite(PMS7003_SetPin, LOW);  // Put the sensor to sleep and turn the fan OFF                ^exit status 1'D6' was not declared in this scope This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Reply
#2

Hi,

When posting code, please use the code tags, otherwise its impossible to read the content.
Anyway I think you are compiling for a "Generic ESP8266 Module" instead of LOLIN(Wemos) D1 R2 & mini, thus the compiling error.

Rgs.
Reply
#3

(21-01-2021, 20:21)Werk_AG Wrote:  Hi,

When posting code, please use the code tags, otherwise its impossible to read the content.
Anyway I think you are compiling for a "Generic ESP8266 Module" instead of LOLIN(Wemos) D1 R2 & mini, thus the compiling error.

Rgs.

Thanks Caneira, yes the code errors are unreadable, I agree. Will give it a go and reply later.

Dave
Reply
#4

(22-01-2021, 00:28)moolight0551 Wrote:  
(21-01-2021, 20:21)Werk_AG Wrote:  Hi,

When posting code, please use the code tags, otherwise its impossible to read the content.
Anyway I think you are compiling for a "Generic ESP8266 Module" instead of LOLIN(Wemos) D1 R2 & mini, thus the compiling error.

Rgs.

Thanks Caneira, yes the code errors are unreadable, I agree. Will give it a go and reply later.

Dave

Hi, that fixed the compile problems. Still having trouble getting readings from the TH sensor and nothing from the Dust sensor. Will keep at it, maybe ask more questions later. One thing, do I need to change any options in the the P2AT2560_RX_v8.3_b002 code to make it display dust sensor data? I can see the Dust sensor page but all zeros so far!

Tks Dave
Reply
#5

(25-01-2021, 05:03)moolight0551 Wrote:  
(22-01-2021, 00:28)moolight0551 Wrote:  
(21-01-2021, 20:21)Werk_AG Wrote:  Hi,

When posting code, please use the code tags, otherwise its impossible to read the content.
Anyway I think you are compiling for a "Generic ESP8266 Module" instead of LOLIN(Wemos) D1 R2 & mini, thus the compiling error.

Rgs.

Thanks Caneira, yes the code errors are unreadable, I agree. Will give it a go and reply later.

Dave

Hi, that fixed the compile problems. Still having trouble getting readings from the TH sensor and nothing from the Dust sensor. Will keep at it, maybe ask more questions later. One thing, do I need to change any options in the the P2AT2560_RX_v8.3_b002 code to make it display dust sensor data? I can see the Dust sensor page but all zeros so far!

Tks Dave

Hi Dave,

If you really are using P2AT2560_RX_v8.3_b002, then you need to upgrade to latest WeatherDuino Pro2 PLUS AT2560 RX v9.0_b003 .

If after upgrading, you still don't receive data from the AQMII, please post your Pro2 PLUS Config_Options.h file.

Rgs
Werk_AG
Reply
#6

(26-01-2021, 00:13)Werk_AG Wrote:  
(25-01-2021, 05:03)moolight0551 Wrote:  
(22-01-2021, 00:28)moolight0551 Wrote:  
(21-01-2021, 20:21)Werk_AG Wrote:  Hi,

When posting code, please use the code tags, otherwise its impossible to read the content.
Anyway I think you are compiling for a "Generic ESP8266 Module" instead of LOLIN(Wemos) D1 R2 & mini, thus the compiling error.

Rgs.

Thanks Caneira, yes the code errors are unreadable, I agree. Will give it a go and reply later.

Dave

Hi, that fixed the compile problems. Still having trouble getting readings from the TH sensor and nothing from the Dust sensor. Will keep at it, maybe ask more questions later. One thing, do I need to change any options in the the P2AT2560_RX_v8.3_b002 code to make it display dust sensor data? I can see the Dust sensor page but all zeros so far!

Tks Dave

Hi Dave,

If you really are using P2AT2560_RX_v8.3_b002, then you need to upgrade to latest WeatherDuino Pro2 PLUS AT2560 RX v9.0_b003 .

If after upgrading, you still don't receive data from the AQMII, please post your Pro2 PLUS Config_Options.h file.

Rgs
Werk_AG

OK. Here is my progress since the last post. I am using all the latest software Pro2 PLUS RX v9.0_b003 and ASK/WiFi Air Quality Monitor v3.2_b003. I am getting good data from the AQM on the Pro2 Plus except for the AQM Temperature and Humidity which is always 9945 and 9980 on the Web page and I suspect this messes up the Dust Density calculations. The reason I say this is that I notice in your code if you select #define TH_SENSOR    0 then the AQM sends 25 deg C and 50% RH and then I get some meaningful Dust Density figures on the Pro2 Plus display. I have tried 2 different HTU21D sensors and each one gives the same readings. I have tested both of these on an Arduino with a test sketch and they both report readings similar to the Pro2plus sensor so believe they are OK.

I am using a CO2 sensor labelled as MH-Z19B and a PMS7003 dust sensor. I can hear the fan start a couple of minutes after resetting the ESP8266 Pro Mini and then see the webpage data updated. I have some SHT21 sensors on order and will try them when they turn up, but in the meantime any suggestions to problem solve would be very welcome.

The other thing I did was to use a multimeter and check the continuity of the HTU21D sensor socket on the PCB to the ESP8266 and find the SCL connects to D1 and the SDA connects to D2 which looks OK to me from the ESP datasheet.

Here is the webpage data :
 {
"ID": "My-AQM",
"T": 9945,
"H": 9980,
"PM25": 0,
"PM100": 0,
"PM25AQI": 10,
"PM100AQI": 10,
"MAQI": 10,
"CO2": 408
}

Here is my Config Options file:


Code:
// --------------------------------------------------------------------------------------
//   WeatherDuino - ASK/WiFi Air Quality Monitor v3.2_b003
//                   User Configurable Options 
// --------------------------------------------------------------------------------------

// --------------------------------------------------------------------------------------
//   Define StationID of this device - Used when sending data by RF to a compatible WeatherDuino receiver
// --------------------------------------------------------------------------------------
const byte Station_ID = 0xA1;         // Must be equal to your RX Unit (Value from 0x00 to 0xFF)  


// --------------------------------------------------------------------------------------
//   Define a unique ID for each AQM unit (used to identify unit for OTA upload). No spaces or special chars.
// --------------------------------------------------------------------------------------
const char* DEVICE_ID = "My-AQM"; 


// --------------------------------------------------------------------------------------
//   Define rules for Auto Summer Time Display, and clock adjustment
// --------------------------------------------------------------------------------------
// Example for Australia Eastern Time Zone (Sydney, Melbourne) 
// TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660};    //UTC + 11 hours 
// TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600};    //UTC + 10 hours 
// Timezone myTZ(aEDT, aEST); 

TimeChangeRule aEDT = {"AEDT", First, Sun, Oct, 2, 660};    //UTC + 11 hours
TimeChangeRule aEST = {"AEST", First, Sun, Apr, 3, 600};    //UTC + 10 hours 
Timezone myTZ(aEDT, aEST); 

// --------------------------------------------------------------------------------------
//   Define type of PM sensor
// --------------------------------------------------------------------------------------
#define DUSTSENSOR_TYPE  0   // 0= PMS7003, 1= nova SDS011, 2 = Sensirion SPS30 (Connected to I2C Bus)


// --------------------------------------------------------------------------------------
//   For the PMS7003 define data set
// --------------------------------------------------------------------------------------
#define PMS7003_DATASET  1   // 0= CF1, 1= Ambiente (You should always use this data set)


// --------------------------------------------------------------------------------------
//   AQI Index calculation is based on the standard defined bellow
//   Define the one you prefer or what best apply to your Country / Region
// --------------------------------------------------------------------------------------
#define AQI_STANDARD   3   //  0= USA (AQI-EPA), 1= EUROPE (EAQI), 2= UK (DAQI), 3= AUSTRALIA (AQC - NSW)

#define AQ_AVGMODE     0   //  0= 24 Hours Average, 1= 1 Hour Average (AQM will report Air Quality values based on this setting)


// --------------------------------------------------------------------------------------
//   CO2 Sensor Settings
//   Note: Model B of the MH-Z19 gives better results than the older version (MH-Z19)
// --------------------------------------------------------------------------------------
#define CO2_INSTALLED  1    // 0= Not instaled, 1= Instaled
#define Z19_MODEL       2    // 1= Model A, 2= Model B  (ATTENTION: Make sure you select the correct model)                             

// Set measure range                              
#define Z19_RANGE       5    // Don't change (Keeps default factory range 0..5000 ppm)
                             // Valid values for Model A: 1= 1000ppm, 2= 2000ppm, 3= 3000ppm, 5=5000ppm
                             // Valid values for Model B: 2= 2000ppm, 5= 5000ppm

int16_t CO2_OffSet   = 0;    // Fine adjust to compensate sensor error (This value should be determined case by case. Values between -50 and 50)

// --------------------------------------------------------------------------------------
//   Define type of Temperature / Humidity sensor
// --------------------------------------------------------------------------------------
#define TH_SENSOR    1       // 1= HTU21D, 2= SHT3x   

// --- Fine adjust Temperature
float Temperature_Offset = -3.5;   // Temperature Fine Adjust in Degrees

// --------------------------------------------------------------------------------------
//   Define use of OLED Display
// --------------------------------------------------------------------------------------
#define USE_DISPLAY  0       // 0= No Display, 1= Use Display

// --------------------------------------------------------------------------------------
//   Enable / Disable WiFi connection
//   IMPORTANT: The WeatherDuino AQM was designed to work with WiFi connection,
//              if WiFi is disabled, many of its features like OTA software upgrade, will not work.
// --------------------------------------------------------------------------------------
#define ENABLE_WIFI         1                  // 1= Enable, 0= Disable
#define WEBSERVER_PORT     80                  // WebServer port (default 80) 

// --------------------------------------------------------------------------------------
//   NTP Servers - Enable only one
// --------------------------------------------------------------------------------------
#define timeServer "pool.ntp.org"
//#define timeServer "time.nist.gov"                 // ntp1.nl.net NTP server
//#define timeServer "80.96.196.58"                  // timp.mcsi.ro
//#define timeServer "193.79.237.14"


// --------------------------------------------------------------------------------------
//   Enable / Disable data transmission to ThingSpeak
// --------------------------------------------------------------------------------------
#define ENABLE_TS_UPLOAD   0                         // 1= Enable, 0= Disable


// --------------------------------------------------------------------------------------
// Air Quality Monitor - Upload and insert data in a SQL table at your own server ----
// Be sure you have already created the database and table. See AirQuality_LogToSQL.php script for info
// --------------------------------------------------------------------------------------
#define ENABLE_AQM_TO_MYSERVER    0                  // 1= Enable, 0= Disable


// --------------------------------------------------------------------------------------
//   Enable / Disable RF data transmission
// --------------------------------------------------------------------------------------
#define TX_DATA     1                // 0= No data will be transmitted via RF, 1= Transmit Data


// --------------------------------------------------------------------------------------
//   SHT31 I2C Address - Default address will work most of the times!
// --------------------------------------------------------------------------------------
#define SHT31_ADDRESS 0x44           // Default value is 0x44, but it can be changed to 0x45


// --------------------------------------------------------------------------------------
//   OLED I2C Address - Default address will work most of the times!
// --------------------------------------------------------------------------------------
#define OLED_ADDRESS 0x3C


// --------------------------------------------------------------------------------------
//   Debug helper - Uncomment for debug help
// --------------------------------------------------------------------------------------
//#define PRINT_DEBUG_WIFI
//#define PRINT_DEBUG_NTP
//#define PRINT_DEBUG_PM                 
//#define PRINT_DEBUG_CO2                
//#define PRINT_DEBUG_TS_UPLOAD
//#define PRINT_DEBUG_MYSERVER_UPLOAD
Reply
#7

(09-02-2021, 12:27)moolight0551 Wrote:  ...

I am getting good data from the AQM on the Pro2 Plus except for the AQM Temperature and Humidity which is always 9945 and 9980 on the Web page and I suspect this messes up the Dust Density calculations. The reason I say this is that I notice in your code if you select #define TH_SENSOR    0 then the AQM sends 25 deg C and 50% RH and then I get some meaningful Dust Density figures on the Pro2 Plus display.
...

Hi,

You are right about that. The data from the Temp / hum sensor are used on the calculations, so if data is wrong the results will be wrong too.

(09-02-2021, 12:27)moolight0551 Wrote:  ...
I have some SHT21 sensors on order and will try them when they turn up, but in the meantime any suggestions to problem solve would be very welcome.
...

Please not that the SHT21 isn't supported. The best choice for the AQM II is the SHT31, 3,3V version.


(09-02-2021, 12:27)moolight0551 Wrote:  ...
I have tried 2 different HTU21D sensors and each one gives the same readings. I have tested both of these on an Arduino with a test sketch and they both report readings similar to the Pro2plus sensor so believe they are OK.
...

Could it be that your HTU21D sensors are the 5V version and don't work reliably with 3.3V?
This ones are 5V version

[Image: s-l225.webp]

When you tested it on Arduino, you used the same library used by the AQM II? If yes, then they are on the expect I2C address, which is 0x40.

Another possibility... the pinout for the T/H sensor on the AQM II board is for the SHT31, most HTU21D modules, specially the 3.3V versions, have the SDA / SCL lines reversed, so they can't be fitted directly on the PCB. Check this too.

At moment I don't have any HTU21D to test. My best suggestion is to install an SHT31, they are far better than the HTU21D and more durable, specially under heavy moisture environments.

By the way, your Config_Options seems fine to me.

Hope I have helped.

Rgs.
Werk_AG



Reply
#8

(10-02-2021, 03:12)Werk_AG Wrote:  
(09-02-2021, 12:27)moolight0551 Wrote:  ...

I am getting good data from the AQM on the Pro2 Plus except for the AQM Temperature and Humidity which is always 9945 and 9980 on the Web page and I suspect this messes up the Dust Density calculations. The reason I say this is that I notice in your code if you select #define TH_SENSOR    0 then the AQM sends 25 deg C and 50% RH and then I get some meaningful Dust Density figures on the Pro2 Plus display.
...

Hi,

You are right about that. The data from the Temp / hum sensor are used on the calculations, so if data is wrong the results will be wrong too.
(09-02-2021, 12:27)moolight0551 Wrote:  ...
I have some SHT21 sensors on order and will try them when they turn up, but in the meantime any suggestions to problem solve would be very welcome.
...

Please not that the SHT21 isn't supported. The best choice for the AQM II is the SHT31, 3,3V version.

My bad typing, I have bought SHT31 sensors supposedly 3.3V types. Will wait for delivery and test.
 
(09-02-2021, 12:27)moolight0551 Wrote:  ...
I have tried 2 different HTU21D sensors and each one gives the same readings. I have tested both of these on an Arduino with a test sketch and they both report readings similar to the Pro2plus sensor so believe they are OK.
...

Could it be that your HTU21D sensors are the 5V version and don't work reliably with 3.3V?
This ones are 5V version

[Image: s-l225.webp]

When you tested it on Arduino, you used the same library used by the AQM II? If yes, then they are on the expect I2C address, which is 0x40.

No I did not, used an Adafruit library I think. Will try the same library as in the upload. Will also check the address. Thanks

Another possibility... the pinout for the T/H sensor on the AQM II board is for the SHT31, most HTU21D modules, specially the 3.3V versions, have the SDA / SCL lines reversed, so they can't be fitted directly on the PCB. Check this too.

I used the Arduinos 3.3V supply for my test and also checked the SDA/SCL reversal as I have one like that that I bought without looking at the pinout.

At moment I don't have any HTU21D to test. My best suggestion is to install an SHT31, they are far better than the HTU21D and more durable, specially under heavy moisture environments.

By the way, your Config_Options seems fine to me.

Good

Hope I have helped.

Rgs.
Werk_AG

Thanks for your suggestions, see my comments in italics above.

Regards Dave
Reply
#9

Hi, I finally received my SHT31 sensors and pleased to report they work very well. I would recommend that the SHT31 sensors  be used in the AQM as I have never been able to get the HTU21D sensors to work despite them testing OK in test sketches.

Thanks for all the suggestions. I have noticed another problem which I will raise in a new subject.

Cheers Dave
Reply




Users browsing this thread: 2 Guest(s)