Hi guys,
I bought A6 mini GSM module on aliexpress. https://www.aliexpress.com/i/32710017861.html
I’m using NodeMCU board. After few resets I managed to get “connected” from A6 mini couple of times, and managed to receive SMS, and show it in MQTT.
I can’t connect it every time. I don’t know what is the problem. I’ve been trying to repeat it, but i can’t get successful connection.
Serial monitor hangs waiting for connection.
23:13:50.187 -> Connecting to MQTT by IP adress
23:13:50.187 -> 192.168.0.50
23:13:51.687 -> _2G_TX_PIN
23:13:51.687 -> 12
23:13:51.687 -> _2G_RX_PIN
23:13:51.687 -> 13
23:13:51.687 -> Init 2G module:
23:13:51.687 -> 14
23:14:18.653 -> waiting for network connection
When I try to call the SIM in the module it rings, so I guess module is booted, however the serial communication seems to be failing.
Anyone can point me in the right direction?
Thanks
Hi,
I’m happy to see that users are using SMS gateway (I didn’t add any feedback until now)
Are you sure you are using the module with the included library with OMG folder/lib ?
Hi Florian,
Yes. I used the A6 lib. It seems my problem yesterday was due to late hours and lack of focus. I somehow managed to mix up RX and TX and that’s why I couldn’t communicate with the module. Once I realized it and connected it properly, it started working, sort of…
Now, I did some google search on the module and seems that A6 mini, the specific one I have is notorious for connection problems. Specifically in my case, when I connect the Nodemcu to USB, and power A6 with a 2A phone charger, it connects normally. When I disconnect serial, and power Nodemcu from the same power source as A6, over VIN pin, A6 keeps resetting and is unable to connect. It baffles me as when I measure with amp meter, A6 draws only 0.2 A, so it should be enough to power both.
So right now I do all the testing with serial connected.
And finally to contribute a bit, I found during my testing that simpleReceiving MQTTto2G doesn’t work as defined. Namely, when the topic is constructed as in manual BaseTopic/GWName/commands/PHO_1234567, it doesn’t match the definition of subjectMQTTto2G in Config_2g.h
#define subjectMQTTto2G Base_Topic Gateway_Name “/commands/MQTTto2G”.
First IF statement of the MQTTto2G function compares the subjectMQTTto2G to topicOri and it always fails and exits without executing.
#ifdef simpleReceiving
void MQTTto2G(char * topicOri, char * datacallback) {
String data = datacallback;
String topic = topicOri;
if (topic == subjectMQTTto2G) {
trc(F("MQTTto2G data analysis"));
// 2G DATA ANALYSIS
I ended up changing
if (topic == subjectMQTTto2G)
to:
if (topic.startsWith(subjectMQTTto2G))
so now it works.
Json receiving works normally.
1 Like
Glad to hear that it worked, i will check the code and see what has to be modified.
Thanks for the feedback !