1

I use a module same as here with my RPI 4B and there were difficulties in communication between them two since the start. The module worked fine with my Arduino. It is connected via Rxd-Txd pins, 5V, ground and an additional external power to the module.

I'm trying to make it make calls with the help of python, and for now after entering python -m serial.tools.miniterm /dev/ttyAMA0 115200 to the RPI terminal and typing in blindly "AT" I get a series of backslashes which after a closer look turned out to be this: "␄␐␁␀" (EOT DLE SOH NUL). Which happily already is a response, but it's still not an "OK" that's expected after such command.

How could I solve this? I've surfed many google search results for RPI and SIM900 but none of them worked.

UPD: *Serial is enabled, *Bluetooth disabled, *OS is Raspbian 10, *the module doesn't respond to any baudrate other than 115200 I'll try to get a level shifter and use it between RPi and module, the suggestion seems pretty logical and I wouldn't even think of devices using different voltages for UART. I'll post the results as soon as I get the shifter.

Oresto
  • 11
  • 2
  • Comments are not for extended discussion; this conversation has been [moved to chat](https://chat.stackexchange.com/rooms/100806/discussion-on-question-by-oresto-sim900-a6-gprs-gsm-module-and-rpi4b-uart-commun). – goldilocks Nov 07 '19 at 23:01
  • *"It is connected via Rxd-Txd"* -> If the breakout the SIM is on uses 5V logic, then you should use a level shifter in the middle, otherwise you may get false highs one way and false lows the other, which will amount to miscommunication... – goldilocks Nov 07 '19 at 23:04
  • @goldilocks could you please explain further the use of a shifter? Do you mean that RPi uses 5V in the Rxd-Txd and the module uses 3.3V? – Oresto Nov 08 '19 at 08:49
  • It is a secret known to few that *the Raspberry Pi uses 3.3V logic!* And even fewer: *Most Arduinos are 5V logic!* These are not the same. https://raspberrypi.stackexchange.com/a/49775/5538 – goldilocks Nov 08 '19 at 13:47
  • @goldilocks I don't see how Arduino is relevant here. SIM900's are 3.3V devices, and so are Raspberries. The product description in the OP's link clearly states **Interface logic voltage: 3.3V**, so adding a level shifter will almost certainly not help. – Dmitry Grigoryev Nov 10 '19 at 08:46
  • @DmitryGrigoryev I actually did not notice the product link. The Arduino is relevant since the question states, *"The module worked fine with my Arduino."*, implying 5V logic worked whereas 3.3V is not. I am not saying that definitively, but it is a possibility (except for the fact the datasheet I didn't read resolves this). SIM900s are I believe 2.8V, which phones commonly use. For hobbyists they are of course sold on breakouts, usually with 3.3 or 5V interfaces to the UART. – goldilocks Nov 10 '19 at 16:16

2 Answers2

2

In addition to what Milliways said, you seem to use the wrong baudrate (115200 instead of 19200), unless of course you changed this too.

Edit: it appears that your module is configured to 115200. I would recommend you to get a USB to UART converter such as this one and make sure the module replies to the AT commands using a regular PC, to completely exclude RPi-related problems from the mix. If you can't get the module to work, it may simply be defective. It's not unheard of when ordering stuff on Aliexpress.

Dmitry Grigoryev
  • 26,688
  • 4
  • 44
  • 133
1

This "Question" is lacking detail (OS, did you enable serial) BUT the fundamental problem is you are trying to use /dev/ttyAMA0 which is connected to Bluetooth (except in the unlikely circumstance that you changed this).

See How do I make serial work on the Raspberry Pi3 , Pi3B+, PiZeroW

Milliways
  • 54,718
  • 26
  • 92
  • 182