"call ready" response to AT COMMANDS and nothing written to the sim808 - arduino

I'm using "mega 2650 pro" 5 volt voltage pin output as a power to "sim808 bk-808-v3.1" vcc.
When I tried commands, "call ready" response appear and AT+CSCS="GSM" not written as you can see in the following picture
the following is the code I uploaded to arduino
#include <SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(9600);
mySerial.begin(9600);
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
{
while(Serial.available())
{
mySerial.write(Serial.read());
}
mySerial.println();
}
}
so what is the problem and how can I solve it?

Related

Serial software is not able to write and read the data

I am trying to write a data to the software serial port. But I am not able to read the data.
I have used the following code:
#include<SoftwareSerial.h>
SoftwareSerial mySerial(10, 11); // RX, TX
void setup()
{
// Open serial communications and wait for port to open:
Serial.begin(57600);
while (!Serial) {
; // wait for serial port to connect. Needed for Leonardo only
}
Serial.println("Goodnight moon!");
// set the data rate for the SoftwareSerial port
mySerial.begin(57600);
mySerial.println("Hello, world!");
}
void loop() // run over and over
{
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read());
}
Please can anyone of you help me. Thanks in advance

Error connecting an arduino and esp 32 via i2c

I'm having trouble connecting a esp32 with arduino pro mini 3v3. my code is the same arduino tutorial example. I use atom to code and when I open terminal serial write null message
Master code(Run ESP32)
#include <Wire.h>
int i=0;
char c[20
];
#include <Wire.h>
#define I2C_SDA_PIN 21
#define I2C_SCL_PIN 22
void setup() {
Wire.begin(); // join i2c bus (address optional for master)
Serial.begin(9600); // start serial for output
}
void loop() {
Wire.requestFrom(8, 1); // request 6 bytes from slave device #8
while (Wire.available()>0) { // slave may send less than requested
c[i]=Wire.read(); // receive a byte as character
i++;
Serial.print(c); // print the character
}
}
Run Arduino pro mini
#include <Wire.h>
void setup() {
Wire.begin(8); // join i2c bus with address #8
Wire.onRequest(requestEvent); // register event
}
void loop() {
delay(100);
}
// function that executes whenever data is requested by master
// this function is registered as an event, see setup()
void requestEvent() {
Wire.write('h'); // respond with message of 6 bytes
// as expected by master
}
I did an i2c bus address test and recognized the arduino:screenshot
I do not find anything about it, if anyone can help
p.s sorry for my poor english.

GSM SIM 900A Wont send a Message Using Arduino UNO

My Connections are
5VT to D9
5VR to D10
And external adaptor for power.. (5v 2A)
The blinks are good because it blinks every 3seconds,
The sim card is loaded.
But when I run the serial monitor, It only shows AT AT AT sometimes AT with reverse question marks..
Here is the Code I am using..
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10);
void setup()
{
mySerial.begin(9600); // Setting the baud rate of GSM Module
Serial.begin(9600); // Setting the baud rate of Serial Monitor (Arduino)
delay(100);
}
void loop()
{
if (Serial.available()>0)
switch(Serial.read())
{
case 's':
SendMessage();
break;
case 'r':
RecieveMessage();
break;
}
if (mySerial.available()>0)
Serial.write(mySerial.read());
}
void SendMessage()
{
mySerial.println("AT+CMGF=1"); //Sets the GSM Module in Text Mode
delay(1000); // Delay of 1000 milli seconds or 1 second
mySerial.println("AT+CMGS=\"+639176344625\"\r"); // Replace x with mobile number
delay(1000);
mySerial.println("I am SMS from GSM Module");// The SMS text you want to send
delay(100);
mySerial.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}
void RecieveMessage()
{
mySerial.println("AT+CNMI=2,2,0,0,0"); // AT Command to receive a live SMS
delay(1000);
}
This is the Sim900A I am using together with Arduino Uno..
Check out this code for simple data sending using GSM.
#include <SoftwareSerial.h>
SoftwareSerial ph(9,10); // RX, TX of gsm
void setup() {
Serial.begin(9600);
ph.begin(9600);
sms(600);
}
void loop() {
// put your main code here, to run repeatedly:
}
void sms(float amount) {
ph.println("AT+CMGF=1");
delay(1000);
ph.println("AT+CMGS=\"123456789\"\r"); //Enter your number in place of 123456789
delay(1000);
ph.print("Amount: ");
ph.println(amount);
delay(100);
ph.println((char)26);// ASCII code of CTRL+Z
delay(1000);
}

ESP8266 not detectable

It's my first time trying out the esp8266 on the arduino uno, using the ITEADLIB_Arduino_WeeESP8266 library. However I am not able to get anything done, not even wifi.getversion().
Here's the Serial Monitor output
setup begin
FW Version:
to station err
Join AP failure
setup end
(forever loop)
And here's the code
#include "ESP8266.h"
#include <SoftwareSerial.h>
SoftwareSerial mySerial(3, 2); /* RX:D3, TX:D2 */
ESP8266 wifi(mySerial);
#define SSID "AndroidAP"
#define PASSWORD "12345678"
void setup(void)
{
}
void loop(void)
{
Serial.begin(9600);
Serial.print("setup begin\r\n");
Serial.print("FW Version: ");
Serial.println(wifi.getVersion().c_str());
if (wifi.setOprToStation()) {
Serial.print("to station ok\r\n");
} else {
Serial.print("to station err\r\n");
}
if (wifi.joinAP(SSID, PASSWORD)) {
Serial.print("Join AP success\r\n");
Serial.print("IP: ");
Serial.println(wifi.getLocalIP().c_str());
} else {
Serial.print("Join AP failure\r\n");
}
Serial.print("setup end\r\n");
Serial.println("");
delay(10000);
}
I followed the instruction on the github readme, and the led on the esp8266 is on the whole time, so I guess it is not a wiring issue. Is it possible that the 8266 is dead?
You may try this Serial.begin(115200);

simple communication between AtTiny85 and Arduino (I2C)

Hi I want to connect the arduino pro mini to my AtTiny85 over I2C.
The arduino should tell the attiny to switch a LED on or off.
The arduino manages to switch the led on my attiny on but it never goes off.
I don't have any clue why?
Here is my Code for master and slave:
MASTER:
#include <Wire.h>
#define device (1)
void setup() {
// put your setup code here, to run once:
Wire.begin();
}
void loop() {
// put your main code here, to run repeatedly:
Wire.beginTransmission(device);
Wire.write(1);
Wire.endTransmission();
delay(2000);
Wire.write(0);
Wire.endTransmission();
delay(2000);
}
SLAVE:
#include <TinyWireS.h>
#include <usiTwiSlave.h>
#define output (4)
#define I2C_SLAVE_ADDR (1)
void setup() {
// put your setup code here, to run once:
TinyWireS.begin(I2C_SLAVE_ADDR);
pinMode(output, OUTPUT);
}
volatile byte msg = 0;
void loop() {
if(TinyWireS.available())
msg = TinyWireS.receive();
if(msg == 1)
digitalWrite(output, HIGH);
else if(msg == 0)
digitalWrite(output, LOW);
else
msg = 0;
}
I finally found my mistake:
when I do: Wire.write(0); I forgot to start the transmission with: Wire.beginTransmission(device);

Resources