Air Quality Egg - Failed to Publish Heartbeat


#1

I’ve got an egg that returns the error “failed to publish Heartbeat”

Similar posts make it look like the S/N was not registered?

Error log with S/N below:

Thanks!


#2

Hi @NT1 I don’t think that has anything to do with registration since it looks like it connected to the MQTT broker just fine based on your excerpt. If you let it keep running for a while, does it keep failing, or does it eventually start working?


#3

So I just allowed it to run, see excerpt below:

Info: Signature matches, skipping HEX download.
Info: Resolved “mqtt.opensensors.io” to IP address 52.209.152.90
Info: Connecting to MQTT Broker with Client ID “egg00802fbb78090122” using Authentication…OK.
csv: Timestamp,Temperature[degC],Humidity[percent],PM[ug/m^3],PM[V],Latitude[deg],Longitude[deg],Altitude[m]
csv: 01/01/1970 00:01:11,—,---,—,---,—,---,—
Info: Connecting to Access Point with SSID “SSID”…OK.
Info: MQTT publishing to topic /orgs/wd/aqe/heartbeat/egg00802fbb78090122…Failed.
Error: Failed to publish Heartbeat.
csv: 01/01/1970 00:02:11,—,---,—,---,—,---,—
Info: Connecting to Access Point with SSID “SSID”…OK.
Info: Connecting to MQTT Broker with Client ID “egg00802fbb78090122” using Authentication… ±-----------------------------------+
| Welcome to Air Quality Egg 2.0 |
| Particulate Sensor Suite |
| Firmware Version 2.1.9 |
±-----------------------------------+
Compiled on: Oct 13 2016 15:16:41
Egg Serial Number: egg00802fbb78090122

Info: Tiny Watchdog Initialization…OK.
Info: Slot Select Pins Initialization…OK.
Info: SPI Flash Initialization…OK.
Info: SD Card Initialization…Fail.
Info: Current firmware signature: 318054 56780
Info: SHT25 Initialization…OK.
Info: RTC Initialization…Fail.
Info: ESP8266 Initialization…OK.
Enter ‘aqe’ for CONFIG mode.
OPERATIONAL mode automatically begins after 12 secs of no input.
11…10…9…8…7…6…5…4…3…2…1…0…


#4

@NT1 That’s a new one for me… can you do me a favor and type:

aqe
restore defaults
ssid your-ssid
pwd your-network-password

Then reset your Egg and see if it behaves any differently? Is your network ssid or password really long? Does the Egg report an RSSI after network scan? Just trying to brainstorm for ideas on what might be different about your environment than our testing environment.


#5

Hmm… See below for latest error log, returns same result after resetting egg.

My network is a WiFi hotspot card, but I’ve got 3 other eggs all currently working fine and logging data using the same network, same SSID/pwd.

Info: Connecting to Access Point with SSID “SSID”…OK.
Info: Request DHCP…OK.
Info: IP Addr: 192.168.1.2
Info: Netmask: 255.255.255.0
Info: Gateway: 192.168.1.1
Info: Erasing mirrored config…OK.
Info: Writing mirrored config…OK.
Info: Resolved “update.wickeddevice.com” to IP address 45.55.159.249
Info: -------------------------------------
Info: Integrity Checks:
Info: File Size: 318054
Info: CRC16 Checksum: 56780

Info: Download Complete
Info: Total Bytes: 212
Info: File Size: 12
Info: Checksum: 45818
Info: Duration: 5570
Info: Signature matches, skipping HEX download.
Info: Resolved “mqtt.opensensors.io” to IP address 52.209.152.90
Info: Connecting to MQTT Broker with Client ID “egg00802fbb78090122” using Authentication…OK.
csv: Timestamp,Temperature[degC],Humidity[percent],PM[ug/m^3],PM[V],Latitude[deg],Longitude[deg],Altitude[m]
csv: 01/01/1970 00:01:30,—,---,—,---,—,---,—
Info: Connecting to Access Point with SSID “SSID”…OK.
Info: MQTT publishing to topic /orgs/wd/aqe/heartbeat/egg00802fbb78090122…Failed.
Error: Failed to publish Heartbeat.
csv: 01/01/1970 00:02:30,—,---,—,---,—,---,—
Info: Connecting to Access Point with SSID “SSID”…OK.
Info: Connecting to MQTT Broker with Client ID “egg00802fbb78090122” using Authentication… ±-----------------------------------+
| Welcome to Air Quality Egg 2.0 |
| Particulate Sensor Suite |
| Firmware Version 2.1.9 |
±-----------------------------------+
Compiled on: Oct 13 2016 15:16:41
Egg Serial Number: egg00802fbb78090122


#6

@NT1 could it possibly be some kind of limitation of your Hot Spot card? Does it do the same thing if it’s the only Egg connected to the Hot Spot?

The next thing I’m thinking of having you try is updating the software to the latest on GitHub.What’s your level of comfort using Arduino?


#7

I’ll see what I can dig up on the hotspot. I want to say that it’s not the hotspot because the other eggs work, and the problem egg doesn’t work when it’s the only egg on the hotspot. But I won’t rule it out completely.

Level of comfort is pretty low, but I can figure it out if you can send me the commands I’ll need, where the files are on GitHub, etc…

Just noticed RSSI reported at -46


#8

RSSI of -46 is really good (it’s in units of dBm, so closer to zero is better)… so it’s not that…

The instructions go something like this:

  1. Follow the instructions through step 8 here: http://shop.wickeddevice.com/2015/08/26/re-programming-an-air-quality-egg-v2/, except for the boards manager URL use http://update.wickeddevice.com/package_airqualityegg-2.1.8_index.json.

  2. Download this sketch from Git-Hub: https://github.com/WickedDevice/AQEV2FW_PM_ESP, and use it in place of step 9 to load the latest software onto the Egg.

I need to get around to promoting the latest software for an Over-The-Air update, but I need to do some more testing first, so I’m not exactly sure when that will happen. If you can manage the above yourself, that would be the shortest path to victory.


#9

I’m getting a long list of errors when compiling the sketch. Getting similar errors when compiling the other AQEV2FW sketches. Will keep working at it.

AQEV2FW_PM_ESP:3098: error: ‘tmElements_t’ was not declared in this scope

tmElements_t tm;

^

AQEV2FW_PM_ESP:3099: error: expected unqualified-id before ‘.’ token

tm.Year = src_array[0];

 ^

AQEV2FW_PM_ESP:3100: error: expected unqualified-id before ‘.’ token

tm.Month = src_array[1];

 ^

AQEV2FW_PM_ESP:3101: error: expected unqualified-id before ‘.’ token

tm.Day = src_array[2];

 ^

AQEV2FW_PM_ESP:3102: error: expected unqualified-id before ‘.’ token

tm.Wday = 0;

 ^

AQEV2FW_PM_ESP:3103: error: expected unqualified-id before ‘.’ token

tm.Hour = src_array[3];

 ^

AQEV2FW_PM_ESP:3104: error: expected unqualified-id before ‘.’ token

tm.Minute = 0;

 ^

AQEV2FW_PM_ESP:3105: error: expected unqualified-id before ‘.’ token

tm.Second = 0;

 ^

AQEV2FW_PM_ESP:3107: error: expected primary-expression before ‘)’ token

time_t seconds_since_epoch = makeTime™;

                                       ^

AQEV2FW_PM_ESP:3107: error: ‘makeTime’ was not declared in this scope

AQEV2FW_PM_ESP:3108: error: ‘SECS_PER_HOUR’ was not declared in this scope

seconds_since_epoch += SECS_PER_HOUR;

                      ^

AQEV2FW_PM_ESP:3109: error: expected primary-expression before ‘)’ token

breakTime(seconds_since_epoch, tm);

                                ^

AQEV2FW_PM_ESP:3109: error: ‘breakTime’ was not declared in this scope

AQEV2FW_PM_ESP:3111: error: expected primary-expression before ‘.’ token

src_array[0] = tm.Year;

                ^

AQEV2FW_PM_ESP:3112: error: expected primary-expression before ‘.’ token

src_array[1] = tm.Month;

                ^

AQEV2FW_PM_ESP:3113: error: expected primary-expression before ‘.’ token

src_array[2] = tm.Day;

                ^

AQEV2FW_PM_ESP:3114: error: expected primary-expression before ‘.’ token

src_array[3] = tm.Hour;

                ^

C:\Users\ntaylor\AppData\Local\Arduino15\packages\Air Quality Egg v2 - 2.1.8\hardware\avr\2.1.8\libraries\AQEV2FW_PM_ESP\examples\AQEV2FW_PM_ESP\AQEV2FW_PM_ESP.ino: In function ‘void currentTimestamp(char*, uint16_t)’:

AQEV2FW_PM_ESP:6048: error: ‘now’ was not declared in this scope

time_t n = now();

              ^

AQEV2FW_PM_ESP:6051: error: ‘month’ was not declared in this scope

 month(n),

        ^

AQEV2FW_PM_ESP:6052: error: ‘day’ was not declared in this scope

 day(n),

      ^

AQEV2FW_PM_ESP:6053: error: ‘year’ was not declared in this scope

 year(n),

       ^

AQEV2FW_PM_ESP:6054: error: ‘hour’ was not declared in this scope

 hour(n),

       ^

AQEV2FW_PM_ESP:6055: error: ‘minute’ was not declared in this scope

 minute(n),

         ^

AQEV2FW_PM_ESP:6056: error: ‘second’ was not declared in this scope

 second(n));

         ^

C:\Users\ntaylor\AppData\Local\Arduino15\packages\Air Quality Egg v2 - 2.1.8\hardware\avr\2.1.8\libraries\AQEV2FW_PM_ESP\examples\AQEV2FW_PM_ESP\AQEV2FW_PM_ESP.ino: In function ‘void getNowFilename(char*, uint16_t)’:

AQEV2FW_PM_ESP:6084: error: ‘now’ was not declared in this scope

time_t n = now();

              ^

AQEV2FW_PM_ESP:6086: error: ‘year’ was not declared in this scope

 year(n) % 100,

       ^

AQEV2FW_PM_ESP:6087: error: ‘month’ was not declared in this scope

 month(n),

        ^

AQEV2FW_PM_ESP:6088: error: ‘day’ was not declared in this scope

 day(n),

      ^

AQEV2FW_PM_ESP:6089: error: ‘hour’ was not declared in this scope

 hour(n));

       ^

C:\Users\ntaylor\AppData\Local\Arduino15\packages\Air Quality Egg v2 - 2.1.8\hardware\avr\2.1.8\libraries\AQEV2FW_PM_ESP\examples\AQEV2FW_PM_ESP\AQEV2FW_PM_ESP.ino: In function ‘void getNetworkTime()’:

AQEV2FW_PM_ESP:6188: error: ‘tmElements_t’ was not declared in this scope

 tmElements_t tm;

 ^

AQEV2FW_PM_ESP:6189: error: expected primary-expression before ‘)’ token

 breakTime(t, tm);

                ^

AQEV2FW_PM_ESP:6189: error: ‘breakTime’ was not declared in this scope

AQEV2FW_PM_ESP:6190: error: ‘setTime’ was not declared in this scope

 setTime(t);

          ^

AQEV2FW_PM_ESP:6201: error: expected primary-expression before ‘.’ token

   tm.Month,

     ^

AQEV2FW_PM_ESP:6202: error: expected primary-expression before ‘.’ token

   tm.Day,

     ^

AQEV2FW_PM_ESP:6203: error: expected primary-expression before ‘.’ token

   1970 + tm.Year);

            ^

AQEV2FW_PM_ESP:6213: error: expected primary-expression before ‘.’ token

   tm.Hour,

     ^

AQEV2FW_PM_ESP:6214: error: expected primary-expression before ‘.’ token

   tm.Minute,

     ^

AQEV2FW_PM_ESP:6215: error: expected primary-expression before ‘.’ token

   tm.Second);

     ^

‘setSyncProvider’ was not declared in this scope


#10

@NT1 Have you selected from the Tools => Boards menu “WildFirev3 [dual-optiboot].” and did you download Arduino from arduino.cc/software?


#11

Yes, downloaded/installed Arduino 1.6.12 from arduino.cc/software, selected WildFirev3 [dual-optiboot] in boards manager.


#12

Could a network security setting be affecting my PC’s ability to compile the AQE boards? I’m able to install the Air Quality Egg 2.1.8 boards, but when I go to compile I get a list of errors. Compiling other example sketches is no problem.


#13

@NT1 I just tried this from a clean slate Arduino environment and didn’t encounter a problem. Did you select Tools => Boards => WildFire v3 [dual-optiboot] in the IDE before trying to compile the sketch? That’s a critically important step.


#14

@NT1 I have a new theory about your PM Egg’s behavior, lets not worry about reloading software for the moment. Have you issued the command ‘restore defaults’ at some point? If not please do:

restore defaults
ssid your-network-ssid
pwd your-network-password
exit

After you do that, wait for it to connect to your network and get into operational mode. The first time it tries to publish heartbeat it will fail, don’t worry about that. Then please restart it, and confirm that your Sampling settings indicate a sampling interval of 5 seconds, an averaging interval of 60 seconds, and a reporting interval of 60 seconds?


#15

I performed the above, sampling intervals are per below:

Sensor Sampling Interval: 5 seconds
Sensor Averaging Interval: 60 seconds
Sensor Reporting Interval: 60 seconds

I tried compiling the sketch on a different PC with a clean install of Arduino 1.6.12, but ran into the same problems. I will try a different PC on a different network this evening, see if I can get it to compile there. What version of Arduino did you use to compile the sketch?


#16

@NT1 I wonder if it’s a new issue with Arduino 1.6.12, as I’m still using 1.6.9. At any rate can you let it run for like 30 minutes and send me the serial logs. The PM Egg has a different behavioral pattern than the other types of Eggs to keep it offline while it is sampling, then connecting and reporting, then disconnecting again.


#17

I sent the logs in a PM


#18

Thanks @NT1, unfortunately that didn’t shed any light on it for me :thumbsdown:. So I just build a special OTA update just for you, so we can try and reprogram your Egg over Wi-Fi. Just go into config mode and type the following:

restore defaults
ssid your-network-ssid
pwd your-network-password
updatefile aqev2_pm_esp-2.1.9-nt1
exit

Your Egg should download the new software and reset itself. Try that and let me know if its behavior changes accordingly. If that doesn’t work, I’m afraid the only card I have left to play is to have you send that Egg back to us for repair or replace.


#19

Hmm, no luck unfortunately. I was able to update using your instructions but the egg is still failing to publish heartbeat.


#20

OK @NT1, that’s unfortunate, and thanks for indulging me with the troubleshooting. Lets get the ball rolling on an RMA then. Please send an email to support at wicked device dot com referencing this forum thread and we’ll get you taken care of ASAP.