You can chat about native SDK questions and issues here.

User avatar
By Agentsmithers
#85603 Hi Everyone!
I've been on 2.1.0 for quite sometime and decided to take the leap to 3.0.0. After I did I started experiencing intermittent connection issues with my Wifi. Then also creating a snapshot I moved back to 2.1.0 and everything works great again. I also tested 3.0.1 and 3.0.2 and all yield the same issue and rolling back to 2.1.0 everything works. Does this having something to do with the new RF_CAL param added in userland or something else I may be missing from my upgrade? Any help would be amazing as I am currently stuck in the water right now with this specific issue.

As you can see in the first picture that is of my NONOS SDK 2.1.0. In the 2nd is the same exact code running on 2.2.0 and I get the same results and error each time unless I revert back to 2.1.0. It almost seems like when I do my Station_Init something in the new SDK or maybe the way I MAKE the sdk is jacking up the Radio. It seems at runtime the radio gets stuck in an off position or something I am not seeing but the 2.1.0 you see it kick off with "mode: 0 -> 3" and yet you never see that happen in the new versions. It seems like something in the SDK changed the behavior of connecting via Wifi? Futhermore, When I do a custom scan I can see one accesspoint that is on channel 9 but not my default "HHN" network that is on channel 6.

To add, This may be an issue on how I am upgrading my SDK. I use PFalcon's toolchain and modify the make file to include the other sdk's then run the following.

make clean-sdk clean-sysroot all
Once completed I have to run a few post commands to fix a few things to get my SDK to run.

Fix1: Copy all the ld files located in esp-open-sdk/ESP8266_NONO_SDK-{VER} -> esp-open-sdk/xtensa-lx106-elf/sysroot/usr/lib. I then have to go into the files and update the include locations within the files to correct this.
/* get ROM code address */
INCLUDE "../ld/eagle.rom.addr.v6.ld" -> INCLUDE "/eagle.rom.addr.v6.ld"

