Comments (11)
Large amount of Heap memory is consumed by library. Can you please help me into this?
I'm using IR library to receive IR data. Due to low memory it's restarting ESP.
from aws-mqtt-websockets.
You can decrease the maxMQTTpackageSize and decrease the size of the circular buffer that is used between the MQTT client and the Websocket Tunnel.
In the example I think it is using 10000 bytes. You can decrease to a number that can handle at least more than one mqtt message (to handle the scenario that two or more mqtt messages arrived in the websocket tunnel but was not processed by the mqtt client yet)
In a production project I am using this (circular buffer in 5000 bytes):
const int maxMQTTpackageSize = 256;
const int maxMQTTMessageHandlers = 1;
//websocket transport layer
AWSWebSocketClient awsWSclient(256,5000);
from aws-mqtt-websockets.
Thanks for the reply.
//websocket transport layer AWSWebSocketClient awsWSclient(256,5000);
Not able to pass two parameters. Constructor has only one parameter to pass.
//bufferSize defines the size of the circular byte buffer that provides the interface between messages arrived in websocket layer and byte reads from mqtt layer AWSWebSocketClient (unsigned int bufferSize = 1000);
I have upto 1500 characters to send to the AWS IoT.
from aws-mqtt-websockets.
My apologies. Just checked the updated version of file.
Let me check it and get back to you.
from aws-mqtt-websockets.
Sorry, the 5000 is a timeout in seconds. the first parameter is the circular buffer size. I am using 256 bytes. and decreased the maxMQTTpackageSize.
Update the library. I move almost everything to static memory because I was having problems with memory fragmentation.
from aws-mqtt-websockets.
Getting error:
`In file included from F:\Working Folder\Saleh\Arduino\Arduino_updated\Controllex_Updated\Controllex_Updated.ino:37:0:
C:\Users\kapil\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\aws-mqtt-websockets-master/AWSWebSocketClient.h:12:18: error: redefinition of 'const int HASH_HEX_LEN2'
static const int HASH_HEX_LEN2 = 64;
^
In file included from F:\Working Folder\Saleh\Arduino\Arduino_updated\Controllex_Updated\Controllex_Updated.ino:23:0:
C:\Users\kapil\Documents\Arduino\libraries\AWS-SDK-ESP8266\src/AWSClient2.h:21:18: error: 'const int HASH_HEX_LEN2' previously defined here
static const int HASH_HEX_LEN2 = 64;
^
Multiple libraries were found for "sha256.h"
Used: C:\Users\kapil\Documents\Arduino\libraries\AWS-SDK-ESP8266
Not used: C:\Users\kapil\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\AWSArduinoSDK
Not used: C:\Users\kapil\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\AWSArduinoSDK
Not used: C:\Users\kapil\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\AWSArduinoSDK
Not used: C:\Users\kapil\AppData\Local\Arduino15\packages\esp8266\hardware\esp8266\2.3.0\libraries\AWSArduinoSDK
exit status 1
Error compiling for board Generic ESP8266 Module.`
from aws-mqtt-websockets.
remove this include AWSClient2.h from your .ino
from aws-mqtt-websockets.
Thanks.
Now, I'm not getting any error. It is processing with 1k characters string. But Why I'm not getting it published?
Publish function is not working now.
from aws-mqtt-websockets.
If the message you are sending is up to 1500 character, you need to have a bigger circular buffer and maxMQTTpackageSize, something bigger than 3000.
try sending smaller messages to see if it is working. I am using this library version without problems
from aws-mqtt-websockets.
Thanks-a-lot :)
You saved me and my job too. I really appreciate your help. I was trying to solve this issue since last 3 weeks.
I published "Welcome!"message and it's working. So, I think I have to play with maxMQTTpackageSize only. Correct?
My IR rawData size is around 1000+ characters for AC remotes. I want to send them to server and for execution same want to receive from server through MQTT.
I want to receive the same large size string (1k+ characters in MQTT subscribe topics).
Will getback to you, if I need anything else.
My best wishes for you.
Thanks! again
from aws-mqtt-websockets.
This is still not working for me: I have
AWSWebSocketClient awsWSclient(3000);
const int maxMQTTpackageSize = 1000;
const int maxMQTTMessageHandlers = 1;
When I send a message containing 149 chars (for the whole JSON string), I don't receive anything in AWS. When I send a message containing 120 chars, it just works.
What am I doing wrong?
EDIT: maxMQTTpackageSize doesn't overwrite the packet size defined in the PubSubClient library, so you have to edit that value manually. Now it works.
from aws-mqtt-websockets.
Related Issues (20)
- undefined reference to 'gmtime_r' in Stream.h and AWSWebSocketClient.h HOT 1
- Not seeing aws subscribed messages
- Fatal exception 3(LoadStoreErrorCause) with NodeMCU
- How can I publish a command to esp8266 from AWS? HOT 1
- pubsubclient sample cannot compile cannot declare variable 'awsWSclient' to be of abstract type 'AWSWebSocketClient' HOT 11
- Incompatibility with TimeLib 1.5
- While Using PubSub Example reconnections are still Happening every 5 secs
- Putting a private key on the device represents a HUGE security flaw HOT 4
- Eratic connection HOT 1
- Callback function doesn't execute while sub on get/accepted shadow HOT 1
- Using SessionToken to connect to AWS IoT Core
- ESP8266 AWS web socket connection fails because of BearSSL HOT 3
- Connection failed because of inproper initialization HOT 4
- How to connect by certificates instead of aws_key and aws_secret HOT 5
- Exception 3: LoadStoreError: Processor internal physical address or data error during load or store HOT 2
- 403 forbidden response from aws while handshake
- Exception 28 error HOT 2
- Unable to compile HOT 2
- Max payload size is 100 char
- Compiling error: no match for 'operator+=' (operand types are 'String' and 'char [(<anonymous> + 1)]') HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-mqtt-websockets.