Hi Renzo
Many thanks for the E220 library. She is fantastic.
I identified a possible memory leak caused by reading or changing the E220 settings when pins M0 and M1 are in GND.
Everything works fine (reading and changing the settings) if the M0 and M1 pienos are at HIGHT(3.3V) or connected to the GPIO of the MCU (In my case, I use NodeMCU ESP8266).
However, many strange behaviors occur when I try to read or modify the E220 settings when M0 and M1 are in GND.
Below is a log:
Ex1: When trying to change the frequency from 850 (default) to 920 (adding 70), the leak assigned the value ‘100’, and the final frequency is 950:
20:36:08.814 > No response from device! (Check wiring)
20:36:08.819 > 12
20:36:09.437 > Save mode returned not recognized!
20:36:09.440 > 11
20:36:09.811 > No response from device! (Check wiring)
20:36:09.815 > 12
20:36:09.816 > ----------------------------------------
20:36:09.819 > Chan : 100 -> 950MHz
20:36:09.821 > ----------------------------------------
Ex2: When performing several readings of the channel configuration and radio frequency, the value 950 (initial) is changed to 905:
Would it be possible to develop an approach to prevent the MCU from changing the E220 settings if M0 and M1 are in GND? I think this would prevent this memory leak.
Think of something like:
1) Check the status of pins M0 and M1 with digitalRead(). If the pins return HIGHT then make the configuration changes on the E220. Otherwise, print warning and do not make changes.
digitalRead() will not guarantee correct return as it will know the state of the MCU pin. But maybe this could help with the memory leak.
If the M0 and M1 pins are disconnected (floating), do they have an internal resistor (pullup or pulldown)?
2) Another issue would be to not allow messages to be sent when M0 and M1 pins are HIGHT. When M0 and M1 are in HIGHT, the E220 does not send messages, correct? If so, it would be interesting to issue a printout with a warning (“Cannot send messages. Pins M0 and M1 at HIGHT level”).
Hi George,
you probably received a memory leak because you do the wrong setting of M0 and M1, and the return of the device is wrong, and the repeating of that operation put MCU in an inconsistent state.
Try to do a full connection and retry.
Bye Renzo
Maintaining a repository (or site or forum) is a lot like tending to a garden - it requires constant care and attention to keep it thriving. If you're a skilled gardener (or coder!) and want to help keep our repository blooming, we'd love to have you on board! We're also looking for talented writers and forum moderators to help us grow our community. Interested in joining our team? Don't hesitate to reach out and let us know how you can contribute!
Are you a fan of electronics or programming? Share your knowledge with others, write a simple tutorial or how to make a great project Contact me: share_your_ideas@mischianti.org
The content displayed on this website is protected under a CC BY-NC-ND license. Visitors are prohibited from using, redistributing, or altering any content from this website for commercial purposes, including generating revenue through advertising. Any unauthorized use is a violation of the license terms and legal action may be taken against individuals or entities found to be in violation.
You must also provide the link to the source.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.
To provide the best experiences, we use technologies like cookies to store and/or access device information. Consenting to these technologies will allow us to process data such as browsing behavior or unique IDs on this site. Not consenting or withdrawing consent, may adversely affect certain features and functions.
Functional
Always active
The technical storage or access is strictly necessary for the legitimate purpose of enabling the use of a specific service explicitly requested by the subscriber or user, or for the sole purpose of carrying out the transmission of a communication over an electronic communications network.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
The technical storage or access that is used exclusively for statistical purposes.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
The technical storage or access is required to create user profiles to send advertising, or to track the user on a website or across several websites for similar marketing purposes.