Fix2:[osboxes@osboxes i2c]$ make fresh
xtensa-lx106-elf-gcc -Teagle.app.v6.ld main.o -nostdlib -Wl,--start-group -lmain -lpwm -lnet80211 -lwpa -llwip -lpp -lphy -lc -Wl,--end-group -lgcc -o main
/home/osboxes/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: main section `.text' will not fit in region `iram1_0_seg'
/home/osboxes/esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5/../../../../xtensa-lx106-elf/bin/ld: region `iram1_0_seg' overflowed by 956 bytes
collect2: error: ld returned 1 exit status
make: *** [main] Error 1


To fix this I then have to copy the libgcc.a to and from the location below
esp-open-sdk/ESP8266_NONO_SDK-{VER}/lib/ -> esp-open-sdk/xtensa-lx106-elf/lib/gcc/xtensa-lx106-elf/4.8.5

Any pointers would be super helpful if you find anything I may be doing here may be breaking my functionality.
You do not have the required permissions to view the files attached to this post.
Last edited by Agentsmithers on Thu Feb 13, 2020 12:17 pm, edited 4 times in total.
User avatar
By Agentsmithers
#85650
davydnorris wrote:Can you describe what you're seeing in more detail?


Hi Davyd!
Thank you for the quick response! I am trying to add as much detailed information as I can above in my Edit.
User avatar
By Agentsmithers
#85706 Hi everyone!! I am up to 3.0.2 and working!! This is just a theory but a decent one as it seems I may be moving again!

I think I may have figured it out.. It appears in SDK 2.2.0 from 2.2.1 seems to have added an RSSI threshhold to the Station_Config
strcuture and I think that was filtering out my SSID's during its scan, During normal operation I read back a flash structure and populate
the strucure with Data but maybe theres Junk data that lives inside that structure when I try to use it in the NEW sdk and thus filters out my
AccessPoint.. maybe due to invalid values in that structure member or that it is indeed valid but my SSID doesn't mean the RSSI burden of whatever the Junkdata was inside.

My sample code of what may have been getting effected by this new change in 2.2.0
Code: Select all#include "esp_sdk_ver.h"
struct station_config stationConfig;
   SpiFlashOpResult ReadResult = spi_flash_read(WifiMemorySpace,(uint32 *)&FlashStationConf,sizeof(FlashStationConf));
   if (ReadResult == SPI_FLASH_RESULT_OK)
   {
      os_printf("[%s][%s][%d] - WifiMemorySpace@0x%x read SUCCESS %s - %s - %d\r\n", __FILE__ ,__func__, __LINE__, WifiMemorySpace, FlashStationConf.ssid, FlashStationConf.password, FlashStationConf.programmed);
   }
   else if(ReadResult == SPI_FLASH_RESULT_ERR)
   {
      os_printf("[%s][%s][%d] - SPI_FLASH_RESULT_ERR", __FILE__ ,__func__, __LINE__);
   }
   else if(ReadResult == SPI_FLASH_RESULT_TIMEOUT)
   {
      os_printf("[%s][%s][%d] - SPI_FLASH_RESULT_TIMEOUT", __FILE__ ,__func__, __LINE__);
   }
   
   FlashStationConf.ssid[31]=0; //Sets null terminators
   FlashStationConf.password[63]=0; //Sets null terminiators
   if(FlashStationConf.programmed==1)
   {
      #if ESP_SDK_VERSION >= 020200
         os_printf("[%s][%s][%d] - Saved WifiStation Information Found > 2.2.0!!\r\n\tssid: \"%s\"\n\tpw: \"%s\"\r\n)", __FILE__ ,__func__, __LINE__, FlashStationConf.ssid, FlashStationConf.password);
         stationConfig.threshold.authmode = AUTH_WPA_WPA2_PSK; //This is requied or it will not connect to any AP
         stationConfig.threshold.rssi = 84;
      #else
         os_printf("[%s][%s][%d] - Saved WifiStation Information Found!!\r\n\tssid: \"%s\"\n\tpw: \"%s\"\r\n", __FILE__ ,__func__, __LINE__, FlashStationConf.ssid, FlashStationConf.password);
         //os_printf("Curent Config (Station - %s, Password - %s)\n\r", current_config.ssid, current_config.password);
      #endif
      
      //os_printf("SizeOf(FlashStationConf) = %d\r\n", sizeof(FlashStationConf))
      stationConfig.bssid_set = 0;
      //stationConfig.channel = 0; //no such thing, use wifi_set_channel()
      os_memcpy(&stationConfig.ssid, FlashStationConf.ssid, 32);
      os_memcpy(&stationConfig.password, FlashStationConf.password, 64);
      //This was added recently for faster connections, not sure if this is a good thing yet
      //os_memcpy(&stationConfig.Channel, FlashStationConf.channel, 1);
      //os_memcpy(&stationConfig.ssid_hidden, FlashStationConf.ssid_hidden, 1);
      //os_memcpy(&stationConfig.max_connection, FlashStationConf.max_connection, 1);
      //os_memcpy(&stationConfig.beacon_interval, FlashStationConf.beacon_interval, 2);
      //wifi_station_set_config(&stationConfig);
      wifi_station_set_config_current(&stationConfig);

      if (wifi_station_connect())
      {
         os_printf("[%s][%s][%d] - Attempting to connect to station, starting IP Timer\r\n", __FILE__ ,__func__, __LINE__);
         os_timer_disarm(&network_check_ip_timer); //Timer must be disarmed or may cause a crash. This timer may have been used before being used again
         os_timer_setfn(&network_check_ip_timer, (os_timer_func_t *)network_check_ip, NULL);
         os_timer_arm(&network_check_ip_timer, 10000, 0);
         /*if (myConnectToStronestWifiCallback != NULL)
         {
            myConnectToStronestWifiCallback(); //Need to check if a ValidIP is ready before doing this.
         }
         */
      }
      else
      {
         os_printf("[%s][%s][%d] - Station failed to connect to an open wifi\r\n", __FILE__ ,__func__, __LINE__);
      }