Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Setting fixed baudrate with at+ipr=19200 #254

Open
Bodata opened this issue Nov 20, 2024 · 13 comments
Open

Setting fixed baudrate with at+ipr=19200 #254

Bodata opened this issue Nov 20, 2024 · 13 comments

Comments

@Bodata
Copy link

Bodata commented Nov 20, 2024

Hi,

if i ask baudrate with at+ipr?
i get 0 This means auto baudrate

I want to set the baudrate to fixed 19200 with the command

 at+ipr=19200

It gives me an ok, but i cannot reach the modem anymore.
Whatever baudrate i try.

What am i doing wrong ?
Should this work ?

@lewisxhe
Copy link
Contributor

If you set the fixed baud rate to 19200, did you also configure the baud rate to 19200 when initializing Serial?

@Bodata
Copy link
Author

Bodata commented Nov 25, 2024

Hi,

I am not sure what you mean, i wil describe what i do.

I have attached the modem print usb port to the usb port of my PC.
It finds COM11

I use putty software and make a serial connection through the comport.
I set the baudrate to 115200.

I type AT
get OK
I type ATE1 (so i can see what i am typing)
get OK
I type at+ipr=19200
get OK
i change the baudrate to 19200 in putty
i can type but get jibrish

OK

OK

OK
at
OK
at+ipr=19200      
OK    <--- this is where a change the baudrate of putty
▒▒▒▒▒▒▒▒▒▒▒▒

With other types of modems this all works.
What is going wrong ?

@lewisxhe
Copy link
Contributor

I mean are you changing SerialAT.begin(115200, SERIAL_8N1, MODEM_RX, MODEM_TX); to SerialAT.begin(19200, SERIAL_8N1, MODEM_RX, MODEM_TX);

@Bodata
Copy link
Author

Bodata commented Nov 26, 2024

Ok.... i lost you there.... ;-)
I am used to work with modems in which i can set the baudrate of the serial connection.

I connect to the modem and type at+ipr="baudrate" and the communicatie speed is changed according the baudrate i set.
After this i change the speed of the serial connection to the speed i changed to.
When all is working on the new baudrate i save the setting with AT&W. (or something simular)
This is how i did it in the old days.
I would like to work with a fixed baudrate of 19200

Where should i put "SerialAT.begin(19200, SERIAL_8N1, MODEM_RX, MODEM_TX); "
I am lost there ? Is a serial terminal program like putty not ok ?
Should i reprogram/flash the device with the new setting to make it work ?
and if so what tools should i us ?

Regards,
Peter

@lewisxhe
Copy link
Contributor

Put it in the setup function, it has nothing to do with putty, putty monitors the serial baud rate, not the communication baud rate of the modem and ESP

@Bodata
Copy link
Author

Bodata commented Nov 26, 2024

Sorry to say, i stil lost you ;-)
Could you please explain to me how to set the baudrate to fixed 19200 ?
I understand this cannot be done with putty ? Correct ?
So at+ipr=19200 is not working ? Correct ?

Should i reprogram the device ?
What tool(s) should i use ?

For now i only want to use the device as a serial modem fixed at 19200 baud.

lewisxhe added a commit that referenced this issue Nov 26, 2024
@lewisxhe
Copy link
Contributor

Add baud rate check to automatically determine the appropriate baud rate. Write this example
https://github.com/Xinyuan-LilyGO/LilyGo-T-Call-SIM800/blob/master/examples/Arduino_AT_Debug/Arduino_AT_Debug.ino

@Bodata
Copy link
Author

Bodata commented Nov 26, 2024

Thanks for your link.
At the moment i have other things to attend.
I wil look at it later this week or next week.
I hope to let you know if i managed to understand the working.
At the moment i am still puzzeled....

@lewisxhe
Copy link
Contributor

OK.

modem <------(baud rate : 19200 )-------> esp32

esp32 <----------(baud rate : 115200) -----> putty

Do you understand? These are two different things.

@Bodata
Copy link
Author

Bodata commented Nov 26, 2024

Ok
This is what i find hard to understand you have different communication speeds within the device (right ?)
One speed between the processor and the modem and one between the processor and the serial port.

You can set the speed of the modem with AT commands.
How to you set the speed op the serial port ?
In order to do this you have to reprogram the device ?

@lewisxhe
Copy link
Contributor

Whether reprogramming is required is determined by the application.

@Bodata
Copy link
Author

Bodata commented Nov 26, 2024

I am looking if i can use the module to replace a serial modem i am using now.
I want to attach a rs232 device to the module with a fixed baudrate of 19200.
If i understand correctly i have to reprogram the module for the correct speed of the serial port.

@lewisxhe
Copy link
Contributor

yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants