Boost logo

Boost :

From: Sergei Nikulov (sergey.nikulov_at_[hidden])
Date: 2020-01-14 08:05:14


Hello JH

If SerialOptions defaults (parity, csize, flow, stop) are good for you

SerialOptions() : device(), baudrate(9600), timeout(seconds(0)),
            parity(noparity), csize(8), flow(noflow), stop(one) {}

then try to add \r to the end of your AT command
- serial<<"AT+CGDCONT?" << endl;.
+ serial<<"AT+CGDCONT?\r\n";

AFAIR, AT commands, use it as line end (ref
https://en.wikipedia.org/wiki/Hayes_command_set), but on Linux
std::endl only LF(0x0A).
Maybe this is your case.
HTH.

вт, 14 янв. 2020 г. в 02:34, JH <jupiter.hce_at_[hidden]>:
>
> Hi Sergei,
>
> Thanks for your response.
>
> Please find code I found from Internet attached, the same baud rate,
> serial port and AT command I can get response from minicom, but empty
> response from the boost serial port, I don't think it was the baud
> rate issue or option parameters issue, but I could be wrong.
>
> Appreciate if you could get it work.
>
> Thank you.
>
> Kind regards,
>
> - jh
>
> On 1/13/20, Sergei Nikulov <sergey.nikulov_at_[hidden]> wrote:
> > пн, 13 янв. 2020 г. в 12:12, JH via Boost <boost_at_[hidden]>:
> >>
> >> Hi,
> >>
> >> There are many boost serial port sample code out there, but none of
> >> them I can run AT command. I have a device connected to my ubuntu 18,
> >> I can run AT command on minicom to get correct response, but I could
> >> not get any AT response from boost serial port. Has anyone made it
> >> work?
> >>
> >> Thank you.
> >>
> >> Kind regards,
> >>
> >> - jh
> >>
> >> _______________________________________________
> >> Unsubscribe & other changes:
> >> http://lists.boost.org/mailman/listinfo.cgi/boost
> >
> > Could you please show the code?
> > Just guess, incorrect baud rate or other config parameters (ref.
> > https://www.boost.org/doc/libs/1_72_0/doc/html/boost_asio/reference/basic_serial_port/set_option.html)
> >
> > --
> > Best Regards,
> > Sergei Nikulov
> >

-- 
Best Regards,
Sergei Nikulov

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk