2

I am trying to use my RaspberryPi Zero to communicate with an A6 GPRS module (http://www.inkocean.in/gprs-a6-module-sms-board-gsm-gprs-wireless-data-transmission-over-sim900a)

Drawing of physical connections:

Drawing of physical connections

Steps taken:

  • connect module's U_TDX pin to PiZero's TXD0 (GPIO14)
  • connect module's U_RDX pin to PiZero's RXD0 (GPIO15)
  • connect module's GND pin to PiZero's Ground
  • power up pi using micro-usb
  • power up module using it's own micro-usb port
  • disabled serial port getty/logging using raspi-config
  • reboot
  • added linux user to group dialout
  • command: ls -l /dev/ttyAMA0 output: crw-rw---- 1 root dialout 204, 64 Oct 19 10:17 /dev/ttyAMA0

Now I should be able to communicate with the module and monitor the serial port using a serial monitor, i have tried using screen for this:

screen /dev/ttyAMA0 115200

But I get a blank screen without errors.

According to this blog (https://learn.adafruit.com/fona-tethering-to-raspberry-pi-or-beaglebone-black/setup) which uses a similar module, i should be able to type "AT" + enter (without seeing the feedback of chars being typed) and I should receive "OK", which I do not.

Potential problems:

  • the module is borked (doesn't seem so; I get a solid red led and a blue led blinks a few times after boot, I assume it's making connection to the sim's network)
  • wiring is incorrect, perhaps use different pins on the module?
  • I have not yet correctly configured the serial monitor screen or am using the wrong baud rate?

What I have tried:

  • connecting the zero's serial ports to the module's R232_RXD and R232_TXD ports
  • using minicom as a serial monitor
  • using PySerial to send/read data to/from the module

What I havn't tried:

  • connecting the zero's serial ports to the module's H_RXD and H_TXD ports as I assume these are not the ports I need

Any help solving or even just debugging this issue would really be appreciated, as I am really stuck. Thanks.

  • How do you power the module? The page you linked to says "Operating Voltage 3.3V-4.2V", how much did you provide? – Dmitry Grigoryev Oct 19 '16 at 12:56
  • @DmitryGrigoryev good question, I will update the question including the powering info. I power the unit using micro USB (5V). – deacs Oct 19 '16 at 13:00
  • @DmitryGrigoryev that page I linked to has some contradictive info on the powering. it also states VCC_IN : Power Supply Input 5V -9V – deacs Oct 19 '16 at 13:07
  • Did you get your PI0 to A6 Working , as I am attempting the same thing, and I also cant get it to work? – Nic Van Staden Nov 28 '17 at 11:47
  • @NicVanStaden yes I got it working, see myown answer to the question. What problems are you having? – deacs Nov 29 '17 at 18:07
1

If you have already connected the Pi Zero TX/RX pins to the GPSs RS232 TX/RX, then you may have a 'problem'. Voltages for RS232 communication can be anything from -15v to +15v, and the Pi Zero is expecting +3.3v and 0v... you may have killed those pins.

It seems (from the page you linked to) that the U_TXD and U_RXD pins on the GPS use TTL levels (+5v and 0v), so those are not safe to use either unless you have a level shifter...

My first step would be to check that the Pi Zero TX/RX pins are still working - link them to another Pi (if you have one), open a terminal on each and make sure you can Tx/Rx both ways. You might also be able to simply link Tx to Rx on the Pi Zero, open a terminal and see the sent data reflected back to you...

  • yeah i read something about frying the pins only after trying the rs232 pins, so I really hope the pins aren't fried. I do have another pi, so will try the feedback loop to test if the pins are still working on the Pi. Any way to test if the pins on the module are fried? – deacs Oct 19 '16 at 13:05
  • Oh, so you tried RS232 pins first? Sorry to say this, but there are high chances your pins are already dead. Definitely test them before you proceed. – Dmitry Grigoryev Oct 19 '16 at 13:20
  • No I tried the U_RXD and U_TXD pins first, I only tried the RS232 pins after I did not have success with the U_* pins. Can I test if the pins work with a voltmeter or something? – deacs Oct 19 '16 at 13:49
  • 1
    You can test the pins using a simple loopback -- attach the Pi's tx to it's own rx and open minicom or screen (or any serial terminal app). You should get what you are typing back echoed (just make sure the echo is actually set on the app so you can see it in the first place, because you want to make sure when you type x you get xx). – goldilocks Oct 19 '16 at 17:40
0

I eventually found the problem, which was alot more basic than I thought.

The problem was the wiring of the module to the pi. The wiring of the pins should look like this:

enter image description here

So that:

  • The module's trasmitter pin (U_TXD) connects to the Pi's receiver pin (RXD0)
  • The module's receiver pin (U_RXD) connects to the Pi's transmitter pin (TXD0)

As shown by this image:

enter image description here

Which makes a whole lot of sense. I hope this helps other people that might be stuck on the same (basic) issue!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.