3

I have a Sim800 GSM module hooked up to pins 8 and 10 of the a PI B+ running the latest version of Jessie. I have configured Jessie so that nothing else is using the TXD0 and RXD0 pins. If I connect a pc up via a USB to TTL adapter to the pins I can see that whatever I type on the PC shows up on the PI and vice versa.

If I connect the pc via a USB to TTL adapter to the SIM800 it responds to my AT commands as I would expect.

BUT, If I connect the SIM800 up to the PI I can send AT commands to it but never get anything back. This is driving me nuts. I have definitely got my TX and RX the right way around.

The USB to TTL is configurable between 5v and 3.3v. I used it as 3.3v when connecting to the PI and 5v when connecting to the PC. The SIM800 is on a breakout board and accepts 5v which I am powering via a bench power supply. I am putting the TX from the SIM800 through a voltage divider to shift it back down to 3.3v before going back into the rx pin of the pi. The voltage divider consists of a 4.7K and 2.2K resistor. I suspect I dont need this as I think the logic level from the SIM800 is 3.3v but I need to check tomorrow.

I have tried with minicom and with a python script sending AT commands direct. I am using 9600, 8, N, 1 initially but have tried other baud rates as well.

The specific module I am using is the same as this one https://www.amazon.co.uk/MagiDeal-SIM800L-Module-QUAD-BAND-Arduino/dp/B01FK3OPQ6/ref=sr_1_2?ie=UTF8&qid=1492539878&sr=8-2&keywords=sim800l

The python script is simply

import serial
ser = serial.Serial(port='/dev/ttyAMA0', baudrate=115200, timeout=1)
cmd="AT+CFUN=0\r\n"
ser.write(cmd.encode())
msg=ser.read(64)
print(msg)

Which turns the GPRS off and I can see it works because the LED on the module starts flashing quickly.

UPDATE - Just tried to send a comand to turn off GPRS and that did work. I just don't get anything echoed back. Any reason why I wouldn't see characters coming back?

Any help appreciated thanks SOS

  • USB to TTL is probably 5V, which may be what the module expects -- a SIM800 chip itself is 2.8V, which is awkward, hence it is usually stepped up. You need to provide more details about your specific module or this is unanswerable. Also the software you are using to connect. – goldilocks Apr 18 '17 at 17:06
  • The USB to ttl is configurable between 5v and 3.3v. I used it as 3.3v. The SIM800 is on a breakout board and accepts 5v which I am powering via a bench power supply. I am putting the TX from the SIM800 through a voltage divider to shift it back down to 3.3v before going back into the rx pin of the pi. I have tried with minicom and with a python script sending AT commands direct. The specific module I am using is the same as this one amazon.co.uk/MagiDeal-SIM800L-Module-QUAD-BAND-Arduino/dp/… – SpeedOfSpin Apr 18 '17 at 17:46
  • Please edit the information into the question. Describing the voltage divider further would also be good. The point about going into detail with the things you have presumably done right is to spare the people you are asking for help time going, "Have you done ___? What about ____?" Etc. See: raspberrypi.meta.stackexchange.com/q/794/5538 – goldilocks Apr 18 '17 at 18:08
2

After reading the datasheets a little more thoroughly the module I am using requires 5v in but the logic levels are only 3.3v which I guess makes sense.

After hooking TX directly up to the PI it worked fine. I'm not sure why the voltage divider was making it fail. If anybody can help me understand why that would be great but at the moment it seems to be working fine.

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.