GSM Modem - Neoway M590E - "Cannot init"

About me: I am a bit new to Blynk, but i already created one successful project using ethernet shield and my Arduino Mega.

What i have already done:

  • I have bought a Neoway M590E from ebay and soldered it my self.
  • I have got the blynk example from your site.

What i am trying to do: I am trying to connect to Blynk using my Neoway M590E

My problem: I am not 100% sure how to connect the wires, for the modem to work, but i have tested several ways without any success. I get the following output from the serial.

My troubleshooting:

  • I have tried to use the software serial with pin 2 and 3 as on the images below.
  • I have tried with hardware serial(#define SerialAT Serial1) and used pin TX0->1 & RX0->0, and TX1 18 & RX1 19, not sure who is correct when using a Arduino Mega.
  • I have tried with USB power for the GSM modem, and also external 5v 2A power supply (as in images below).
  • I have tried to put “ground” pin and “boot” pin’s on the modem card together to trigger a boot, but nothing seems to happen.
  • I also don’t seem to get any lights in the LED on the modem card.

Serial Output:

Initializing modem...
[13217] 
    ___  __          __
   / _ )/ /_ _____  / /__
  / _  / / // / _ \/  '_/
 /____/_/\_, /_//_/_/\_\
        /___/ v0.4.10 on Arduino Mega

[13307] Modem init...
[23537] Cannot init

And it continues to loop

Images:

My code(nearly the same as the blynk example):

 /*************************************************************
   Download latest Blynk library here:
     https://github.com/blynkkk/blynk-library/releases/latest
 
   Blynk is a platform with iOS and Android apps to control
   Arduino, Raspberry Pi and the likes over the Internet.
   You can easily build graphic interfaces for all your
   projects by simply dragging and dropping widgets.
 
     Downloads, docs, tutorials: http://www.blynk.cc
     Sketch generator:           http://examples.blynk.cc
     Blynk community:            http://community.blynk.cc
     Follow us:                  http://www.fb.com/blynkapp
                                 http://twitter.com/blynk_app
 
   Blynk library is licensed under MIT license
   This example code is in public domain.
 
  *************************************************************
   Attention! Please check out TinyGSM guide:
     http://tiny.cc/tiny-gsm-readme
 
   WARNING: GSM modem support is for BETA testing.
 
   You’ll need:
    - Blynk App (download from AppStore or Google Play)
    - Arduino Mega 2560 board
    - Decide how to connect to Blynk
      (USB, Ethernet, Wi-Fi, Bluetooth, ...)
 
   There is a bunch of great example sketches included to show you how to get
   started. Think of them as LEGO bricks  and combine them as you wish.
   For example, take the Ethernet Shield sketch and combine it with the
   Servo example, or choose a USB sketch and add a code from SendData
   example.
  *************************************************************/
 
 /* Comment this out to disable prints and save space */
 #define BLYNK_PRINT Serial
 
 #define TINY_GSM_MODEM_M590
 
 // Default heartbeat interval for GSM is 60
 // If you want override this value, uncomment and set this option:
 //#define BLYNK_HEARTBEAT 30
 
 #include <TinyGsmClient.h>
 #include <BlynkSimpleSIM800.h>
 
 // You should get Auth Token in the Blynk App.
 // Go to the Project Settings (nut icon).
 char auth[] = "****";
 
 // Your GPRS credentials
 // Leave empty, if missing user or pass
 char apn[]  = "internet.no";    //TDC Norway standard = "internet.no"
 char user[] = "";               //TDC Norway standard = ""
 char pass[] = "";               //TDC Norway standard = ""
 
 // Hardware Serial on Mega, Leonardo, Micro
 //#define SerialAT Serial1
 
 // or Software Serial on Uno, Nano
 #include <SoftwareSerial.h>
 SoftwareSerial SerialAT(2, 3); // RX, TX
 
 TinyGsm modem(SerialAT);
 
 void setup()
 {
   // Debug console
   Serial.begin(9600);
 
   delay(10);
 
   // Set GSM module baud rate
   SerialAT.begin(115200);
   delay(3000);
 
   // Restart takes quite some time
   // To skip it, call init() instead of restart()
   Serial.println("Initializing modem...");
   modem.restart();
 
   // Unlock your SIM card with a PIN
   // modem.simUnlock("1234");
 
   Blynk.begin(auth, modem, apn, user, pass);
 }
 
 void loop()
 {
   Blynk.run();
   // You can inject your own code or combine it with other sketches.
   // Check other examples on how to communicate with Blynk. Remember
   // to avoid delay() function!
 }

Thanks in advance.

I think I’d start with the GSM board connected via an FTDI interface straight to a PC and see what you get in a serial monitor when you power it up and when you issue a simple AT command.
Don’t forget to connect Tx to Rx and Rx to Tx.

Just did a quick google search and found this guy doing the same thing…

Pete.

@Patchie According to your pictures you are plugging into the incorrect pins on the MEGA… RX0 & RX1 are part of the USB connection.

What you want to connect the module with is Serial1 and pins 18 & 19

// Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial1

I know you stated you have done this… but then you also mention TX0->1 & RX0->0 at the same time… Not compatible!

1 Like

@Gunner: I didn’t connect to both pin 18/19 and the two other pins at the same time, but after each other since the first try didn’t work.

