@jkandasa this is what i do :
-
I loaded the
ArduinoISP
sketch on an Arduino PRO mini to use as a programmer.
-
then I configured Arduino IDE with the SensBender 8MHz board like this:
and I started the bootloader burning which went well. -
I unplugged the ProMini and plugged in an FTDI converter to program the ATMega 328P by configuring like this:
I injected this simple BLINK LED sketch :
// Enable debug prints to serial monitor
//#define MY_DEBUG //debug de MySensors
//#define MY_DEBUG_VERBOSE_SIGNING //debug de la signature
//===== RFM config =====
#define MY_RADIO_RFM69
#define MY_IS_RFM69HW //with H(CW)
#define MY_RFM69_NEW_DRIVER
#define MY_RFM69_FREQUENCY RFM69_868MHZ
#define MY_SIGNAL_REPORT_ENABLED
//#define MY_RFM69_ATC_TARGET_RSSI_DBM (-80)
//#define MY_RFM69_MAX_POWER_LEVEL_DBM (10) // max. TX power 10dBm = 10mW
//1mW = 0dBm 10mW = 10dBm 25mW = 14dBm 100mW = 20dBm
//#define MY_DEBUG_VERBOSE_RFM69 //debug du signal RF
//#define MY_RFM69_NETWORKID 101
#define MY_RFM69_IRQ_PIN 2
#define MY_RFM69_CS_PIN 10
//===== LED =====
#define LED_BUILTIN 9 //pb1 pin15
//========== NODE ID ==========
#define MY_NODE_ID 4
//#define MY_NODE_TYPE "NODE"
//#define CHILD_ID 1 // Id of the sensor child
#include <SPI.h>
#include <MySensors.h>
#include <Wire.h>
//pr1:===== FOTA =====
#define MY_OTA_FIRMWARE_FEATURE
#define MY_OTA_FLASH_SS (8)
#define MY_OTA_FLASH_JDECID (0xBF26) //Use (0x00) if unknown.
//pr2: ===== tempo non bloquante =====
const unsigned long BLINK_INTERVAL = 1000;// Nombre de millisecondes entre deux changements d'état de la LED
unsigned long previousMillis = 0;// Précédente valeur de millis()
byte ledState = LOW;// Précédent état de la LED
//===================================
//= BEFORE =
//===================================
void before()
{
} //FIN de before
//===================================
//= SETUP =
//===================================
void setup() {//pas besoin de Serial.begin(115200)
pinMode(LED_BUILTIN, OUTPUT);// Configure la broche de la LED en sortie
digitalWrite(LED_BUILTIN, ledState); // Configure l'état initial de la LED
}//FIN du SETUP
//==========================================
//= PRESENTATION =
//==========================================
void presentation() {
// Send the sketch version information to the gateway and controller
sendSketchInfo("led fota", "1.0");
} // FIN de PRESENTATION
//===================================
//= LOOP =
//===================================
void loop() {
unsigned long currentMillis = millis(); // Récupére la valeur actuelle de millis()
if (currentMillis - previousMillis >= BLINK_INTERVAL) // Si BLINK_INTERVAL ou plus millisecondes se sont écoulés
{ previousMillis = currentMillis; // Garde en mémoire la valeur actuelle de millis()
ledState = !ledState; // Inverse l'état de la LED
digitalWrite(LED_BUILTIN, ledState); Serial.print("LED "); Serial.println(ledState);
}
}// FIN de LOOP
-
the led is flashing well and MYController sees the node
-
I change the flashing delay from 1000 to 500 and the version which goes from 1.0 to 1.1. I compile the sketch which gives me:
moteino_MySensors_fota_pr1.ino.hex
-
I go to
Utilities>>Firmware
and add a Type, Version 1.1 and Firmware (with faster flashing delay)
-
I go back to
Resources>>nodes
and upload the firmware of this node n°4
-
and ...nothing after 7 minutes
Any Idea ? My Sketch is wrong ?