Frustration in getting started

Can you paste your full code here

Which LED are you referring to? Is your code trying to blink the led on D7 ?
I assume you are initally testing with simple code, like blink led on D7.

Here you are:

//SYSTEM_MODE(MANUAL);

int flag = 0;

unsigned long tLapse = 0;
unsigned long tLapse2 = 0;
unsigned long tLapse3 = 0;

IPAddress myremoteAddr2(192, 168, 43, 95);
int myremotePortNumber2 = 9000;


unsigned int localPort = 8000;

unsigned int loopy = 0;
unsigned int loopy2 = 0;
unsigned int cnt = 10;

UDP myUDP;

char outbuffer[7] = "hello";
char outbuffer2[6] = "panic";

 #define inbufsize   50

char inbuffer[inbufsize];

unsigned int ptrRead = 0;
unsigned int ptrWrite = 0;

volatile unsigned int inputCount = 0;

void setup() {
    
    myUDP.begin(localPort);
    
    pinMode(D7, OUTPUT);
    Serial1.begin(9600);
    
     tLapse = millis();
     tLapse2 = millis();
     tLapse3 = millis();
     
     Serial.begin(9600);

}

void loop() {

 //digitalWrite(D7, HIGH);
 //delay(5000);
// digitalWrite(D7, LOW);
// delay(5000);
    if (millis() - tLapse3 >= 6000)
    {
        tLapse3 = millis();
      // IPAddress myremoteAddr2 = myUDP.remoteIP();
       //int myremotePortNumber2 = 9000;
        
        //send
       myUDP.beginPacket(myremoteAddr2, myremotePortNumber2);
        
        
        for (loopy2 = 0; loopy2 < 6; loopy2++)
        {
            myUDP.write(outbuffer2[loopy2]);
        }
       // myUDP.write(outbuffer, 7);
        myUDP.endPacket();        
    }


    if (myUDP.parsePacket() > 0)
    {
        while (myUDP.read())
        {
            inbuffer[ptrWrite] = myUDP.read();
            
            ++inputCount;
            
            if (++ptrWrite >= inbufsize)
            {
                ptrWrite = 0;
            }
        }
        
       IPAddress myremoteAddr = myUDP.remoteIP();
       int myremotePortNumber = myUDP.remotePort();
        
        //send
       myUDP.beginPacket(myremoteAddr, myremotePortNumber);
        myUDP.write(inbuffer[ptrRead]);
        
        for (loopy = 0; loopy < 7; loopy++)
        {
            myUDP.write(outbuffer[loopy]);
        }
       // myUDP.write(outbuffer, 7);
        myUDP.endPacket();
    }

    if (millis() - tLapse2 >= 10000)
    {
        tLapse2 = millis();
        
        Serial1.println(WiFi.localIP());
    }
    
    if ((inputCount > 0) && (ptrRead != ptrWrite))
    {
        if (inbuffer[ptrRead] == 'N')
        {
            digitalWrite(D7, HIGH);
            --inputCount;
            
            if (++ptrRead >= inbufsize)
            {
                ptrRead = 0;
            }
        }
        else if (inbuffer[ptrRead] == 'F')
        {
            digitalWrite(D7, LOW);
            --inputCount;
            
            if (++ptrRead >= inbufsize)
            {
                ptrRead = 0;
            }
        }
        else
        {
            --inputCount;
            
            if (++ptrRead >= inbufsize)
            {
                ptrRead = 0;
            }
        }
    }    

 
 if (millis() - tLapse >= 3000)
 {
     if (cnt > 0)
     {
        tLapse = millis();
        --cnt;
        if (flag == 0)
        {
            flag = 1;
            digitalWrite(D7, HIGH);
            Serial1.println("HIGH");
         
        }
        else
        {
            flag = 0;
            digitalWrite(D7, LOW);
            Serial1.println("LOW");         
        }         
     }
 }
 
 
  if (Serial1.available())
  {
    int inByte = Serial1.read();
    Serial1.write(inByte);
    
    if (flag == 0)
    {
        flag = 1;
        digitalWrite(D7, HIGH);
        Serial1.println("HIGH");
    }
    else
    {
        flag = 0;
        digitalWrite(D7, LOW);
        Serial1.println("LOW");
    }
  }
  
  if (Serial.available())
  {
    int inByte2 = Serial.read();
    Serial.write(inByte2);
    
    if (flag == 0)
    {
        flag = 1;
        digitalWrite(D7, HIGH);
        Serial.println("HIGH");
    }
    else
    {
        flag = 0;
        digitalWrite(D7, LOW);
        Serial.println("LOW");
    } 
  }
}

