LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-31-2014, 02:11 AM   #1
amitbpl5
LQ Newbie
 
Registered: Jul 2014
Posts: 7

Rep: Reputation: Disabled
Question problem with Connect SIM300 v7.03 modem in linux serial port using mincom


Hello

i have problem with minicom i have typed 'at' in echo mode but there is no response of modem or serial port
 
Old 07-31-2014, 11:33 AM   #2
eSelix
Senior Member
 
Registered: Oct 2009
Location: Wroclaw, Poland
Distribution: Arch, Kubuntu
Posts: 1,254

Rep: Reputation: 315Reputation: 315Reputation: 315Reputation: 315
Was it works ealier? Which port you use in minicom and are you sure it is is the same as connected hardware? Check connection speed if it is proper.
 
Old 08-04-2014, 05:28 AM   #3
amitbpl5
LQ Newbie
 
Registered: Jul 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Question

Thank you sir,

actually i was open first time minicom,
actually my problem is that i am sending at cmd to modem sim300 by c program..
but modem is not responding?
 
Old 08-04-2014, 08:07 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,426

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
As stated make sure that minicom is configured for the correct serial port and settings i.e. baud rate, bits, parity etc. Same goes for your c program.

Without knowing that minicom works nor being able to see your code it is a bit difficult to provide any sort of help.
 
Old 08-04-2014, 08:34 AM   #5
amitbpl5
LQ Newbie
 
Registered: Jul 2014
Posts: 7

Original Poster
Rep: Reputation: Disabled
Sorry

i hv attached minicom screen shot and here is my c++ code
#include <iostream>
#include <fstream>
#include <fcntl.h>

using namespace std;

int main()
{
cout<<endl;
int fd1;
int fd2;
char * buff = new char[10];
int wr,rd,nbytes,tries;
fcntl(fd1, F_SETFL, O_NONBLOCK);
fd1=open("/dev/ttyS0", O_RDWR | O_NONBLOCK);
if (fd1 == -1 )
{
cout<<"Error connnecting";
}
else
{
fcntl(fd1, F_SETFL,0);
wr=write(fd1,"\r\nAT\r\n",12);
wr=write(fd1,"\r\nATD 08602702608; \r\n",20);
//wr=write(fd1,"\r\nAT&W\r\n",12);
//read a bunch of lines
for(int i=0;i<20;i++)
{
//read a single line:
string data="";
rd=0;
int bytes=0;
do
{
bytes= read(fd1,buff,1);
if(buff[0]=='\r')
{
read(fd1,buff,1);//read the following char which should be \n
break;
}
else
{
data.append(1,buff[0]);
}
}while(bytes>0);
cout<<endl<<"MODEM RESPONSE: "<<data<<endl;
}
}
close(fd1);
cout<<endl;
return 0;
}
Attached Thumbnails
Click image for larger version

Name:	Screenshot from 2014-08-04 17:58:39.png
Views:	13
Size:	135.2 KB
ID:	16034  
 
Old 08-04-2014, 09:40 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 16,426

Rep: Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938Reputation: 1938
Still looking for documentation but after a bit of searching I found a few threads that indicated the settings were 9600,8,N,1. I would add some code to set the serial port settings.

Once we confirm that we can communicate with the device will start to debug the program.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
serial port access to a linux box (running fedora 12) via a dial up modem vsandilya Linux - Newbie 5 08-03-2012 02:48 PM
how to connect modem in ttyS serial port amitk_m Slackware 3 06-30-2009 10:14 AM
Connect to a serial port??? clausa Linux - Hardware 2 08-30-2005 08:11 AM
Internal modem / serial port problem oneandoneis2 Linux - Hardware 2 11-10-2003 10:50 AM
Toshiba Sattelite ext usb modem problem (no serial port) denzel Linux - Hardware 4 09-24-2003 03:19 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:25 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration