πŸ’¬ FOTA (Wireless Programming)


  • Admin

    This thread contains comments for the article "FOTA (Wireless Programming)" posted on MySensors.org.



  • Is it possible to flash bootloader to a pro mini with the radio attached?
    I want OTA but have some nodes with not-so-easy-to-remove radios πŸ˜ƒ


  • Hardware Contributor

    yes this is possible.



  • Can i even have it powered during the process?


  • Hardware Contributor

    that should work depending of the different voltage source. if your mini pro is 3v and also your programming tool, this is ok (but not the best advice πŸ˜‰ ). or keep your batt, and don't connect vcc from your programming tool. It's always better to use only one source if you're not sure and, also not sure if there are all protection .



  • Sorry for asking stupid questions but, "USBtinyISP AVR ISP Programmer" from the shopping guide. Is this able to do the same as "usbasp (clone, USBASP 2.0 LC Technology)" in this guide.


  • Hardware Contributor

    yes this should work



  • For some reason I can't set the extended fuse to 0x06, it always reverts to 0xFE;

    avrdude.exe: verifying ...
    avrdude.exe: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
    This behaviour is deprecated and will result in an error in future version
    You probably want to use 0xfe instead of 0x06 (double check with your datasheet first).
    avrdude.exe: 1 bytes of efuse verified

    Anyone knows why?


  • Hardware Contributor

    @cdr
    The Extended fuse handle the bod level. Only the 3 least significant bits are meaningful. Others are not used.
    Be careful: This is true for this fuse, not for all fuses, check datasheet or fuses calculator!
    That's why :

    • 0x06 = 00000110
    • 0xFE = 11111110

    are doing the same job for the extended fuse. It depends of the tool you use for burning this fuse. Simply, if you get this warning, use the "equivalent".



  • Thanks for the explanation, first try didn't work so I suspected the fuses, but turned out to be a voltage issue. πŸ™‚



  • Is it possible to do OTA over RS485 connections?


  • Admin

    Yes, it should be possible. The node doesn't really care which transport that was used.



  • Does OTA work with the NRF24L01+ modules?

    Thanks.


  • Mod

    @skywatch yes.



  • @mfalkvidd

    Thanks for the (very) fast reply!

    I have arduino in my greenhouse and in winter when it can be constantly wet and cold it is a real pain to take the laptop out to make any changes. This would be a good solution that would allow me and my laptop to stay warm and dry! - - - But how do I stop any one else programming it remotely? Is there some security to stop random programs being installed (it is controlling mains electricity and I need to be sure it is a safe option.


  • Admin

    @skywatch

    You can use signing to authenticate a firmware upload. Then the attacker first need to get your pre shared keys to reprogram via ota



  • @skywatch just to be complete: using signing as @tbowmo suggested only works with dualoptiboot bootloader.
    When using MYSBootloader it will, as far as I know, accept any firmware when booting. To attack the node the attacker would have to reboot your node (power cycle,...) and then send his own firmware. So this is possible, but needs quite a good amount of control of your systems.


  • Admin

    @Anduril

    @tekka have been looking at making a secure Ota boot loader, if I remember right. I thought that it was released already.

    But if an intruder is able to get yo your node to do a reset in order to have the mysbootloader kick in, he could just as well put a new firmware in by attaching a programmer directly to the node.



  • Is it possible OTA from linux without MYSController?



  • Thank you all for the responses. If someone gets physical access then the game is over anyway. I just want to protect from some bored malicious person getting remote access and causing problems or even a fire.
    If it is secure from 'others' hacking it remotely I might give it a try.



  • When initiating a ota firmware update MYSController sends a reboot message to the node. Does anyone knows if that is protected by signing (if enabled)? If so, it would be quite safe excluding the physical access.



  • Same question as @b0rmann - is it possible to do OTA from a non-Windows environment (Mac OSX or Linux)? A simple implementation in python or perl, that could talk to the gateway, and do OTA from the command line, would be a really nice to have. I would prefer the dualoptiboot solution, since it'll work with RFM69 nodes as well (at least that's my understanding)


  • Hardware Contributor

    It may be a silly question, but what is the point of setting the fuses before burning the bootloader (using Dualoptiboot)?

    After burning the bootloader fuses are changed to E:06, H:D2, L:E2 anyway as set in board.txt

    MysensorsMicro.bootloader.unlock_bits=0x3F
    MysensorsMicro.bootloader.lock_bits=0x0F
    MysensorsMicro.bootloader.low_fuses=0xE2
    MysensorsMicro.bootloader.high_fuses=0xD2
    MysensorsMicro.bootloader.extended_fuses=0x06
    

    Should we burn them after to revert to E:06, H:DA, L:E2 ? (and loosing EESAVE which seems bad)


  • Hardware Contributor

    hello all,

    i have installed MYSBootloaderV13pre on my arduino mini pro 3.3V and this work fine.

    But i encountered some issues with my jeedom version (the node.js crash) that why i want to replace this bootloader (temporarily) but i can't.

    Do you know why when i burn a different bootloader, MYSBootloaderV13pre is still present ?

    Thx in advance for your answers



  • This might be a stupid question but would it be possible to add a AT25DF512C-SSHN-B to a regular Pro mini by connecting it to a custom PCB like a jModule with a AT25DF512C-SSHN-B ?


  • Hardware Contributor

    i don't see any problem if you connect correctly the spi bus. it depends what's a jmodule??
    in case i did this, perhaps smaller..
    https://www.openhardware.io/view/18/OTA-and-Authentication-Evaluation-Board



  • There is an ambiguity in documetation of MYSBootloader:

    1. On https://www.mysensors.org/download/sensor_api_20#configuration there is a Note: "You can still have OTA FW updates without external flash but it requires the MYSBootloader and disabled MY_OTA_FIRMWARE_FEATURE"
    2. Above on https://www.mysensors.org/about/ota#enabling-ota-in-your-sketch there is written: "To enable OTA in your sketch, you need to add #define MY_OTA_FIRMWARE_FEATURE"
      So, in the case of MYSBootloader (no external flash), what is correct (I suppose 2)?

    Two additional questions:
    Where is located MYSBootloader for MySensors 2.0?
    Is it usable with 8MHz internal clock config?

    Thanks for answer(s)


  • Hardware Contributor

    @tlustoch You need to enable MY_OTA_FIRMWARE_FEATURE only if you use DualOptiBoot.
    With MYSBootloader, you don't need πŸ˜‰

    I use MYSBootloader 1.3 pre-release with mysensors 2.0. You can find it here : https://forum.mysensors.org/topic/3453/mysbootloader-1-3-pre-release-myscontroller-1-0-0beta

    And yes it usable with 8 MHZ internal clock config if you burn the bootloader with 8Mhz internal clock setting.


  • Hardware Contributor

    Short question from me: my mysensors network is set up with domoticz as a controller on a raspberry pi. I need to upgrade all my nodes to Version 2 of mysensors soon and want to enable wireless programming while I am at it. As far as I understand I do need to use MYSController to update a node, which seems to be a windows only program. Any way I can still use that with my linux based (raspi) network?


  • Hardware Contributor

    For OTA Update under Rpi i used this: http://www.virtualhere.com/

    • just install it on the Pi, stop the controler software
    wget http://www.virtualhere.com/sites/default/files/usbserver/vhusbdarmpi2
    

    vhusbdarmpi2 -> for Pi2 only (see homepage for other platforms)

    sudo chmod +x ./vhusbdarmpi2
    
    • start the virtualhere server
    sudo ./vhusbdarmpi2
    
    • install the client on your Windows System
    • Mount the Com-Port
    • start MYSControler
    • do what you want to do
    • stop client

    now you have to reboot your rpi, stop virtualhere server its not enoth, cant mount device again. After restart everythinks works well.

    Greetings



  • I can't figure out this step:
    Go to Arduino Ide, in Board Manager, choose SensebenderMicro if you want to use DualOptiboot bootloader OTA. Or choose Arduino Mini pro MYSBootloader
    I cant find any sensbender board when searching the boards manager, I also tried downloading the 2.0 directly but cant find any boards there either. How should I do this?


  • Admin



  • Thanks, but now I get this error in Arduino IDE when burning the bootloader:

    avrdude: warning: cannot set sck period. please check for usbasp firmware update.
    avrdude: warning: cannot set sck period. please check for usbasp firmware update.
    ***failed;
    avrdude: WARNING: invalid value for unused bits in fuse "efuse", should be set to 1 according to datasheet
    This behaviour is deprecated and will result in an error in future version
    You probably want to use 0xfe instead of 0x06 (double check with your datasheet first).
    avrdude: warning: cannot set sck period. please check for usbasp firmware update.
    avrdude: warning: cannot set sck period. please check for usbasp firmware update.

    Is this still ok?



  • And this happens when I try to upoad a sketch to the board:

    Sketch uses 16,796 bytes (54%) of program storage space. Maximum is 30,720 bytes.
    Global variables use 739 bytes (36%) of dynamic memory, leaving 1,309 bytes for local variables. Maximum is 2,048 bytes.

    avrdude: stk500_paged_load(): (a) protocol error, expect=0x10, resp=0x90
    avrdude: stk500_cmd(): protocol error
    avr_read(): error reading address 0x0137
    read operation not supported for memory "flash"
    avrdude: failed to read all of flash memory, rc=-2
    the selected serial port avrdude: failed to read all of flash memory, rc=-2
    does not exist or your board is not connected



  • Fellows, let me ask you about the procedure of switching controllers during OTA.
    My sensors are connected to a serial gateway, which is operated by a controller.
    In my case the controller is Domoticz server hosted by Raspberry Pi2.

    So if I want to initiate updating one of my nodes over the air then I need to... stop my current controller on my Raspberry Pi2 and... start a new gateway on a Windows machine with MYSControler, wait when all nodes will re-discover the new gateway and connect, and then use MYSControler to do all updates I need?


  • Hardware Contributor

    @Alex-B-Goode Yes this is the Way. If you dont like to disconnect the Gateway from Pi you Can use my procedure was i wrote some posts before. If the nodes discovered One time you dont need to wait again. MYScontroller save the discovered nodes.



  • +1 Where is located MYSBootloader for MySensors 2.0?
    and where is a linux version?



  • is it possible or planned to do a OTA update over RS485 (with external flash using DualOptiBoot) ?


  • Mod



  • Has any attempted to use a usbip client on Windows to use with MYSController and access the GW?

    usbip is another technology for sharing USB ports over TCP/IP networks, similar to virtualhere. I am using it to access a USB device connected to a rPi2 from a linux box.



  • Is the sensbender micro already preloaded with the Dualoptiboot bootloader?


  • Mod



  • I'd like to try this on my Pro Mini clone, but unfortunately I find the instructions very confusing.

    What are fuses and why do I need to change them? To what do I need to change them?
    I cannot see "Arduino Mini pro MYSBootloader" in Boards.

    I am using Mysensors 2.1.


  • Hardware Contributor

    @maghac - https://forum.mysensors.org/topic/3018/tutorial-how-to-burn-1mhz-8mhz-bootloader-using-arduino-ide-1-6-5-r5 here is a good tutorial how to burn a bootloader. You need to select a bootloader you want to use. They all have different properties. The fuses are burned when you burn the bootloader. The wirelsess programming tutorial is found here: https://www.mysensors.org/about/ota


  • Mod

    The suggested bootloader programmers in the article work with all Arduino Mini pro, UNO, MEGA and so on? I have searched around Aliexpress for "USBASP" but it seems they support only windows 7 and the common description is " USBASP USBISP AVR Programmer USB ATMEGA8 ATMEGA128" so it's kind of confusing for me


  • Admin

    They should work with all of the "old" AVR line of atmel processors (attiny, atmega)

    If you go with newer processors like atsam procssor line, you need to have a CMSIS adapter instead.

    Btw. they should work on both windows and linux (and newer versions of windows as well)



  • Hi there,
    I have a RPI running my gateway(/dev/ttyUSB020) and domoticz is running on the rpi too. How do I used MYSBootloader to push sketches to my sensors?
    Thanks


  • Mod

    @hiddenuser https://www.mysensors.org/about/ota
    Then I suggest you configure the gateway as an ethernet gateway and use myscontroller to assign the firmware to the nodes



  • It's not quite clear for my how to use MYSBootloader for OTA. I'm running Domoticz as a controller (on RPI) and my gateway also is running on RPI (NRF on GPIO). Should have I one more arduino gateway connected to Windows machine running MYSController? As far I know there could be only one gateway in mysensors network.


  • Mod

    You just connect myscontroller to the gateway running on the RPI if it is configured as ethernet



  • I installed mycontroller.org for this purpose (OTA updates).

    I have a MQTT gateway running on a NodeMCU, which connects to my MQTT server (mosquitto running on a ubuntu server) via wifi. This setup works very well, and I don't have to keep anything running on my desktop machine (which is a windows 10 box) while the OTA updates are being pushed out (which takes ages, since they are running on battery and only wake up once every few hours).



  • @maghac said in πŸ’¬ Wireless Programming:

    updates a

    lately I was also tinkering with the OTA updates. I'm using RPI as a gateway and controller at the same time. I'm using MQTT gateway and the controller software is OpenHAB. As I studied the documentation about OTA I learned that it is not working with MQTT gateway. Can You explain how to setup OTA with MQTT gateway ? For now I have to kill the MQTT gateway process and launch serial gateway with virtual serial port which in turn has to be shared through the network with the ser2net to be able to use it with mycontroller running on my desktop.





  • Not sure what I am doing wrong here,... I followed the instructions for bootloader MYSController using an 'Arduino as ISP',... now when trying eg. the Blink sketch, I see that it takes about 10 seconds before it starts and after some 'blinks' it seems to miss some 'blinks',... any suggestions what might be wrong? The normal optiboot seems to work fine...



  • 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.


  • Mod



  • @gohan Thanks. I seem to have the same issue and I'm also using a 5V pro mini, although I actually am using the MYSBootloader.



  • 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=standard
    
    

    MYSBootloader.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.


  • Mod

    @maghac why don't you use the ota feature?



  • @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.



  • @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?


  • Mod

    You can use myscontroller to connect to the ethernet gateway and assign the firmware to upload for each node



  • Dear @gohan

    Thank you! Superb!



  • @gohan , Thanks for this idea... I am going to try this with a serial gateway instead. Do you perceive a problem? Will this work only with an ethernet gw?


  • Mod

    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...


  • Mod

    MyScontroller is a windows application.
    MyController is a controller that you can install anywhere. I personally try to avoid the usb gateways because of the limitations.


  • Hardware Contributor

    @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 ?


  • Hardware Contributor

    @Nca78 just old school habit πŸ˜‰ I think in the video both ways are explained. But I'll take a look at the howto to make it simpler, agree.

    thx for reminding me!



  • 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.

    0_1512991929867_Udklip.PNG

    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.


  • Mod

    Once I managed to burn the sensbender micro bootloader to the pro mini, how do I connect the external flash? Just connect it to pins D10 to D13? Is this the correct way of managing the fota in the sketch before the sleep?



  • @gohan I recently had some problems with fota and the sensebender sketch you refer to. In this thread @tekka suggested me to enable smart sleep. I used

    smartSleep(MEASURE_INTERVAL);
    

    It seems that the smartSleep function has a "built in" MY_SMART_SLEEP_WAIT_DURATION_MS (which defaults to 500 ms). This makes the OTA_WAIT_PERIOD in the sensebender sketch redundant. I deleted it from the sketch.

    FOTA now works successfully with my sensebender boards.


  • Mod

    I am still in the build phase, I still have to understand how to connect the flash and what to do in the code; also I need to find how to test if everything is is correct


  • Plugin Developer

    @gohan, Yes, MyController works with Serial, Ethernet, and MQTT as well.


  • Mod

    @jkandasa I know that but I don't know how to work with the flash chip at the moment



  • Hi guys! I burned mysbootloader but now rs485 doesn't work.. It's normal situation ? A would like to know if is possible to remote upload firmware via rs485 instead of radio. Thanks! Luca


  • Mod

    Mysbootloader doesn't support rs485, you probably need to use the dual optiboot but I haven't heard anyone trying it


  • Mod

    I think I managed to get the flash properly wired and using myscontroller I was able to assign a FW and it started to transfer the new FW as soon as the node was available but at the end I get this failure on the node dedug

    151898 OTA:FRQ:FW REQ,T=0078,V=0001,B=0316
    151918 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001603
    151971 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:780001001603909369058091690585FB882780F98F25
    151984 OTA:FWP:RECV B=0316
    151986 OTA:FRQ:FW REQ,T=0078,V=0001,B=0315
    152006 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001503
    152070 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:780001001503280586FB882780F99091690580FB95F9
    152082 OTA:FWP:RECV B=0315
    152084 OTA:FRQ:FW REQ,T=0078,V=0001,B=0314
    152104 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001403
    152586 OTA:FRQ:FW REQ,T=0078,V=0001,B=0314
    152606 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001403
    153088 OTA:FRQ:FW REQ,T=0078,V=0001,B=0314
    153110 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001403
    153589 OTA:FRQ:FW REQ,T=0078,V=0001,B=0314
    153612 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001403
    154091 OTA:FRQ:FW REQ,T=0078,V=0001,B=0314
    154345 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001403
    154593 OTA:FRQ:FW REQ,T=0078,V=0001,B=0314
    154613 TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=OK:780001001403
    155095 !OTA:FRQ:FW UPD FAIL
    165586 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:7800010014032405C550C13408F0C0E4C09364058091
    165597 !OTA:FWP:NO UPDATE
    165849 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:7800010014032405C550C13408F0C0E4C09364058091
    165859 !OTA:FWP:NO UPDATE
    165873 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:7800010014032405C550C13408F0C0E4C09364058091
    165883 !OTA:FWP:NO UPDATE
    165896 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:7800010014032405C550C13408F0C0E4C09364058091
    165906 !OTA:FWP:NO UPDATE
    165918 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:7800010014032405C550C13408F0C0E4C09364058091
    165931 !OTA:FWP:NO UPDATE
    165943 TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:7800010014032405C550C13408F0C0E4C09364058091
    165953 !OTA:FWP:NO UPDATE
    

    After this the node goes silent and I have to reset it to get it back. Log parser isn't helping much. Any idea where I can look ?


  • Mod

    It must have been a problem with myscontroller since after I tried mycontroller the firmware update was successful. Tomorrow I'll do some more tests. The only issue I found is the upload time that it took 7/8 min to upload using rfm69 433mhz


  • Mod

    great, now it is no longer working
    I am getting a series of messages like this

    OTA:FRQ:FW REQ,T=0001,V=0002,B=059A
    !TSF:MSG:SEND,16-16-0-0,s=255,c=4,t=2,pt=6,l=6,sg=0,ft=0,st=NACK:010002009A05
    TSF:MSG:READ,0-0-16,s=255,c=4,t=3,pt=6,l=22,sg=0:010002009B0509F4A140A6958FEF811D811D08950E94
    OTA:FWP:RECV B=059B
    !OTA:FWP:WRONG FWB
    

    and a failed update at the end. I am going to need some help

    I ran the GW debug and I am seeing a buch of NACK even if the node is 2 meters away from the GW

    mysgw: TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=OK:010002005805B082F701822F90E2882319F091938150
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005705
    mysgw: TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=OK:01000200570520F4353321F4A11002C081E3B82EF601
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005605
    mysgw: TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=OK:010002005605D601BC926C01D5CF6417750741F43633
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005505
    mysgw: TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=OK:01000200550571093196C60101967C016017710724F0
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005405
    mysgw: !TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=NACK:010002005405FB1ED7011196BC9002C090E3B92E6150
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005305
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005305
    mysgw: TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=OK:0100020053057F01E40CF51CA1E0B0E0AC0FBD1FEA0E
    mysgw: !TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=NACK:0100020053057F01E40CF51CA1E0B0E0AC0FBD1FEA0E
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005205
    mysgw: !TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=NACK:01000200520501966C014617570784F0661677066CF4
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005105
    mysgw: !TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=NACK:01000200510511096F3F8FEF780729F4D6019C92C601
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002005005
    mysgw: !TSF:MSG:SEND,0-0-16-16,s=255,c=4,t=3,pt=6,l=22,sg=0,ft=0,st=NACK:01000200500571082A01461A570A0B2D10E011950195
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002004F05
    mysgw: TSF:MSG:READ,16-16-0,s=255,c=4,t=2,pt=6,l=6,sg=0:010002004F05
    


  • My FOTA updates take 3-4 minutes at normal speed. I think you are having some different communication issue.



  • Is it possible to use this bootloader with arduino Mega boards (mega 2560)?
    What should be set in boards.txt then?


  • Mod

    @dakipro as a node or as gateway? Anyway I don't think it is supported



  • as a node, I want to build one ambitious notification node with a bunch of functionality, Due to number of interrupts i would like to have (and total sensors as well) it would have to be a mega board.

    It would be physically located in other part of the house, so wireless programming would be awesome if possible πŸ™‚


  • Mod

    May I ask why do you need that many interrupts?



  • DualOptiboot: if you do your own board layout, always keep the CS signal of the external flash at pin D8. You can change the pin number in your sketch, but not for the bootloader It is hard coded in the bootloader!
    In this case the uploaded firmware is written to external flash by the sketch, but the bootloader can not read it and not write it to internal flash. Firmware will never get updated. Took me some time to find out...



  • @gohan never saw your reply sorry.
    I am assuming I need more then two interrupts as I would like to have several buttons and sensors to the node. I am building a "information" node from an old lamp that will have a pir, lcd, temp, rgb led. Also a proximity and few others like microphone from the secret knock example, air quality, buzzer.
    I guess I could get away with checking on sensor/buttons state on each cycle since it is not a battery powered sensor, but I assume I will need more memory anyway for all the libs.

    (I know that perhaps the raspberry is better for this task, but... would like to push arduino and myself a bit more πŸ™‚ )


  • Mod

    Since it's not a battery node, you can use pretty much anything you want. If you want to give it a shot, there is also a 3.3v pro mini with a Mega 2560 chip that should give you plenty of room and power for all the libraries you want.



  • Can I add a +1 for Mega2560 support in the MYSBootloader please?

    I have 3 Mega based nodes (Irrigation and Pool Controllers). 2 of which are in spider infested, confined spaces in the garden. OTA would be a joy.



  • @gohan yes, but can it FOTA? πŸ™‚
    Never saw pro mini with mega chips btw (or didn't know the difference), do you have any links maybe?


  • Mod

    http://robotdyn.com/mega-2560-pro-mini-atmega2560-16au.html

    No idea if it can FOTA, bot I don't think there is a dual optiboot for it



  • Thanks for the info, I've got it working on boards which arn't already soldered to radios, however just cant burn a new bootrom to a board with a RF69 soldered across pins miso mosi and sck. Is this normal ?


  • Mod

    I guess the radio chip is interfering with the communication


  • Hardware Contributor

    @rfm69 does your rfm69 CS signal have a pullup? If not, you should add one, because pin can be floating (so it's bad practice to not have pullup on CS lines) and interfering during AVRSPI reprogramming



  • @scalz Thanks for the suggestion. By CS do you mean the DI00 on rmf69 and pin2 INT0 on mini pro ?

    I get confused by these things, so need to confirm. πŸ™‚

    What type of value pullup would you suggest. Again I'm new to this.

    Thanks


  • Hardware Contributor

    @RFM69
    CS/SS of the SPI bus, for enabling/disabling device spi comm. it's your rfm69 NSS pin if you prefer.
    I usually use 56k pullup resistor



410
Online

8.0k
Users

8.8k
Topics

94.3k
Posts