#include "Waveshare_SIM7600.h"
// Pin definition
int POWERKEY = 2;
char phone_number[] = "+44[redacted]"; //********** change it to the phone number you want to call
char text_message[] = "www.waveshare.com"; //
void setup() {
Serial.begin(9600);
sim7600.PowerOn(POWERKEY);
printf("Sending Short Message Test:\n");
sim7600.SendingShortMessage(phone_number,text_message);
printf("Receiving Short Message Test:\n");
printf("Please send message to phone %s.\n", phone_number);
sim7600.ReceivingShortMessage();
}
On the SIM7600E Hat the power LED is on and Net LED is flashing fast. I have tried both Arduino Uno and Arduino Mega, I have tried changing the jumper settings. I have tried hardwiring the PWR on to 3V3 using the jumper, I have tried SoftwareSerial as well as the default serial ports. Using the provided SIM7600-AT-SSCOM-CN tool I can send text messages so the SIM and board definitely work. There are several people with a similar problem with a different board, I have tried what was suggested there but got nowhere. I am failing to get past the first hurdle, can anyone help?
when you tested using the mega did you connect to a hardware serial port?
can you show a schematic of the wiring
can you get a response to basic AT commands
it looks as though the SIM7600 may use 3.3V logic - if so you will require a level converter on the UNO/MEGA Tx signal to convert the 5V logic to 3.3V
did you try any of the Waveshare_SIM7600 library examples? see SIM7600E-H_4G_HAT
No basic AT commands do not work using ARduino but do using their tool connected over USB. It is only their samples I am trying out with their suggested wiring configuration. They don't work on Uno or Mega. It was hardware serial port on both Uno and Mega. I also tried software using different ports.
what have you set the PWR selection jumper and UART selection jumper too?
I assume when testing via USB you set the UART selector to control SIM7600 via USB to UART
I have tried PWR pinned to port 2 as indicated in the code. I have also tried putting a jumper between the 3V3 and PWR pins on SIM7600X.
When testing via USB the jumper pins were in position B as indicated in the diagram, they are still in position B when using Arduino, though I have tried positions A and C as well.
My target system is the uno. When I tried on the mega I used rx0 and tx0. Their code doesn't specify which hardware port to connect to so I assumed the first. I don't know how to change the code to specify another
I think the first thing is to attempt to get basic AT commands working then worry about using the Waveshare_SIM7600.h" library
I have used the following program to test basic AT commands with SIM800, SIM900, and other modems (I don't have a SIM7600E Hat)
// SIM800l AltSoftSerial test
#include <AltSoftSerial.h>
#include <SPI.h>
#include <Wire.h>
// Mega SIM800l test
//SIM800L 5V POWER to Mega 5V
//SIM800L GND POWER to Mega GND
//SIM800L TXD to Mega RX pin 48
//SIM800L RXD to Mega TX pin 46
//SIM800L VDD to Mega 5V
//SIM800L UART TTL GND and RST not connected
//SIM800L TXD to UNO RX pin 8
//SIM800L RXD to UNO TX pin 9
AltSoftSerial simSerial;
void setup() {
Serial.begin(115200);
Serial.println("AltSoftSerial test");
//Begin serial communication with Arduino and SIM800L
simSerial.begin(9600);
Serial.println("SIM module intialized");
}
void loop() {
if (Serial.available()) {
char command = Serial.read();
//Serial.println(command);
simSerial.print(command);
}
while (simSerial.available()) {
char reponse = simSerial.read();
Serial.print(reponse);
}
}
connect so
SIM7600E TXD to UNO RX pin 8
SIM7600E RXD to UNO TX pin 9
check the modem baudrate is correct
simSerial.begin(9600);
when run AT commands entered on the serial monitor input are transmitted to the modem and any response displayed
before connecting the modem you can do a quick loopback test by connecting UNO pin 8 to pin 9 - characters entered on the serial monitor are echoed back
Thanks. I tried the code, the loopback test worked. However, any AT commands sent did not get a response. On the SIM7600E I hardwired the 3V3 and PWR pins together (forced mode on) and tried the different jumper settings A, B and C. Still nothing. Also I noted a problem in my original wiring diagram above where I had RX set to RX. I have now corrected this.
can you check the voltage on the TX and RX pins when connected - should be 5volts when signal is idle
may be worth exchanging the RX and TX pins just in case they are the wrong way around
I received this back from Waveshare support. Yet to try it:
The default baud rate of the SIM7600 is 115200, and the default baud rate of the program is 9600. You need to change the baud rate of the program
The default level of SIM7600 is 3.3V. Please change the baud rate of Arduino to 3.3V
If it is connected to the side yellow pin, remove the jumper cap in the middle so that the pin will not be interfered.
If it still fails, please use the attached procedure to test
(attachment)
doubtful if AltSoftSerial will work on a UNO at 115200baud - you may have to move to a microcontroller with hardware serial ports
the UNO logic level is 5volts therefore you will require a level converter on the UNO Tx output to the SIM7600 Rx input (I did mention this could be a problem back in post #2)
the SIM7600 Tx output of 3.3V to the UNO Rx input should be no problem
consider moving to an ESP32 which has multiple hardware ports and works at 3.3V logic level
I have switched to using an Arduino Mega 2560 with a voltage divider to reduce the TX voltage using pins 18 and 19: 5V signal in is from Pin 18, 3.3V signal out goes to RXD on the SIM7600E
I have tried the sample program Waveshare provided and it gave the following output:
I have tried your sample program and I get the following output:
at least you appear to getting a response from the SIM7600
try basic AT commands, e.g. I use this for SIM800, SIM900, etc using Mega Serial1 port
// SIM900 GSM modem test for Arduino Mega - working 15 May 2022
// serial monitor line ending should be Carriage Return
// remember to press the power button
// UART connections
// j17/j18 set D7/D8
// connect SIM900 TXD (pin D8) to Mega pin 19 RXD (pin D7) to pin 18
// j17/j18 set D1/D0
// connect SIM900 TX (pin D0) to Mega RX1 (pin 19) SIM900 RX (pin D1) toMega TX1 (pin 18)
// see https://create.arduino.cc/projecthub/mitov/send-and-receive-text-messages-sms-with-gsm-sim900-shield-6d53c6
// AT+CGMI returns the manufacturer's name
// AT+CGMM returns the MODEM model number
// AT+CGMR returns details of the software and model revision level
// AT+CGSN returns the MODEM's serial number
#define mySerial Serial1
void setup() {
// Open serial communications and wait for port to open:
Serial.begin(115200);
while (!Serial) { }
Serial.println("Mega SIM800 test!");
// set the data rate for the Serial port
mySerial.begin(115200);
}
void loop() { // run over and over
if (mySerial.available()) {
Serial.write(mySerial.read());
}
while (Serial.available()) {
char ch;
mySerial.write(ch=toupper(Serial.read()));
Serial.write(ch);
}
}
AT commands typed on serial monitor are transmitted to modem and response displayed
However I was unable to get any response from the device even after dropping the voltage to 3V so I returned the device as defective and ordered a SIM800L instead.
I don't use a library I write code to use the AT command set of the modem I am using at the time, e.g. send of a sequence of AT commands, checking the response, etc. This may be as simple as sending a SMS text or connecting using SSL MQTT to AWS cloud computing.
If you are looking for a library try github, e..g. Sim800L Arduino Library