Wifi serial status messages disappeared

I’m using my Particle Photon to connect to WLAN for some time.
I am using the Particle CLI to watch the Serial Monitor. I always got the [hal.wlan] messages to control what’s happening with the WLAN connection. Since some days they randomly disappeared and i can’t get them back.

Some days before i randomly got new [system] log massages, which never appeared before.
I didnt change the code or something else so im curious how this happened. Maybe the Software changed…

Meanwhile i also noticed that the setup function gets executed before WLAN/Cloud connection is ready, i think thats also new behaviour. Since i should be in SYSTEM_MODE(AUTOMATIC), i think this is a wrong behaviour of the software.

Searched for solutions for some time, couldn’t find anything. Enabling the SerialLogHandler logHandler(LOG_LEVEL_ALL) got me some more Logs, but still not the WLAN logs i want.

Can someone help me to get the [hal.wlan] logs back?

Here’s my code:

/* Includes ------------------------------------------------------------------*/
#include <NCD_Ethernet_Overlay.h> //Kommunikation per Ethernet-Shield
#include <Ethernet.h> //Kommunikation per Ethernet-Shield
#include <EthernetClient.h> //Kommunikation per Ethernet-Shield
#include <EthernetServer.h> //Kommunikation per Ethernet-Shield
#include <L3D.h> //Nutzung der LEDs

//SYSTEM_MODE(AUTOMATIC);

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
int serverPort = 5000; 
EthernetServer server(serverPort);
SerialLogHandler logHandler;
//SerialLogHandler logHandler(LOG_LEVEL_ALL);
unsigned char buf2[256];
unsigned char buf[256];
int bytesRead = 0;
Cube cube = Cube();

/* This function is called once at start up ----------------------------------*/
void setup()
{
	// Wait for a USB serial connection for up to 30 seconds
	waitFor(Serial.isConnected, 30000);
    delay(1000);
    Log.info("Serial connection recognized");
	
	// start the Ethernet connection and obtain an IP from the network DHCP server:
	Log.info("Trying to configure Ethernet using DHCP");
	for(;;){
    	if (Ethernet.begin(mac) == 0) {
    		Log.info("Failed to configure Ethernet using DHCP");
    	}
    	else {Log.info("Success to configure Ethernet using DHCP");break;}
	}
	
    server.begin(); //Start the server
	String localIP = Ethernet.localIP(); // print your local IP address:
	Log.info("Server now listening on port %i at IP: %s", serverPort, localIP.c_str());
	
	cube.begin();
}

void loop()
{
  EthernetClient client = server.available();
  if(client){
    Log.info("Client connected");
    while(client.connected()){
      //Check for data from client
      if(client.available() > 0){
        bytesRead = client.read(buf, 256);
        TCP_function(buf, bytesRead);
        std::copy(std::begin(buf2), std::end(buf2), std::begin(buf));
        Particle.process();
       }
       delay(20);
    }
    Log.info("Client disconnected");
  }
  delay(20);
}

int TCP_function(unsigned char* buf, int bytesRead){
    Log.info("Anzahl gelesene Bytes=%d", bytesRead);
    Log.info("Bytes=\"%s\"",buf);
    server.write(buf, bytesRead); // echo all available bytes back to the client
    return 1;
}

Could it be that you are targeting Default (x.y.z) device OS version?
This would explain the change in logging behaviour as some application update may automatically got targeted at the most recent official release (currently 2.0.0) in which changes of default logging output may have been cut back.

If you want your device to stick with a specific device OS version you should select that particular version as target - not Default (x.y.z) as this will be pushed forward automatically with the next release.

1 Like

Thanks for your help.
I never really worked with the software-versions till now.
Downgrading to 1.5.2 actually solved my problem with the missing [hal.wlan] status messages.
Anyway, it would be nice to get them also in the newer OS-SW versions. Does anyone know how to activate them?

0000011850 [hal.wlan] ERROR: wiced_join_ap_specific(), result: 1024
0000011860 [hal.wlan] INFO: Joining MDCC_K123456789
0000014934 [hal.wlan] INFO: Bringing WiFi interface up with DHCP