Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WeatherChimes MQTT+Max disconnect problem 4G #57

Closed
udellc opened this issue Oct 27, 2022 · 1 comment
Closed

WeatherChimes MQTT+Max disconnect problem 4G #57

udellc opened this issue Oct 27, 2022 · 1 comment

Comments

@udellc
Copy link
Member

udellc commented Oct 27, 2022

The WeatherChimes 4G build for Sitka workshop with Max and MQTT uploads, MQTT is successful the first couple of tries, but then hangs. @WL-Richards has the current code. This is the output I get:
After the first failure, Max transmissions will still be received, but MQTT never recovers.
The Blue LEDS on the 4G board are lit up when connections are going well, but go off during the first failure and never come back on.
First sign of trouble is packet 37.
This is not good for the workshop activities because the MQTT failure state takes a very long time to work through and time out - so the WeatherChime appears to hang for over a min at a time every min or so.

Suggest to either fix issue resulting in the hang, or possibly remove the MQTT upload and use only Max if issue is unsolvable by Friday.

[SD Manager] Initializing SD Card...
[SD Manager] Successfully initialized SD Card!
[SD Manager] Data will be logged to Chime17.csv
[Hypnos] DS3231 Real-Time Clock Initialized Successfully!
[Manager] Initializing Modules...
[SHT31] Successfully initialized SHT31!
[TSL2591] Successfully initialized TSL2591!
[MS5803_119] Successfully Initialized!
[MS5803_118] Successfully Initialized!
[LTE] Powering up GPRS Modem. This should take about 10 seconds...
[LTE] Powering up complete!
[LTE] Modem Information: Manufacturer: u-blox Model: SARA-R410M-02B Revision: L0.0.00.00.05.08 [Apr 17 2019 19:34:02] SVN: 03 IMEI: 355523760070757
[LTE] Waiting for network...
[LTE] Connected to network!
[LTE] Attempting to connect to LTE Network: hologram
[LTE] Successfully Connected!
[LTE] Connected!
[LTE] APN: hologram
[LTE] Signal State: 99
[LTE] IP Address: 100.71.133.128
[LTE] Attempting to verify internet connection...
HTTP/1.1 200 OK
Server: nginx/1.10.3 (Ubuntu)
Date: Thu, 27 Oct 2022 16:28:22 GMT
Content-Type: text/plain; charset=UTF-8
Content-Length: 121
Connection: close
X-Powered-By: Express
Access-Control-Allow-Origin: *
Access-Control-Allow-Headers: X-Requested-With
Cross-Origin-Resource-Policy: cross-origin
Accept-Ranges: bytes
Cache-Control: public, max-age=86400
Last-Modified: Wed, 27 Sep 2017 09:03:12 GMT
ETag: W/"79-15ec2936080"


|  | |\ | \_/ |  ___ |_____ |  |  |
|  | | \|  |  |_____| _____||  |  |

[LTE] Module successfully initialized!
[WiFi] Initializing WiFi module...
[WiFi] Starting access point on: Chime1
[WiFi] Waiting for a device to connect to the access point...
[WiFi] Device connected to AP!
[WiFi] Successfully Initalized Wifi!
[WiFi] Device IP Address: 192.168.1.1
[WiFi] Device Subnet Address: 255.255.255.0
[Max Pub/Sub] Initializing Max Communication....
[Max Pub/Sub] Listening for UDP Packets on 9001
[Max Pub/Sub] Connections Opened!
[Manager] ** Setup Complete **

