ArduinoOTA with Ethernet on BluePill

Hi Juraj, thank you for nice job. I tried your library and when I want to do update in ethernet example on my bluepill, Arduino shows no available port and if I reset It, it doesnt start anymore and I have to upload example again to start.

 #include <SPI.h>
#include <Ethernet.h>
#include <ArduinoOTA.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };

void setup() {
  //Initialize serial:
  Serial.begin(9600);
  while (!Serial);

  // start the Ethernet connection:
  Serial.println("Initialize Ethernet with DHCP:");
  if (Ethernet.begin(mac) == 0) {
    Serial.println("Failed to configure Ethernet using DHCP");
  } else {
    Serial.print("  DHCP assigned IP ");
    Serial.println(Ethernet.localIP());
  }

  // start the OTEthernet library with internal (flash) based storage
  ArduinoOTA.begin(Ethernet.localIP(), "Arduino", "password", InternalStorage);
}

void loop() {
  // check for updates
  ArduinoOTA.poll();

  // add your normal loop code below ...
} 

Can you help me, where could be the problem? Thank you...

the network port detection doesn't work on some computers/in some networks. try the 'fake programmer' method described in the README.
https://github.com/JAndrassy/ArduinoOTA#ota-upload-from-ide-without-network-port

1 Like

Thank you for your answer. Main problem is that, when I upload OTethernet example, Serial monitor show, that´s working, but when I reset board, it doesn´t run anymore. I have to upload sketch again. I use STM32CubeProgrammer (Serial) for uploading sketch to Bluepill. Could be there any problem?

I had powering problems with BluePill. do you power the Ethernet module from 3.3 V pin or from USB provided 5 V?

From USB 5V. Similar connection as on your photo above. I tried with another board and it looks, like ArduinoOTA.poll(); freezes the board.

the basic examples of the Ethernet library work?

Yes, everything works normally, until I add include your library & ArduinoOTA.poll(); After reset it freezes as soon as it get ArduinoOTA.poll(); command...

try to add

#define NO_OTA_PORT

before #include <ArduinoOTA.h>

and try to remove while (!Serial);

Thank you Juraj, problem was with boot pins on my side. I tried Webserver fw download and it works. Thank you for help. DĂ­ky moc!!!

1 Like

One last question. Is there any example of updating fw through webserver form? I saw one for ESP32, but its not suitable for stm. Thank you.

no, but there are examples for alternative bin transports in Advanced section of the examples. and the arduinoOTA upload uses http so in WiFiOTA.cpp in the library source code you can find a function which receives a http upload.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.