This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

nRF9160: TCP/IP Server-Client with BSD library

Hi,

Finally i am able to build a basic TCP/IP server client, attaching the project heretcp_client_server.zip, i have some questions wrt modem and TCP/IP stack:

  • I see two different socket calls nrf_xxx and and plain bsd apis, which one i should  use? or it doesnt matter what even API I call?
  • Since I am using modem TCP/IP stack I can put my M33 core in sleep/low power mode, so in this scenario when I have listening socket and a there is an incoming connection can the modem wakeup the core to handle the connection?
  • If i want to use the nrf91 as a serial lte modem how can i realize the functionality of RI, DSR, DTR?
  • Can I the create a secured socket with ssl/tls with modem TCP/IP stack? if so please point me to an example, note that i dont want to run the ssl layer on the M33 core it will increase my over all current consumption.

regards

KK

Parents
  • Hello,

     

    I see two different socket calls nrf_xxx and and plain bsd apis, which one i should  use? or it doesnt matter what even API I call?

     You should use the bsdlib socket API. I believe that's what you're referring to when you say "nrf_xxx".

     

    Since I am using modem TCP/IP stack I can put my M33 core in sleep/low power mode, so in this scenario when I have listening socket and a there is an incoming connection can the modem wakeup the core to handle the connection?

     If you put the application core to sleep with AT#XSLEEP then bsdlib will wake it up when there is a connection request.

     

    If i want to use the nrf91 as a serial lte modem how can i realize the functionality of RI, DSR, DTR?

     I think you need to use RTS and CTS instead if I'm not mistaken.

     

    Can I the create a secured socket with ssl/tls with modem TCP/IP stack? if so please point me to an example, note that i dont want to run the ssl layer on the M33 core it will increase my over all current consumption.

     I will answer this one on Monday.

  • Hi Hakon

    Thanks for your reply

    You should use the bsdlib socket API. I believe that's what you're referring to when you say "nrf_xxx".

    What i meant here is, in my attached sample code i used socket(), connect(), send(), inet_pton() etc..

    in nrf provided bsdlib i have nrf_socket(), nrf_connect(), nrf_send(), nrf_inet_pton() 

    which one i should  use? i want to use modem internal TCP/IP stack, not the one which runs on M33 core(in your documentation you call it as CONFIG_NET_NATIVE=n).

     If you put the application core to sleep with AT#XSLEEP then bsdlib will wake it up when there is a connection request.

    I am confused with your answer all AT commands are meant for modem, do you mean that AT#XSLEEP will put the modem to sleep? can you point to the implementation of #XSLEEP?

     I think you need to use RTS and CTS instead if I'm not mistaken.

    I mean RI(ring indicator), DSR & DTR are standard modem control lines along with RTS and CTS.

    Since in nRF SiP the modem and and M33 are wired internally i dont think i have any control on modem control lines as it use to be in standard modem chips, anything i want to have the modem control lines functionality in nRF91 i should write a custom app on M33 core so that i mimic the control lines via GPIO, is my understanding correct?

    I will answer this one on Monday.

    Please, I am eagerly waiting for your answer, it is one of my critical requirement to have TLS/SSL serve socket running on nRF91.

    regards

    KK

  • kk2mkk said:
    which one i should  use?

     You can use both, but I recommend you use socket(), connect(), send(), inet_pton() etc. Both use the bsdlib stack and not the native Zephyr stack.

     

    kk2mkk said:
    I am confused with your answer all AT commands are meant for modem, do you mean that AT#XSLEEP will put the modem to sleep? can you point to the implementation of #XSLEEP?

     This command is specific to the serial LTE modem example. I can not point to the implementation of AT#XSLEEP since this is not publicly available information. Also, in the general case you need to wake up the application by means of GPIO, I don't think it is possible for the modem to wake up the application directly.

     

    kk2mkk said:
    I mean RI(ring indicator), DSR & DTR are standard modem control lines along with RTS and CTS.

     The modem on nRF9160 does not use any of these lines. If you're asking if you can emulate these lines on the application core I guess that would be correct, although I don't understand why you would do that.

     

    Can I the create a secured socket with ssl/tls with modem TCP/IP stack? if so please point me to an example, note that i dont want to run the ssl layer on the M33 core it will increase my over all current consumption.

     Yes, this is done entirely by bsdlib when you open a TLS socket. There are several examples that use TLS sockets. One example would be the aws_fota example. This blog should also be useful.

Reply
  • kk2mkk said:
    which one i should  use?

     You can use both, but I recommend you use socket(), connect(), send(), inet_pton() etc. Both use the bsdlib stack and not the native Zephyr stack.

     

    kk2mkk said:
    I am confused with your answer all AT commands are meant for modem, do you mean that AT#XSLEEP will put the modem to sleep? can you point to the implementation of #XSLEEP?

     This command is specific to the serial LTE modem example. I can not point to the implementation of AT#XSLEEP since this is not publicly available information. Also, in the general case you need to wake up the application by means of GPIO, I don't think it is possible for the modem to wake up the application directly.

     

    kk2mkk said:
    I mean RI(ring indicator), DSR & DTR are standard modem control lines along with RTS and CTS.

     The modem on nRF9160 does not use any of these lines. If you're asking if you can emulate these lines on the application core I guess that would be correct, although I don't understand why you would do that.

     

    Can I the create a secured socket with ssl/tls with modem TCP/IP stack? if so please point me to an example, note that i dont want to run the ssl layer on the M33 core it will increase my over all current consumption.

     Yes, this is done entirely by bsdlib when you open a TLS socket. There are several examples that use TLS sockets. One example would be the aws_fota example. This blog should also be useful.

Children
Related