This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CC3000 GetHostName SPI Command - Opcode 0x1010

Other Parts Discussed in Thread: CC3100, CC3200

Hello,

I have been using CC3000 from 3 months but I think I do not have proper documentation of all the commands. As I am using my own microcontroller so I am developing my own code and for that I need proper commands, well I have connected my CC3000 to wifi but I am failing to use GetHostName command as there is no document in which a proper example is being shown that how to send data bytes via SPI.

Can anyone please help me with the command format for GetHostName having Opcode 0x1010, for example if I have to find IP of "www.google.co.in" then what I need to send through SPI ?

Thanks in advance..!!

  • Moving this to "SimpleLink™ WiFi - CC3000 Forum"

    Regards,
    Gigi Joseph.
  • Hello Joseph,

    I am looking forward for your reply as my work is in a halt state. Can you please help me with the answer.

    Best Regards
  • Hi Alark,

    You can see the API break down in the following wiki: processors.wiki.ti.com/.../CC3000_Protocol
    Please note that TI recommends CC3200 & CC3100 for all new and existing embedded Wi-Fi & Internet of Things applications. The New SimpleLink™ Internet-on-a-chip™ CC3200 and CC3100 solutions offer enhancements over existing TI CC3000 Wi-Fi modules.

    Thanks,
    Alon
  • Hi Alon,

    Thanks for your reply, I have reviewed the suggested page and have understood the GetHostName command. I am facing problem in creating a socket. I am confused between which socket to choose either TCP or UDP and why ? I am just trying to make a dummy program that can do entire processing right from connecting to WLAN till receiving data from a specific Website and Webpage.

    The website I am trying to access is "www.adafruit.com" and Webpage is "/testwifi/index.html", as I said it is just a demo code. I am actually opening a UDP socket and performing the following operations:

    Step 1 : Socket Open
    Step 2 : Socket Bind
    Step 3 : Socket Connect

    After this as I am trying to send the data over the air to the server - "GET Command" I am getting an error of "Socket Inactive", I really dont know how to proceed further, whether I have to choose TCP socket handling which is bit confusing and is not explained properly. Can you please guide what to do after this stage ?

    If I have to choose TCP Socket Handling can you please tell the procedure, like what to do, as per my understanding I'll do the following in sequence:

    Step 1 : Socket Open
    Step 2 : Socket Bind
    Step 3 : Socket Listen
    Step 4 : Socket Accept
    Step 5 : Socket Connect

    After this I'll be able to send the data over the air, right ? Please suggest if there are any changes to be made !!

    And secondly I want to send GET Command so I'll have to send it via Send Data Command over the air, right ? I am just conforming..!!

    Regards,
    Alark Mishra
  • Hi Alark,

    Please look at the CC3100 programmers guide chapter #6, discussing how to work with sockets: www.ti.com/.../swru368

    I know that you are using CC3000, but sockets are sockets..

    Regarding sending "GET" command, you can easily implement it by opening a TCP socket on port 80 and send the "GET..."  command as the data of this packet.

    Again, you can check out the "get_weather" example in CC3100 SDK: www.ti.com/.../cc3100sdk

    Thanks,
    Alon

  • Hi Alon,

    Thanks for your help.

    Cant we send "GET" Command through UDP Socket, is it necessary to open TCP Socket for this ?

    Regards & Thanks,
    Alark
  • Hi Alark,

    TCP is required.
    Nothing to do with CC3000, this is the way HTTP is working.

    Thanks,
    Alon
  • Hi Alon,

    Thanks a lot for your time.

    I'll try to work out with TCP Sockets.

    Regards,
    Alark
  • Hello Alon,

    I am unable to connect a socket, the IP I am receiving by GetHostByName command, I am passing the same to HCI_CMND_CONNECT after opening a socket, socket handle comes out to be 0. But the CC3000 is not able to connect with the IP, after a long time it returns an error code i.e. 0xFFFFFFFF.

    TCP Client Connection is not taking place, any specific reason why it can be so, I think the timeout is affecting but I cant even alter the timing parameter as that Command explanation is not given in the wiki pages of CC3000...!! I am not using the SimpleLink API as I want to develop my self code but I think I am not able to do so with the resources I have.

    Can you please help with the same.

    Thanks,
    Alark
  • Hello Alon,

    I have been trying connecting TCP Socket with the socket handle that returns after Socket Open command i.e. 0 in my case. I am giving the following data bunch through SPI but I dont know why it is not connecting it: -

    0x01 0x00 0x19 0x00 0x00 0x01 0x07 0x10 0x14 socket 0x00 0x00 0x00 0x08 0x00 0x00 0x00 0x08 0x00 0x00 0x00 0x02 0x00 0x00 0x50 ip4 ip3 ip2 ip1 0x00

    socket = 0

    ip4 = 207
    ip3 = 58
    ip2 = 139
    ip1 = 247

    this is the IP of www.adafruit.com ------------> 207.58.139.247

    I really don't know whats wrong and why TCPconnect is responding negatively.

    Regards,
    Alark