I need to add something :smile:

The #define DOES NOT DISPLAY CORRECTLY in THIS FORUM.

  1. This is my test code for udp and uart and blink led (D7) which is in default system mode (Auto)

  2. It is loaded to CORE by the web IDE but, not running. The led is not blinking

  3. My wifi router shows that the CORE is attached to it

Let me know if you need more info. Today is my 7th day working on the core. Thanks Kenneth !

@sam_desd, I fixed the formatting on your post. So the Core works fine with tinker running on it but not with your own UDP app, correct?

Hi Peekay,

Sorryā€¦ are you asking me or you are telling me?

@sam_desd, telling you I fixed your post and asking if tinker work but not your app. If it is your app, then we should close this topic and start another since the title is not right.

To backstep, try the simple basic program ( blink the led on pin D7). One step at a time when getting started.
Let us know if that works. Thanks for your patience.

void loop() {

//digitalWrite(D7, HIGH);
//delay(5000);
// digitalWrite(D7, LOW);
// delay(5000);

just curious, if you wanted to see the led on D7 blink, why did you comment out these lines?

Thank you peekayā€¦ It is rather a long story ā€¦ I encounter problems upon anotherā€¦ so I make this special case where ones can take benefits as I go along to correct the various issues crops up during my journey!

Pls read from top till now.

Hi Jack,

Pls read the entire test code

Sorry Sam, I donā€™t have time for that if you donā€™t have time to answer a few questions. Good luck tho.

@sam_desd, I believe your ā€œgetting startedā€ journey is over. Now you are into the getting it working with UDP journey and this is why I suggest changing to a new topic.

1 Like

Now I am having my CORE flashing GREEN, then RED then BLUE ā€¦ again and againā€¦ that is upon reloading the firmware.

Hi Peekay, you think that I am simply maintaining this topic? I asked you to read the entire 7 days experienced that I went thru with 2 units of the CORE. Now you tell me whether my apps create this looping/reset condition OR it is something within the CORE itself?

Prior to telling me to close and move to making UDP topicā€¦ I am bringing you something to answer me. Prove me that my code creates the auto reset until I keep getting the states of LED above!

Till then only I will move to the new topic

@sam_desd, do a factory reset and reconnect the core to your network. This is the ā€œbaselineā€ for getting started. If that works, I propose we move to a different topic. If not, the adventure continues, ok?

Will do

1 Like

It is quite possible that the problem is not the core, but the code.
If you can run the basic ā€œblink led on pin D7ā€ then the core is ok. Can you run that basic code?

Hi Peekay, twice trial. The CORE now blinking blue. D7 LED not running as per in my code. Prior to factory reset I managed to get letter ā€˜pā€™ (1st letter of panic) fired to my laptop appsā€¦ now I got nothing at all. Silence like a LAMB except that blue blinking CORE!

Maybe tomorrow I will send email to Particleā€¦ see what they will advise. I am now mad professor of these 2 COREs

@sam_desd, I just need you to do a factory reset so that factory Tinker can run, NOT your code. I really need you to test the Core WITHOUT your code first. Perhaps after the factory reset and as @Jack suggested, you can run the blink LED app from the web IDE.

1 Like

Now I used back the SPARK apps in the Android to detect the CORE after the factory reset.

Then after, I used the web IDE to re flash my apps into the COREā€¦ yes, the CORE blink magenta

Againā€¦ the CORE endlessly blinking GREEN, then RED then BLUE !

So to say, I will email Particle tomorrow.

TQ