Applications compile and (looks to) load but never runs

Minimal app consisting of

#include <Arduino.h>
const int ledPin = 2;
int intSpeed;

// the setup() method runs once, when the sketch starts

void setup() {

  // initialize the digital pin as an output.
  pinMode(ledPin, OUTPUT);
  int intIn=50;
  intSpeed = int((float(intIn) / 100) * 255);
  Serial.begin(115200);
  Serial.println("Start");
}

// the loop() methor runs over and over again,
// as long as the board has power

void loop() {
        digitalWrite(ledPin, HIGH);   // set the LED on
        delay(50);
        digitalWrite(ledPin, LOW);   // set the LED on
        delay(50);
    for(int i=1;i<4;i++) {
        digitalWrite(ledPin, HIGH);   // set the LED on
        delay(220);                  // wait for a second
        digitalWrite(ledPin, LOW);    // set the LED off
        delay(i*1000);                  // wait for a second
    }
    Serial.println("loop");
}

Compiles fine, seems to load OK and when I press the reset button. I see the string of unprintable characters in the serial monitor but no output from the program. I have tried about 5 differetnt applications including a simple web server, the basic OTA program, my own lamp controller, etc. The web server doesn’t appear to be functional and none of the programs produce any usable output on the serial monitor. Here’s the platform.ini file

[env:esp01_1m]
platform = espressif8266
board = esp01_1m
framework = arduino
lib_extra_dirs = ~/Documents/Arduino/libraries

I’m missing something really basic, I think.
So I pulled the esp8266 and plugged in another 8266 that had been previously programmed with an HTTP server program.
While it appears to load the new program

Writing at 0x00024000... (76 %)
Writing at 0x00028000... (84 %)
Writing at 0x0002c000... (92 %)
Writing at 0x00030000... (100 %)
Wrote 296560 bytes (212314 compressed) at 0x00000000 in 18.7 seconds (effective 126.7 kbit/s)...
Hash of data verified.

Leaving...
Hard resetting via RTS pin...

======== [SUCCESS] Took 21.84 seconds ========

When I start the serial monitor and press the reset button on the chip, I get the garbage string followed by a “HTTP server started” message which tells me that the program that is running is what was there before.

I’d sure like help on this. This is the platformio.ini file for the other part:

[env:esp12e]
platform = espressif8266
board = esp12e
framework = arduino

The computer is running Mint 19, I downloaded the udev rules and restarted udev.

Thanks for any help,
Jim.

As a genreal info, you must match the monitor speed configuration of PlatformIO (which is passed to the miniterm.py serial monitor program) to what you are doing in your firmware. So if you do

the must be a

monitor_speed = 115200

(docs) in the platformio.ini. Otherwise the default baud of 9600 applies.

Also, try to avoid

in favor of explicit dependency declarataions. In this case your firmware doesn’t even depend on any other library, so it’s safer to leave it out, lest some unrelated library is somehow included and overlooked.

Looks to me like you may have uploaded the wrong project by not selecting your active project correctly. Same issue as in After update PlatformIO it looks like it does not read platformio.ini - #7 by maxgerhardt?

Monitor speed is 115200, or so it was reported as such. I killed projectio and brought up the monitor in the Arduino ide just to be sure and it behaves the same. I’ll discard all but one project and see if that makes a difference.