Page 1 of 1

stm32f411 and sim800L

Posted: Mon Oct 26, 2020 9:37 pm
by nesergen
I'm trying to connect the stm32f411 board and the SIM800L gsm module. I have been suffering for several days. Rummaged through a bunch of manuals.
There is an assumption that the board is interacting with the module, but errors are constantly appearing. Now in more detail ....
I connected the boards according to this instruction:
Image
Uploaded the main.py sketch to the motherboard.

Code: Select all

import pyb, json,utime

print('START code...')
uart = machine.UART(1, 9600) 
print ("Test 2")
uart.write("AT\r")
utime.sleep(2)
print ("Test 3")
uart.read(8)
print ("Test 4")
I get infinite error:
pc ~ $ picocom /dev/ttyACM0
picocom v1.7

port is : /dev/ttyACM0
flowcontrol : none
baudrate is : 9600
parity is : none
databits are : 8
escape is : C-a
local echo is : no
noinit is : no
noreset is : no
nolock is : no
send_cmd is : sz -vv
receive_cmd is : rz -vv
imap is :
omap is :
emap is : crcrlf,delbs,

Terminal ready
START code...
Test 2
Test 3
MicroPython v1.13 on 2020-10-14; WeAct F411CE with STM32F411CE
Type "help()" for more information.
>>> machine.soft_reset()
MPY: sync filesystems
MPY: soft reboot
START code...
Test 2
Test 3
Test 4
MicroPython v1.13 on 2020-10-14; WeAct F411CE with STM32F411CE
Type "help()" for more information.
>>> ation.
Traceback (most recent call last):
File "<stdin>", line 2
SyntaxError: invalid syntax
>>> >>>
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>> SIM800 R14.18
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>>
>>> ERROR
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'ERROR' isn't defined
>>> ation.
Traceback (most recent call last):
File "<stdin>", line 2
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>> File "<stdin>", line 2
Traceback (most recent call last):
File "<stdin>", line 1
IndentationError: unexpected indent
>>> SyntaxError: invalid syntax
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>> >>> >>>
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>> Traceback (most recent call last):
Traceback (most recent call last):
File "<stdin>", line 1
SyntaxError: invalid syntax
>>> File "<stdin>", line 1
Traceback (most recent call last):
File "<stdin>", line 1
IndentationError: unexpected indent
>>> SyntaxError: invalid syntax

Thanks for using picocom
Interestingly, the output contains information about the module
>>> SIM800 R14.18
. I suppose this proves that boards communicate. But why do other errors fall out? Moreover, no details about the reasons for the error are written. can anyone give some advice?

Re: stm32f411 and sim800L

Posted: Mon Oct 26, 2020 10:49 pm
by jimmo
Is it possible that you're using the same UART that's used for the MicroPython REPL to talk to the GSM module? So MicroPython is trying to "execute" the output from the module?

Re: stm32f411 and sim800L

Posted: Mon Oct 26, 2020 11:42 pm
by davef
Just a ''heads-up" ... you do have 2G network access in your area.

Re: stm32f411 and sim800L

Posted: Tue Oct 27, 2020 6:37 am
by nesergen
jimmo wrote:
Mon Oct 26, 2020 10:49 pm
Is it possible that you're using the same UART that's used for the MicroPython REPL to talk to the GSM module? So MicroPython is trying to "execute" the output from the module?
Hmmmmmm..... Maybe you right :idea: . I will try this. Thanks!

Re: stm32f411 and sim800L

Posted: Tue Oct 27, 2020 2:45 pm
by dhylands
The schematic also looks weird. It shows TxD on the MCU as being an input when in fact TxD in the MCU is an output, and RxD is the input.

For the MCU RTS is an output and CTS is an input, so that part looks OK.

Re: stm32f411 and sim800L

Posted: Wed Oct 28, 2020 7:09 am
by nesergen
Choosing a different UART port solved the problem. I knew about the error in the diagram with the connection of pins, so I did it right right away.
But I can't connect to the network, although there are many 2g networks in my area and the SIM card supports this mode. The module finds the networks, but not the ones I need. I will try to write a log to Flash memory and transfer the module to different places.

Re: stm32f411 and sim800L

Posted: Thu Oct 29, 2020 2:38 pm
by nesergen
I am trying to get a list of the operators of my location. But the received data is truncated. Please tell me why this is happening.

Code: Select all

b'AT+COPS=?\r\r\n+COPS: (1,"MOTIV","MOTIV","25020"),(1,"MTS","MTS","25'

Re: stm32f411 and sim800L

Posted: Thu Oct 29, 2020 4:27 pm
by dhylands
You should increase the size of the Rx buffer.
http://docs.micropython.org/en/latest/l ... .UART.init

pass in an rxbuf which is bigger than the largest message you expect to receive.