Jump to content

electrotwelve

Members
  • Content Count

    18
  • Joined

  • Last visited


Reputation Activity

  1. Like
    electrotwelve got a reaction from bluehash in Switching the CC3200 from AP to Station mode   
    OK I got this figured. The challenge was switching back to AP once STA mode was activated. This code switches back to AP from whatever earlier mode was set. 'ssid' and 'wifipw' is the SSID and password defined for the AP.
    extern "C" { #include "utility/udma_if.h" } void switchToAP() { UDMAInit(); sl_Start(NULL, NULL, NULL); sl_WlanDisconnect(); sl_NetAppMDNSUnRegisterService(0, 0); sl_WlanRxStatStart(); sl_WlanSetMode(ROLE_AP); sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SSID, strlen(ssid), (unsigned char *)ssid); unsigned char val = SL_SEC_TYPE_WPA; sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_SECURITY_TYPE, 1, (unsigned char *)&val); sl_WlanSet(SL_WLAN_CFG_AP_ID, WLAN_AP_OPT_PASSWORD, strlen(wifipw), (unsigned char *)wifipw); /* Restart Network processor */ sl_Stop(30); sl_Start(NULL, NULL, NULL); } To switch to the STA mode it was suggested in an earlier post to add WiFi._initialized = false; and WiFi._connecting = false; before doing a WiFi.being() but this was a hit and miss with my LP (rev 4.1). So this code switches it to STA mode. This is still not very reliable. Out of every 6 attempts to connect to a WiFi network, 1 attempt fails but here is the code anyway:
    void switchToSTA() { UDMAInit(); sl_Start(NULL, NULL, NULL); sl_WlanDisconnect(); sl_NetAppMDNSUnRegisterService(0, 0); sl_WlanRxStatStart(); sl_WlanSetMode(ROLE_STA); /* Restart Network processor */ sl_Stop(30); sl_Start(NULL, NULL, NULL); }
  2. Like
    electrotwelve got a reaction from adrianF in Using RESTful API to work with AWS IoT   
    Thanks folks. As it turns out I was using the wrong port. Its supposed to be 8443 instead of 443. With that in place, everything worked great! I also had to modify the PostData format to match what AWS needs it to be.
  3. Like
    electrotwelve reacted to SmokinGrunts in WiFi encryption type keeps showing zero   
    Correct, 
    uint8_t WiFiClass::encryptionType() and 
    uint8_t WiFiClass::encryptionType(uint8_t networkItem) Two functions, with the same name, but different parameters. This is called Function Overloading. 
     
    Your compiler determines the best fit for which function definition to process based on the types you give to said function.
     
    For more information, see here: http://www.tutorialspoint.com/cplusplus/cpp_overloading.htm
  4. Like
    electrotwelve reacted to SmokinGrunts in .bin file location in Energia   
    If you're ready to move beyond the Arduino-esque IDE that is Energia, but still want to make use of the easy-to-read Energia Libraries, I'd recommend setting up something like Code Composer Studio (really just Texas Instrument's re-branded version of Eclipse) and getting to know the GNU GCC toolchain. The latest version of CCS just came out, has Energia sketch/library support built in, and has a number of other great features.
     
    I haven't used the Energia IDE for some time, but I do attempt to maintain using the libraries. So, I can't give you the answer you're looking for, but if you do decide to make the switch, all output files for CCS are generated in your project's 'Debug' folder.
     
    There is a learning curve, but the experience is worth having under your belt if you are serious about programming.
  5. Like
    electrotwelve got a reaction from Fmilburn in WiFi encryption type keeps showing zero   
    Hi @@Fmilburn,
     
    I think I've got this working for now. There seem to be two variants for the encrytionType function and the default Energia example is calling the one which does not accept arguments:
    uint8_t WiFiClass::encryptionType() {     return 0; } I changed the return value to verify this and it is indeed this one that is being called. The other variant accepts an integer value as an argument presumably the SSID number. I borrowed code sections from the ScanNetworks example. I compared the string returned by WiFi.encryptionType with the defined SSID and when they matched I printed out the encryption type.  int numSsid = WiFi.scanNetworks(); if (numSsid == -1) {   Serial.println("Couldn't get a wifi connection");   while (true); } for (int thisNet = 0; thisNet < numSsid; thisNet++) {   if (strcmp(WiFi.SSID(thisNet),ssid) == 0) {     Serial.print("Encryption: ");     printEncryptionType(WiFi.encryptionType(thisNet));   } } The printEncryptionType function is the same one from ScanNetworks example.
  6. Like
    electrotwelve reacted to energia in APWatchConnectDisconnect does not work   
    You could try update the service pack with UniFlash.
     
    Howto is here: http://processors.wiki.ti.com/index.php/CC31xx_%26_CC32xx_SimpleLink_Tools#UniFlash
    And the service pack can be downloaded from here: http://www.ti.com/tool/cc3200sdk
×
×
  • Create New...