💬 FOTA (Wireless Programming)
-
I just enabled OTA on a non-sleeping node - it doesn't call smartSleep() and the loop function is mostly empty (except for sending one initial message). I do have a receive() function since I need to respond to incoming messages.
How can I properly enable OTA in this kind of node? Sending the "New firmware" command in MyController sends the message which gets caught by receive() and just gives me an error message since it's not one of the message types I expect. Telling the node to reboot sends it into some sort of endless loop which I cannot break unless I kill power to the board.
-
@maghac did you see this? https://forum.mysensors.org/topic/6769/node-reboot-issue/7
-
I am having problems flashing a new bootloader on a 5V 16Mhz Pro Mini board. Or rather. the flashing is fine, it's just that I cannot upload a new sketch via FTDI afterwards.
Here are my custom entries from boards.txt:
## Arduino Pro or Pro Mini (3V3 & 5V, 16 MHz) w/ ATmega328 MYSBootloader ## ------------------------------------------------- proMYSBL.name=ATmega328 16Mhz MYSBootloader 1.3 beta proMYSBL.upload.tool=avrdude proMYSBL.upload.protocol=arduino proMYSBL.upload.maximum_size=30720 proMYSBL.upload.maximum_data_size=2048 proMYSBL.upload.speed=115200 proMYSBL.bootloader.tool=avrdude proMYSBL.bootloader.low_fuses=0xF7 proMYSBL.bootloader.high_fuses=0xDA proMYSBL.bootloader.extended_fuses=0xfe proMYSBL.bootloader.unlock_bits=0x3F proMYSBL.bootloader.lock_bits=0x0F proMYSBL.bootloader.file=MySensors/MYSBootloader.hex proMYSBL.build.mcu=atmega328p proMYSBL.build.f_cpu=16000000L proMYSBL.build.board=AVR_UNO proMYSBL.build.core=arduino proMYSBL.build.variant=standard ## Arduino Pro or Pro Mini (3V3 & 5V, 16 MHz) w/ ATmega328 MYSBootloader ## ------------------------------------------------- proMYSBL16.name=ATmega328 16Mhz MYSBootloader 1.3 beta DEV proMYSBL16.upload.tool=avrdude proMYSBL16.upload.protocol=arduino proMYSBL16.upload.maximum_size=30720 proMYSBL16.upload.maximum_data_size=2048 proMYSBL16.upload.speed=57600 proMYSBL16.bootloader.tool=avrdude proMYSBL16.bootloader.low_fuses=0xF7 proMYSBL16.bootloader.high_fuses=0xDA proMYSBL16.bootloader.extended_fuses=0xFD proMYSBL16.bootloader.unlock_bits=0x3F proMYSBL16.bootloader.lock_bits=0x0F proMYSBL16.bootloader.file=MySensors/MYSBootloader_16MHz.hex proMYSBL16.build.mcu=atmega328p proMYSBL16.build.f_cpu=16000000L proMYSBL16.build.board=AVR_UNO proMYSBL16.build.core=arduino proMYSBL16.build.variant=standard ## Arduino Pro or Pro Mini (3V3 & 5V, 8 MHz) w/ ATmega328 MYSBootloader ## ------------------------------------------------- proMYSBL8.name=ATmega328 8Mhz MYSBootloader 1.3 beta DEV proMYSBL8.upload.tool=avrdude proMYSBL8.upload.protocol=arduino proMYSBL8.upload.maximum_size=30720 proMYSBL8.upload.maximum_data_size=2048 proMYSBL8.upload.speed=57600 proMYSBL8.bootloader.tool=avrdude proMYSBL8.bootloader.low_fuses=0xE2 proMYSBL8.bootloader.high_fuses=0xD2 proMYSBL8.bootloader.extended_fuses=0xFE proMYSBL8.bootloader.unlock_bits=0x3F proMYSBL8.bootloader.lock_bits=0x3F proMYSBL8.bootloader.file=MySensors/MYSBootloader_8MHz.hex proMYSBL8.build.mcu=atmega328p proMYSBL8.build.f_cpu=8000000L proMYSBL8.build.board=AVR_UNO proMYSBL8.build.core=arduino proMYSBL8.build.variant=standardMYSBootloader.hex is from the master branch of MYSBootloader 1.3.0-beta.3, the other two are from the development branch.
Doesn't matter which one I use, I can never get my 5V 16MHz boards to accept a new sketch via FTDI cable. I have to go back to the standard Pro Mini bootloader.
-
I am having problems flashing a new bootloader on a 5V 16Mhz Pro Mini board. Or rather. the flashing is fine, it's just that I cannot upload a new sketch via FTDI afterwards.
Here are my custom entries from boards.txt:
## Arduino Pro or Pro Mini (3V3 & 5V, 16 MHz) w/ ATmega328 MYSBootloader ## ------------------------------------------------- proMYSBL.name=ATmega328 16Mhz MYSBootloader 1.3 beta proMYSBL.upload.tool=avrdude proMYSBL.upload.protocol=arduino proMYSBL.upload.maximum_size=30720 proMYSBL.upload.maximum_data_size=2048 proMYSBL.upload.speed=115200 proMYSBL.bootloader.tool=avrdude proMYSBL.bootloader.low_fuses=0xF7 proMYSBL.bootloader.high_fuses=0xDA proMYSBL.bootloader.extended_fuses=0xfe proMYSBL.bootloader.unlock_bits=0x3F proMYSBL.bootloader.lock_bits=0x0F proMYSBL.bootloader.file=MySensors/MYSBootloader.hex proMYSBL.build.mcu=atmega328p proMYSBL.build.f_cpu=16000000L proMYSBL.build.board=AVR_UNO proMYSBL.build.core=arduino proMYSBL.build.variant=standard ## Arduino Pro or Pro Mini (3V3 & 5V, 16 MHz) w/ ATmega328 MYSBootloader ## ------------------------------------------------- proMYSBL16.name=ATmega328 16Mhz MYSBootloader 1.3 beta DEV proMYSBL16.upload.tool=avrdude proMYSBL16.upload.protocol=arduino proMYSBL16.upload.maximum_size=30720 proMYSBL16.upload.maximum_data_size=2048 proMYSBL16.upload.speed=57600 proMYSBL16.bootloader.tool=avrdude proMYSBL16.bootloader.low_fuses=0xF7 proMYSBL16.bootloader.high_fuses=0xDA proMYSBL16.bootloader.extended_fuses=0xFD proMYSBL16.bootloader.unlock_bits=0x3F proMYSBL16.bootloader.lock_bits=0x0F proMYSBL16.bootloader.file=MySensors/MYSBootloader_16MHz.hex proMYSBL16.build.mcu=atmega328p proMYSBL16.build.f_cpu=16000000L proMYSBL16.build.board=AVR_UNO proMYSBL16.build.core=arduino proMYSBL16.build.variant=standard ## Arduino Pro or Pro Mini (3V3 & 5V, 8 MHz) w/ ATmega328 MYSBootloader ## ------------------------------------------------- proMYSBL8.name=ATmega328 8Mhz MYSBootloader 1.3 beta DEV proMYSBL8.upload.tool=avrdude proMYSBL8.upload.protocol=arduino proMYSBL8.upload.maximum_size=30720 proMYSBL8.upload.maximum_data_size=2048 proMYSBL8.upload.speed=57600 proMYSBL8.bootloader.tool=avrdude proMYSBL8.bootloader.low_fuses=0xE2 proMYSBL8.bootloader.high_fuses=0xD2 proMYSBL8.bootloader.extended_fuses=0xFE proMYSBL8.bootloader.unlock_bits=0x3F proMYSBL8.bootloader.lock_bits=0x3F proMYSBL8.bootloader.file=MySensors/MYSBootloader_8MHz.hex proMYSBL8.build.mcu=atmega328p proMYSBL8.build.f_cpu=8000000L proMYSBL8.build.board=AVR_UNO proMYSBL8.build.core=arduino proMYSBL8.build.variant=standardMYSBootloader.hex is from the master branch of MYSBootloader 1.3.0-beta.3, the other two are from the development branch.
Doesn't matter which one I use, I can never get my 5V 16MHz boards to accept a new sketch via FTDI cable. I have to go back to the standard Pro Mini bootloader.
-
@gohan Good question :)
I was afraid it would get stuck in a neverending loop and I would have to cycle power to the board, but actually OTA programming with mycontroller works fine.
The problem is that OTA uploades takes around 10 mins, which is annoying if I want to test something while I have the node on my desk, before placing it somewhere in my house. So while I anyway have it on the desk, I'd like to use the FTDI cable.
Anyway, things seem to work fine now :)
-
Is it possible to do FOTA from my raspberry pi (serial gateway + domoticz)?
As it is now I move the gateway from the rpi to a windows pc running MYSController. It would be nice to avoid this step.
@arraWX you can create a Ethernet gateway in raspberry pi and connect MYScontroller to you raspberry pi gateway.
See instructions to create raspberrypi ethernet gateway on https://www.mysensors.org/build/raspberry
From there you can perform FOTA in MYScontroller. -
@arraWX you can create a Ethernet gateway in raspberry pi and connect MYScontroller to you raspberry pi gateway.
See instructions to create raspberrypi ethernet gateway on https://www.mysensors.org/build/raspberry
From there you can perform FOTA in MYScontroller.@Viciousman Thank you!
How do I create a Ethernet gateway?
Will I have to build this: https://www.mysensors.org/build/ethernet_gateway
or
Will I have to do some kind of configuration on the rpi and continue using my serial gateway?
-
@Viciousman Thank you!
How do I create a Ethernet gateway?
Will I have to build this: https://www.mysensors.org/build/ethernet_gateway
or
Will I have to do some kind of configuration on the rpi and continue using my serial gateway?
@arraWX I find more simple to simply connect nrf24 to raspberry pi as instructed in https://www.mysensors.org/build/raspberry
But you can also build the Ethernet gateway with W5100. -
Dear all!
I have an mysensors ethernet gateway and nodes with nrf24 . I have an openhab2 controller. Could i use the above solution to program my nodes over the air through my current gateway? So i write my sketch on windows arduino and send it through my gateway to the node? Or i have to connect my computer direct to nodes over air?
-
You can use myscontroller to connect to the ethernet gateway and assign the firmware to upload for each node
-
You can use myscontroller to connect to the ethernet gateway and assign the firmware to upload for each node
-
Myscontroller works only as ethernet. Mycontroller should also work with mqtt gateway but I'm not sure about serial.
@gohan Ook! Are you talking about installing MysController on Raspberrypi (I think not)? If you are going to run it on Windows and connect to Raspi Ethernet gateway remotely then using the the same option we can remotely connect to a serially connected gateway on Raspberrypi (using a USB port) from MysController running on Windows.
Are there steps somewhere to install MysController on Raspi [some Windows pre-installer running on Debian Linux]? I remember reading some Mysensors posts here a couple of years back(!!!), but cant seem to locate it now...
-
@scalz do you have any specific reason why you use avrdudes to burn the fuses and burn bootloader separately, instead of using some board definitions matching the bootloader and using the burn bootloader method for Arduino interface ? I think that method is far more user intuitive for the average MySensors user ?
-
Using FOTA in myscontroller works only occasionally for me. Sometimes it works fine. But most often I get the following messages and nothing more happens.

The node is a sensebender micro. Gateway is rpi ethernet.
Has anyone experienced something similar? Anyone knows how to solve the problem?
EDIT: Problem solved. Reading this post I now understand that in order to get new fw into the node one has to update the sketch, refresh the repo in MysController and assign it the node.