[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Chime",
"instance": 1,
"ip": [
192,
168,
1,
1
]
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 1
}
},
{
"module": "Analog",
"data": {
"Vbat": 4.303857327,
"Vbat_MV": 4313.525391
}
},
{
"module": "SHT31",
"data": {
"Temperature": 23.97999954,
"Humidity": 44.56000137
}
},
{
"module": "TSL2591",
"data": {
"Visible": 1351,
"Infrared": 495,
"Full_Spectrum": 1845
}
},
{
"module": "MS5803_119",
"data": {
"Temperature": 24.03000069,
"Pressure": 1011.849976
}
},
{
"module": "MS5803_118",
"data": {
"Temperature": 25.76000023,
"Pressure": 1011.890015
}
},
{
"module": "LTE",
"data": {
"RSSI": 28
}
},
{
"module": "WiFi",
"data": {
"SSID": "Chime1",
"RSSI": -37
}
},
{
"module": "Teros10",
"data": {
"Millivolt_Reading": 2974.432129,
"Dielectric_Permittivity": 472.8257751,
"Volumetric_Water_Content": 1.98092258
}
},
{
"module": "Water",
"data": {
"Height_(m)": -0.000409058
}
}
],
"timestamp": {
"time_utc": "2022-10-27T16:28:42Z",
"time_local": "2022-10-27T9:28:42Z"
}
}

[SD Manager] Successfully logged data to Chime17.csv
[Max Pub/Sub] Sending packet to 192.168.1.255:8001
[Max Pub/Sub] Packet successfully sent!
[Max Pub/Sub] No message received!

. . . . . . . . . .

[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Chime",
"instance": 1,
"ip": [
192,
168,
1,
1
]
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 13
}
},
{
"module": "Analog",
"data": {
"Vbat": 4.308691502,
"Vbat_MV": 4313.525391
}
},
{
"module": "SHT31",
"data": {
"Temperature": 24.01000023,
"Humidity": 44.45999908
}
},
{
"module": "TSL2591",
"data": {
"Visible": 1388,
"Infrared": 494,
"Full_Spectrum": 1882
}
},
{
"module": "MS5803_119",
"data": {
"Temperature": 24.02000046,
"Pressure": 1011.77002
}
},
{
"module": "MS5803_118",
"data": {
"Temperature": 25.86000061,
"Pressure": 1011.880005
}
},
{
"module": "LTE",
"data": {
"RSSI": 27
}
},
{
"module": "WiFi",
"data": {
"SSID": "Chime1",
"RSSI": -42
}
},
{
"module": "Teros10",
"data": {
"Millivolt_Reading": 2973.626465,
"Dielectric_Permittivity": 471.7500916,
"Volumetric_Water_Content": 1.978385925
}
},
{
"module": "Water",
"data": {
"Height_(m)": -0.001123661
}
}
],
"timestamp": {
"time_utc": "2022-10-27T16:30:12Z",
"time_local": "2022-10-27T9:30:12Z"
}
}

[SD Manager] Successfully logged data to Chime17.csv
[MQTT] Creating new MQTT client!
[MQTT] Attempting to connect to broker: cas-mosquitto.biossys.oregonstate.edu:1883
[MQTT] Successfully connected to broker!
[MQTT] Attempting to send data...
[MQTT] Data has been successfully sent!
[Max Pub/Sub] Sending packet to 192.168.1.255:8001
[Max Pub/Sub] Packet successfully sent!
[Max Pub/Sub] No message received!

[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Chime",
"instance": 1,
"ip": [
192,
168,
1,
1
]
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 14
}
},
{
"module": "Analog",
"data": {
"Vbat": 4.302246094,
"Vbat_MV": 4308.691406
}
},
{
"module": "SHT31",
"data": {
"Temperature": 23.98999977,
"Humidity": 44.50999832
}
},
{
"module": "TSL2591",
"data": {
"Visible": 1390,
"Infrared": 494,
"Full_Spectrum": 1884
}
},
{
"module": "MS5803_119",
"data": {
"Temperature": 24.02000046,
"Pressure": 1011.859985
}
},
{
"module": "MS5803_118",
"data": {
"Temperature": 25.87000084,
"Pressure": 1011.849976
}
},
{
"module": "LTE",
"data": {
"RSSI": 26
}
},
{
"module": "WiFi",
"data": {
"SSID": "Chime1",
"RSSI": -43
}
},
{
"module": "Teros10",
"data": {
"Millivolt_Reading": 2972.820557,
"Dielectric_Permittivity": 470.6765137,
"Volumetric_Water_Content": 1.975851059
}
},
{
"module": "Water",
"data": {
"Height_(m)": 0.000102264
}
}
],
"timestamp": {
"time_utc": "2022-10-27T16:30:25Z",
"time_local": "2022-10-27T9:30:25Z"
}
}

