News:

;) This forum is the property of Proton software developers

Main Menu

Sending a At Command String Issue via Uart?

Started by Craig, Jul 21, 2026, 04:02 PM

Previous topic - Next topic

Craig

Hi I am having an issue with sending a AT+ Command string to an Air780EU 4G Lte modem.
If I test the modem using Uart on Docklight (Terminal Program) it works fine AT+SSLCFG="cacert",88,"isrgrootx1.pem"<CR><LF>, I will get back an OK acknowledgement I can connect to the server and send and receive everything works as expected.

I am using a Pic18F27Q10 or 18F47Q10 @ 64Mhz I get the same results with both 
Declare Hserial2_Baud = 115200
Declare HRSOut2_Pin = PORTB.6                ' TX2 to the PC To Read Serial Data
Declare HRSIn2_Pin = PORTB.7                   ' RX2 to the PC To Read Serial Data
Declare HSerial2_Terminator = CRLF           ' The parameter CR will transmit a single value of 13 and 10 at the end of transmission
Declare Hserial2_Clear = On                       ' Clear the buffer before receiving


HSerOut2 ["At+CREG?",13,10]                  ' Send AT Command         
HRSIn2 {1000, Paint}, Wait("+CREG:"), GsmMsg[0], GsmMsg[1], GsmMsg[2], GsmMsg[4], GsmMsg[5], GsmMsg[6], GsmMsg[7], GsmMsg[8], GsmMsg[9], GsmMsg[10] 
Print At 0,40,"+CREG:",GsmMsg[1],GsmMsg[2],GsmMsg[4]


I will get the correct command back +CREG:0,1 OK

So the modem is responding correctly but, If I try and send the following it does Not Acknowledge it.

HSerOut2 ["At+SSLCFG=",34,"cacert",34,88,34,"isrgrootx1.pem",34,13,10]     ' 34 = ", 13 = CR, 10 = LF
HRSIn2 {2000, Paint}, Wait("OK"), Temp1
Print At 0,40, Dec Temp1," "                 


I also tried: HRSOut2Ln "At+SSLCFG=",34,"cacert",34,88,34,"isrgrootx1.pem",34

Still No response does the same as above.

I don't know what else to try, any help is much appreciated!

Regards
Craig



   

trastikata

#1
You are missing the comma separator in your AT string, also <n> should be string:

AT+SSLCFG="sslversion",<n>[,<sslversion>]

trastikata

#2
HSerOut2 ["At+SSLCFG=",34,"cacert",34,",88,",34,"isrgrootx1.pem",34,13,10]

Craig

Thanks Very Much Dyanko for your Help, that fixed the problem with the comma separator.
Kind Regards
Craig

Craig

I am Back at it again and wanting to pull my Hair out, I have spent hours trying to load this string into the modem before asking on the forum.
I have tried many iteration of this string syntax and it keeps rejecting it. The Pic loads all the AT command strings into the modem successfully up to this command but, won't take this string syntax.

HSerOut2 ["At+MCONFIG=",34,"62458",34,34,"GrgPin",34,34,">1Yn*#:CJ^H?Bth",34,13,10]
or
HSerOut2 ["At+MCONFIG=",",62458,",34,"GrgPin",34,34,">1Yn*#:CJ^H?Bth",34,13,10]
or
HSerOut2 ["At+MCONFIG=",",62458,",",GrgPin,",",>1Yn*#:CJ^H?Bth,",13,10]

HRSIn2 {3000, Paint}, Wait("OK"), temp1
Print At 0,80, Dec temp1," "

According to the Air780E data sheet the string for AT+MCONFIG can be either inserted with or without " "

If I load this string from DockLight in either format into the Air780E modem it works fine but, for some strange reason I cannot get it to load correctly from the Pic into the modem. I am using The one-way certification testing process is as follows: in the document as below!

https://docs.openluat.com/air780e/at/app/command/mqtt/

I would really appreciate any direction in how I am supposed to insert this string into the correct syntax that Positron can push into the modem that it can accept and understand?
Regards
Craig

Pepe

Test this

HSerOut2 ["AT+MCONFIG=",34,"62458",34,",",34,"GrgPin",34,",",34,">1Yn*#:CJ^H?Bth",34,13,10]

Craig

THANK YOU Pepe That works. Where Can I read up on the correct Syntax procedures for making up these strings as I don't find anything in the Positron 8 Manual that clearly explains what needs to be in " marks etc?
regards
Craig

Henk57

I could not help because I don't understand Chinese.

I can explain a bit.
It depends on the value's if they must be strings, furthermore, numbers or commands.
or even skip to the next field.
As I said I could not read chinese, so you must carefully look each command, how it is build up,
from the manual.

Thanks to Pepe that he could help you.

trastikata

Hi Craig,

AT commands are strings, the device really should see what it gets as a string.

Think like this - everything you send should be ASCII, so you can send an entire string as the equivalent byte array of the ASCII symbols.

For example the AT command has a comma separator, then you should send comma or ASCII 44. You have to send some number, say 88 as parameter, then you really send ASCII 56, ASCII 56 - which is the equivalent of "88".

The confusing part is the Double quotes which often come in the AT string - in positron you can wrap Double quotes with Double quotes to say it is a string, therefore we send as byte the ASCII representation of the Double quotes which is 34.