带有A6 GSM / GPRS模块的Raspberry Pi 3无法正常工作

时间:2017-03-30 11:48:56

标签: gsm raspberry-pi3 uart gpio sim900

我试图使用' AI A6 GSM SIM900'使用Raspberry Pi 3的模块。 我做了以下步骤,但我无法进行串行连接。

连接Raspberry Pi 3和GSM模块:

GPIO 14 (UART - TXD) pin to GSM U_RXD
GPIO 15 (UART - RXD) pin to GSM U_TXD
GPIO GND pin to GSM GND
GSM PWR pin to GSM VCC_IN pin

禁用蓝牙以将ttyAMA0用于GSM

Adding following line in /boot/config.txt
dtoverlay=uart1
dtoverlay=pi3-miniuart-bt,pi3-disable-bt

已禁用串行控制台。

a) sudo nano /boot/cmdline.txt
removed the word pharse "console=serial0,115200" or "console=ttyAMA0,115200"  

当我使用串行线' / dev / ttyAMA0'开始使用putty时和速度9600或115200,我什么都没得到。出现空白屏幕并挂起。

调试信息:

pi @ raspberrypi:〜$ sudo dmesg | grep tty

[    0.000000] Kernel command line: 8250.nr_uarts=1 8250.nr_uarts=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1200 bcm2708_fb.fbswap=1 dma.dmachans=0x7f35 bcm2709.boardrev=0xa02082 bcm2709.serial=0x73d75e58 bcm2709.uart_clock=48000000 smsc95xx.macaddr=B8:27:EB:D7:5E:58 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
[    0.001356] console [tty1] enabled
[    0.381803] 3f215040.uart: ttyS0 at MMIO 0x3f215040 (irq = 59, base_baud = 50000000) is a 16550
[    1.007616] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2

pi @ raspberrypi:〜$ sudo dmesg | grep uart

[    0.000000] Kernel command line: 8250.nr_uarts=1 8250.nr_uarts=1 bcm2708_fb.fbwidth=1920 bcm2708_fb.fbheight=1200 bcm2708_fb.fbswap=1 dma.dmachans=0x7f35 bcm2709.boardrev=0xa02082 bcm2709.serial=0x73d75e58 bcm2709.uart_clock=48000000 smsc95xx.macaddr=B8:27:EB:D7:5E:58 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000  dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline rootwait fbcon=map:10 fbcon=font:ProFont6x11 logo.nologo
[    0.082259] uart-pl011 3f201000.uart: could not find pctldev for node /soc/gpio@7e200000/uart0_pins, deferring probe
[    0.381803] 3f215040.uart: ttyS0 at MMIO 0x3f215040 (irq = 59, base_baud = 50000000) is a 16550
[    1.007616] 3f201000.uart: ttyAMA0 at MMIO 0x3f201000 (irq = 87, base_baud = 0) is a PL011 rev2
[  370.599029] uart-pl011 3f201000.uart: no DMA platform data

pi @ raspberrypi:〜$ sudo stty -F / dev / ttyAMA0

speed 9600 baud; line = 0;
min = 1; time = 0;
ignbrk -brkint -icrnl -imaxbel
-opost -onlcr
-isig -icanon -iexten -echo -echoe -echok

pi @ raspberrypi:〜$ sudo stty -F / dev / ttyS0

speed 9600 baud; line = 0;
-brkint -imaxbel

请提供您的想法/建议。

谢谢,

拉​​夫

1 个答案:

答案 0 :(得分:0)

我今天遇到同样的问题,我想在RPi 3b上激活串口,同时我对保持蓝牙功能不感兴趣。

经过多次尝试,我进入了文档(https://www.raspberrypi.org/documentation/configuration/uart.md)并从那里得出了修改/boot/config.txt以包含这些行的结论

.then(function() {
  // `return` value from `myallback()`
  return myCallback();
})

另外,我还按照您的说明从/boot/cmdline.txt中删除了任何uart文本。在我的情况下

enable_uart=1
dtoverlay=pi3-disable-bt

最佳!