[SD Manager] Successfully logged data to Chime17.csv
[Max Pub/Sub] Sending packet to 192.168.1.255:8001
[Max Pub/Sub] Packet successfully sent!
[Max Pub/Sub] No message received!

.........

[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Chime",
"instance": 1,
"ip": [
192,
168,
1,
1
]
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 25
}
},
{
"module": "Analog",
"data": {
"Vbat": 4.310302734,
"Vbat_MV": 4308.691406
}
},
{
"module": "SHT31",
"data": {
"Temperature": 24.02000046,
"Humidity": 44.63999939
}
},
{
"module": "TSL2591",
"data": {
"Visible": 1387,
"Infrared": 493,
"Full_Spectrum": 1881
}
},
{
"module": "MS5803_119",
"data": {
"Temperature": 24.01000023,
"Pressure": 1011.719971
}
},
{
"module": "MS5803_118",
"data": {
"Temperature": 25.95000076,
"Pressure": 1011.890015
}
},
{
"module": "LTE",
"data": {
"RSSI": 27
}
},
{
"module": "WiFi",
"data": {
"SSID": "Chime1",
"RSSI": -41
}
},
{
"module": "Teros10",
"data": {
"Millivolt_Reading": 2976.043945,
"Dielectric_Permittivity": 474.9851685,
"Volumetric_Water_Content": 1.986005545
}
},
{
"module": "Water",
"data": {
"Height_(m)": -0.001737248
}
}
],
"timestamp": {
"time_utc": "2022-10-27T16:31:49Z",
"time_local": "2022-10-27T9:31:49Z"
}
}

[SD Manager] Successfully logged data to Chime17.csv
[MQTT] Attempting to connect to broker: cas-mosquitto.biossys.oregonstate.edu:1883
[MQTT] Successfully connected to broker!
[MQTT] Attempting to send data...
[MQTT] Data has been successfully sent!
[Max Pub/Sub] Sending packet to 192.168.1.255:8001
[Max Pub/Sub] Packet successfully sent!
[Max Pub/Sub] No message received!

[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Chime",
"instance": 1,
"ip": [
192,
168,
1,
1
]
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 26
}
},
{
"module": "Analog",
"data": {
"Vbat": 4.308691502,
"Vbat_MV": 4307.080078
}
},
{
"module": "SHT31",
"data": {
"Temperature": 24.02000046,
"Humidity": 44.75
}
},
{
"module": "TSL2591",
"data": {
"Visible": 1252,
"Infrared": 461,
"Full_Spectrum": 1711
}
},
{
"module": "MS5803_119",
"data": {
"Temperature": 24.02000046,
"Pressure": 1011.72998
}
},
{
"module": "MS5803_118",
"data": {
"Temperature": 25.98999977,
"Pressure": 1011.919983
}
},
{
"module": "LTE",
"data": {
"RSSI": 26
}
},
{
"module": "WiFi",
"data": {
"SSID": "Chime1",
"RSSI": -43
}
},
{
"module": "Teros10",
"data": {
"Millivolt_Reading": 2976.043945,
"Dielectric_Permittivity": 474.9851685,
"Volumetric_Water_Content": 1.986005545
}
},
{
"module": "Water",
"data": {
"Height_(m)": -0.001941153
}
}
],
"timestamp": {
"time_utc": "2022-10-27T16:32:6Z",
"time_local": "2022-10-27T9:32:6Z"
}
}

[SD Manager] Successfully logged data to Chime17.csv
[Max Pub/Sub] Sending packet to 192.168.1.255:8001
[Max Pub/Sub] Packet successfully sent!
[Max Pub/Sub] No message received!

.......

[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Chime",
"instance": 1,
"ip": [
192,
168,
1,
1
]
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 37
}
},
{
"module": "Analog",
"data": {
"Vbat": 4.307080269,
"Vbat_MV": 4313.525391
}
},
{
"module": "SHT31",
"data": {
"Temperature": 24.04000092,
"Humidity": 44.61000061
}
},
{
"module": "TSL2591",
"data": {
"Visible": 1384,
"Infrared": 489,
"Full_Spectrum": 1872
}
},
{
"module": "MS5803_119",
"data": {
"Temperature": 24.01000023,
"Pressure": 1011.75
}
},
{
"module": "MS5803_118",
"data": {
"Temperature": 26.12000084,
"Pressure": 1011.840027
}
},
{
"module": "LTE",
"data": {
"RSSI": 28
}
},
{
"module": "WiFi",
"data": {
"SSID": "Chime1",
"RSSI": -42
}
},
{
"module": "Teros10",
"data": {
"Millivolt_Reading": 2972.820557,
"Dielectric_Permittivity": 470.6765137,
"Volumetric_Water_Content": 1.975851059
}
},
{
"module": "Water",
"data": {
"Height_(m)": -0.000919756
}
}
],
"timestamp": {
"time_utc": "2022-10-27T16:33:30Z",
"time_local": "2022-10-27T9:33:30Z"
}
}

[SD Manager] Successfully logged data to Chime17.csv
[MQTT] Successfully connected to broker!
[MQTT] Attempting to send data...
[MQTT] Failed to close message!
[Max Pub/Sub] Sending packet to 192.168.1.255:8001
[Max Pub/Sub] Packet successfully sent!
[Max Pub/Sub] No message received!

......

[Manager] Data Json:
{
"type": "data",
"id": {
"name": "Chime",
"instance": 1,
"ip": [
192,
168,
1,
1
]
},
"contents": [
{
"module": "Packet",
"data": {
"Number": 49
}
},
{
"module": "Analog",
"data": {
"Vbat": 4.303857327,
"Vbat_MV": 4310.302734
}
},
{
"module": "SHT31",
"data": {
"Temperature": 23.95999908,
"Humidity": 44.61999893
}
},
{
"module": "TSL2591",
"data": {
"Visible": 1382,
"Infrared": 487,
"Full_Spectrum": 1869
}
},
{
"module": "MS5803_119",
"data": {
"Temperature": 23.90999985,
"Pressure": 1011.679993
}
},
{
"module": "MS5803_118",
"data": {
"Temperature": 26.09000015,
"Pressure": 1011.76001
}
},
{
"module": "LTE",
"data": {
"RSSI": 99
}
},
{
"module": "WiFi",
"data": {
"SSID": "Chime1",
"RSSI": -41
}
},
{
"module": "Teros10",
"data": {
"Millivolt_Reading": 2972.820557,
"Dielectric_Permittivity": 470.6765137,
"Volumetric_Water_Content": 1.975851059
}
},
{
"module": "Water",
"data": {
"Height_(m)": -0.000817492
}
}
],
"timestamp": {
"time_utc": "2022-10-27T16:37:20Z",
"time_local": "2022-10-27T9:37:20Z"
}
}

[SD Manager] Successfully logged data to Chime17.csv
[MQTT] Attempting to connect to broker: cas-mosquitto.biossys.oregonstate.edu:1883
[MQTT] Failed to connect to broker: CONNECTION_REFUSED
[MQTT] Attempting to connect to broker: cas-mosquitto.biossys.oregonstate.edu:1883
[MQTT] Failed to connect to broker: CONNECTION_REFUSED
[MQTT] Attempting to connect to broker: cas-mosquitto.biossys.oregonstate.edu:1883
[MQTT] Failed to connect to broker: CONNECTION_REFUSED
[MQTT] Attempting to connect to broker: cas-mosquitto.biossys.oregonstate.edu:1883
[MQTT] Failed to connect to broker: CONNECTION_REFUSED
[MQTT] Attempting to connect to broker: cas-mosquitto.biossys.oregonstate.edu:1883
[MQTT] Failed to connect to broker: CONNECTION_REFUSED
[MQTT] Retry limit exceeded!
[Max Pub/Sub] Sending packet to 192.168.1.255:8001
[Max Pub/Sub] Packet successfully sent!
[Max Pub/Sub] No message received!

@WL-Richards
Copy link
Member

Before Version 4.5 if the Project parameter was not set explicitly to be a string of "" it would often cause "Failed to close message" errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants