Recompiling for different channels



  • Could someone help me understading how to recmpile MYSBootloader for a different channel?
    I searched around but I haven't found a guide or anything similar.
    I'm not very familiar with gcc and it's configurations...
    I could work both on a Windows or Linux box, I guess the second could be easier to set up.
    Daniele



  • @danielef First load the clear eeprom sketch for the gateway and nodes. This will let you start with a clean arduino.

    Then simply add

    #define MY_RF24_CHANNEL (97)
    (Or whatever channel you want)

    This MUST be Before
    #include <MySensors.h>
    in your sketch.

    No recompiling needed.

    Note that I am assuming that you are using mysensors 2.3.0, an nrf24l01+ and an arduino gateway/node.


  • Mod

    @skywatch DanieleF was asking about the bootloader, not the sketch.



  • Might not work, but perhaps you start by modyfing line 53 in MYSBootloader.c (https://github.com/mysensors/MySensorsBootloaderRF24/blob/development/MYSBootloader.c#L53) and then recompile?

    (That's not arduiono code, so I'd use commandline and start with "make")



  • @mfalkvidd

    Aha, then I take it all back!

    I thought DanieleF was simply wanting to use a different channel and had assumed that the bootloader needed to be modified to do this (as was the case in earlier versions of my sensors).



  • @rejoe2 I tried this, and I also changed the frequency in the makefile (CLK = ... at line 8), but when I flash this bootloader, the arduino hangs and I'm not able to upload any sketch.

    I'm using a micro 3.3V 8MHz and MYSBootloader DEV branch.



  • @danielef Didn't find any option to change CLK and imo this should not be necessary (hope all the three versions are build and you have just to choose the right one for your board).
    As the file states, it was build using the 2.2 MySensors version. Perhaps you have to downgrade first (and then go back after BL is build successfully).



  • The option I found is here.
    When I run make, only one hex file is generated, so I assumed I have to change it in order to configure che frequency of my arduino.

    BTW, I don't understand your reference to MySensors version: I'm compiling a C program, not ann Arduino sketch (and I haven't seen a place to give the path to MySensors library).



  • @danielef OK, seems your changes have been ok.
    I didn't check any dependencies, just saw tekka's remark in Line 4 of MYSBootloader.c.

    Did you add anything in your boards definitions in Arduino IDE for the new BL? Or tried to use the BL definitions from boards.txt included already in the repo?



  • I'm using the definitions from board.txt available in the repo, simply changing the hex file in the folder where the IDE searches the bootloaders.



  • @danielef said in Recompiling for different channels:

    I'm using a micro 3.3V 8MHz and MYSBootloader DEV branch.

    Sorry, didn't realize this when first reading through it.
    So are you using a ATmega328p as mcu (pro mini) or in fact a pro micro (ATMega32U..)?
    The BL project seems to be limited to the first mcu type (L8 of MYSBootloader.c). Porting to the other mcu most likely is much more work, as this should support upload through USB also.



  • Sorry, my mystake!!!
    Pro mini!



  • Seems I'm running out of ideas. If you are sure to have flashed succcessfully the new BL and won't get any sync afterwards to upload any sketch built using that board def, most likely you shoud open an issue in github wrt that.

    (I myself went the other way round and modified the MYSENSORS modules in FHEM to make use of a second Gateway for flash purposes only - this GW with the standard channel (etc.) settings... Testing is ongoing, but seems to work)


Log in to reply
 

Suggested Topics

  • 9
  • 6
  • 24
  • 73
  • 3
  • 482
  • 198
  • 2

20
Online

11.4k
Users

11.1k
Topics

112.7k
Posts