It will help a lot if M5STACK can publish more sample code in sms/mqtt communication.
Posts made by zw29
-
RE: New GSM module test
-
RE: New GSM module test
I modified the Button example and can get "OK" in the result. But I need to press the "A" button twice to get the result. Not sure if this is correct.
#include <M5Stack.h>
void setup() {
// init lcd, serial, but don't init sd card
M5.begin(true, false, true);
M5.Power.begin();M5.Lcd.clear(BLACK);
M5.Lcd.setTextColor(YELLOW);
M5.Lcd.setTextSize(2);
M5.Lcd.setCursor(65, 10);
M5.Lcd.println("GSM TEST");Serial2.begin(115200, SERIAL_8N1, 16, 17);
// to power on the gsm module
pinMode(2, OUTPUT);
digitalWrite(2, 0);
delay(3000);
digitalWrite(2, 1);
delay(1000*60);
M5.Lcd.println("Init done!");
}// Add the main program code into the continuous loop() function
void loop() {
if (M5.BtnA.wasReleased()) {
get_time();
} else if (M5.BtnB.wasReleased()) {
M5.Lcd.clear(BLACK);
M5.Lcd.setCursor(0, 0);
}
// update button state
M5.update();
}void IotWriteCommand(char cmd[],char date[])
{
char buf[256] = {0};
if(cmd == NULL)
sprintf(buf,"AT\r\n");
else if(date == NULL)
sprintf(buf,"AT+%s\r\n",cmd);
else
sprintf(buf,"AT+%s=%s\r\n",cmd,date);Serial2.write(buf);
}//AT+CSQ=?
void get_time(void){
IotWriteCommand("CSQ",NULL);
while(Serial2.available()){
uint8_t ch = Serial2.read();
M5.Lcd.write(ch);
}
} -
RE: New GSM module test
@lukasmaximus Thank you for your suggestion. And sorry for the very late reply. The above code does not work for me. it is a blank screen.
-
New GSM module test
I just got the new GSM module (M6315). I can burn the EasyLoader successfully. After reboot, it shows a BLANK screen. If I burnt the GSM sample code from Arduino IDE to the M5stack, it shows a BLANK screen also. Is there anything I can try or have I missed anything?