Anyway, i now re-soldered the modem-card, so now i can actually see the led on the modem-card flashing. But i still get the same error message in the serial monitor.

I have connected:
Arduino USB → My pc
Arduino pin 18(TX1) → Modem-card RXD
Arduino pin 19(RX1) → Modem-card TXD
Arduino ground → external powersupply ground
Modem-card BOOT → Modem-card GND pin1
Modem-card GND pin2 → Arduino ground
Modem-card 5v → external powersupply 5v

My code: (should be pretty much the same)

#define BLYNK_PRINT Serial
#define TINY_GSM_MODEM_M590

// Default heartbeat interval for GSM is 60
// If you want override this value, uncomment and set this option:
//#define BLYNK_HEARTBEAT 30

#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>

// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth = “*******”;

// Your GPRS credentials
// Leave empty, if missing user or pass
char apn = “internet.no”; //TDC Norway standard = “internet.no”
char user = “”; //TDC Norway standard = “”
char pass = “”; //TDC Norway standard = “”

// Hardware Serial on Mega, Leonardo, Micro
#define SerialAT Serial1

// or Software Serial on Uno, Nano
// #include <SoftwareSerial.h>
// SoftwareSerial SerialAT(2, 3); // RX, TX

TinyGsm modem(SerialAT);

void setup()
{
// Debug console
Serial.begin(9600);

delay(10);

// Set GSM module baud rate
SerialAT.begin(115200);
delay(3000);

// Restart takes quite some time
// To skip it, call init() instead of restart()
Serial.println(“Initializing modem…”);
modem.restart();

// Unlock your SIM card with a PIN
//modem.simUnlock(“”);

Blynk.begin(auth, modem, apn, user, pass);
}

void loop()
{
Blynk.run();
// You can inject your own code or combine it with other sketches.
// Check other examples on how to communicate with Blynk. Remember
// to avoid delay() function!
}

Except for this boot pin, which I don’t understand it’s purpose… the rest looks OK…

However, none of this is really Blynk specific, and while we do try to assist in various ways, this forum is predominantly about learning how Blynk works, not serial hookup 101.

So I recommend you test again without the added Blynk complexities first… and then add in the Blynk interface after confirming fully functional hardware hookup. I think you will find that easier. Check with the hardware supplier and good old Google for any further hardware eccentricities.

1 Like

The boot pin should be connected to ground for around 500ms to power on, and connected to ground for around 1 sec to power off.
I suspect that keeping it connected to ground isn’t producing the desired effect.

I suggested this earlier and @Patchie doesn’t seem to have taken the suggestion onboard. It’s the only real way to figure out what’s happening with the GSM board. As it’s a self assembly board, and re-soldering has created some changes to the operation, then there are far too many variables in the equation at the moment. It’s time to go back to basics in my opinion.

Pete.

2 Likes

@Gunner: I agree, but as i will tell below in this post, i am 1 step further. Not sure if the error message i am getting stated below is from the blynk library or the GSM library.

@PeteKnight: I did read your post, and am looking to buy a FTDI interface device to USB.

Since i didn’t have it already, i cannot do what you suggest.
But i found a similar way of testing this.

Code to determine connection speed:

#define BLYNK_PRINT Serial
#define TINY_GSM_MODEM_M590
#include <TinyGsmClient.h>
#include <BlynkSimpleSIM800.h>

char apn = “internet.no”; //TDC Norway standard = “internet.no”
char user = “”; //TDC Norway standard = “”
char pass = “”; //TDC Norway standard = “”

#define SerialAT Serial1
TinyGsm modem(SerialAT);

void setup() {
// initialize both serial ports:
Serial.begin(9600);
delay(10);
SerialAT.begin(9600);
delay(3000);

Serial.println(“Initializing modem…”);
modem.restart();
}

void loop() {
// read from port 1, send to port 0:
if (SerialAT.available()) {
int inByte = SerialAT.read();
Serial.write(inByte);
}

// read from port 0, send to port 1:
if (Serial.available()) {
int inByte = Serial.read();
SerialAT.write(inByte);
}
}

New error message when i run my blynk code: (with correct connection speed as SerialAT.begin(9600))

Initializing modem…
[63514]
___ __ __
/ _ )/ /_ _____ / /__
/ _ / / // / _ / '/
/
//_, /////_
/
__/ v0.4.10 on Arduino Mega

[63603] Modem init…
[63943] Connecting to network…
[124225] Register in network failed

Thanks in advance.

Okay, if you don’t have an FTDI adapter then I’d run a bit of code that allows you to type commands in the Arduino serial monitor and hit the Send button and have these commands sent to the GSM modem - and which also echos the responses from the modem back to the serial monitor.
No Blynk code involved at this stage!
You’ll need to make sure that you’re sending the correct terminators (Probably CR & LF) and have the baud rate set correctly.

There are lots of simple code examples out there for troubleshooting GSM modems, if you can find any for your modem the try searching for code snippets for the SIM900 - they should all work in the same way once you get the serial port parameters correct.

You’ll then be able to type “AT” and hopefully get an “OK” response back.
Commands like “AT+CREG?” and “AT+CSQ” should return info on the status and signal strength of the GSM shield.
You’ll need the full AT command set for your shield to understand the commands and their responses:
http://docs.mirifica.eu/Neoway.com/M590/Neoway%20M590%20AT%20Command%20Sets_V3.0.pdf

Pete.