0

I am trying to send sms using RPI Add on v22 module and Raspberry-pi 3+.

I have mounted this module on top of Raspberry-pi.

When I use minicome using minicom -D /dev/ttyS0 -b 115200 -o

I get the terminal, but I can not type anything on that terminal. What's the problem there? My module is burnt?

The Module I use

My /boot/config.txt

dtoverlay=pi3-miniuart-bt
enable_uart=1
force_turbo=1

My /boot/cmdline.txt

dwc_otg.lpm_enable=0 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

My /lib/systemd/system/hciuart.service

After = dev-ttyS0.device

ExecStart = /usr/lib/hciattach /dev/ttyS0 bcm43xx 460800 noflow -

as given here.

My program is

import serial
import RPi.GPIO as GPIO
import os, time
GPIO.setmode(GPIO.BOARD)
port = serial.Serial("/dev/ttyS0", baudrate=9600, timeout=1)
port.flush()
port.write('AT'+'\r\n')
rcv = port.read(10)
print rcv
time.sleep(1)

In terminal I get nothing printed, at least AT command. If I change /dev/ttyS0 to /dev/ttyAMA1, AT command printed on terminal. But no ok coming from device.

Here they suggested to edit /etc/inittab, but I dont have any file there in my Pi.

I have separate 5V/2A power supply to the GSM module.

Added later by author: I have used minicom, sudo minicom -D /dev/ttyS0, but it has nothing

What am I missing here? I am new to these GSM modules. Any help would be greatly appreciated.

  • 1
    You should try communicating with it using minicom, screen, or miniterm.py (the last one is probably the easiest and would have been installed with py-serial), so that you know you have a working configuration. Once that's established you can try with your own code. – goldilocks Aug 30 '19 at 12:41
  • Troubleshooting suggestions: (1) Write a python program to test UART loopback (search this forum for demo programs). This makes sure your UART program is working OK. (2) Actually you don't need any Rpi python program to do the testing. You can use any terminal emulator, says Windows RealTerm (check out SparkFun) to test your SIM800. From terminal send "AT" and see if you get back "OK". – tlfong01 Aug 30 '19 at 12:44
  • @goldilocks Yes, forgot to mention, I have used minicom, sudo minicom -D /dev/ttyS0, but it has nothing. – Sachith Muhandiram Aug 30 '19 at 12:49
  • @tlfong01 Could you please update something for this? as I am very new to these. – Sachith Muhandiram Aug 30 '19 at 12:50
  • 1
    Edit new information into the question. Keep in mind many people will scan the question and leave if there is too much ambiguity for them to want to get entangled. They won't bother reading the comments. – goldilocks Aug 30 '19 at 13:05
  • Why have you swapped RX/TX? An add-on sounds like something to be attached to the Pi. – joan Aug 30 '19 at 15:11
  • @joan RX pin of Rpi is connected to TX pin of GSM module. – Sachith Muhandiram Aug 30 '19 at 15:23
  • 1
    I think you need to give a link to this "add-on". – joan Aug 30 '19 at 15:25
  • @joan added image and link. – Sachith Muhandiram Aug 30 '19 at 16:06
  • 1
    If that is designed to sit on the Pi you should not be swapping TX and RX. You should connect pin to pin. – joan Aug 30 '19 at 16:31
  • 1
    @Sachith, SIM800 Rpi Add On is a popular card. You can google many tutorials. – tlfong01 Aug 31 '19 at 00:42
  • @tlfong01 yes, unfortunately, still I couldnt find one to solve my problem. I have followed many, but non of them were working. – Sachith Muhandiram Aug 31 '19 at 03:38
  • 1
    @Sachith, I am not surprised. Perhaps you don't have the necessary background. I would suggest the following. (1) Play with Win RealTerm (google SparkFun) for some time, until you know how to use Win USB UART adapter to test loopback (echo input out). (2) Play with Rpi python loopback program, using TxRx pins AND USB UART adapter to do loopback. (3) Win RealTerm to test Rpi python loopback (google my python loopback program in this forum) (4) Google this forum for Rpi talk to Arduino (my LONG answer) to see how I do troublshooting. / to continue, ... – tlfong01 Aug 31 '19 at 04:29
  • 1
    You need to know inside out what is going on when you test Win Real Term with Rpi Python loop back program, AND vice versa. Then perhaps you can try a simple device, say BlueTooth serial adapter (WinTerm/python sends "AT", Bluetooth serial adapter return "OK"). If you know Arduino, then try Arduino to receive AT and return OK. Yes, I know it take times, perhaps 100 hours or longer, but everything you learn can be transfer to other project. You may be annoyed that I don't tell you how to test SIM800 card. Comments welcome. – tlfong01 Aug 31 '19 at 04:31
  • 1
    What I am suggesting is the shortest shortcut to test you module, can't be shorter! – tlfong01 Aug 31 '19 at 04:37

0 Answers0