Coder Social home page Coder Social logo

mysensorsbootloaderrf24's Introduction

MySensors Library v2.4.0-alpha

Please visit www.mysensors.org for more information

Current version in Arduino IDE arduino-library-badge

Documentation

master development

CI statuses

Current build status of master branch: Build Status

Current build status of development branch: Build Status

Current build status of master branch (nightly build of Arduino IDE): Build Status

Current build status of development branch (nightly build of Arduino IDE): Build Status

mysensorsbootloaderrf24's People

Contributors

akubi avatar bkdonline avatar enny1170 avatar gnalbandian avatar guillebot avatar joro75 avatar mfalkvidd avatar sergiorius avatar soloam avatar tekka007 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mysensorsbootloaderrf24's Issues

MYSBootloader_8MHz.hex FOTO does not work

Hi,

When flash the MYSBootloader_8MHz.hex 328p it does not communicate the OTA support request??

It seems not working, or what else good be wrong. Normal flashing serial works well.

Endless loop

When I reboot a node with mysbootloader the node never goes up again. The node is in a loop of endless restart.

Hardware where I observed this:
Arduino Pro Mini 5v (16 Mhz)
My simple board with atmega328P with internal oscilator 8 Mhz and 5V power
nrf24l01

Software:

  • Mysbootloader - 8 Mhz taken from repository with revision 7c4f3c3
  • Mysensors library ver. 2.3.0
  • Fuses for internal oscillator:
    proMYSBL8VRC1.bootloader.low_fuses=0xE2
    proMYSBL8VRC1.bootloader.high_fuses=0xDA
    proMYSBL8VRC1.bootloader.extended_fuses=0x06
    proMYSBL8VRC1.bootloader.unlock_bits=0x3F
    proMYSBL8VRC1.bootloader.lock_bits=0x0F

Steps to reproduce:

  1. Burn a mysbootloader by using usbasp
  2. Upload an easy sketch also by using usbasp
  3. When the node is ready and sketch is working use mycontroller or myscontroller (whatever) and send I_REBOOT command to the node.
  4. When the command gets the node, then node dies. It looks like it is doing something for a tiny part of second and after that is rebooted. It is necessary to unplug the node and plug again to make it up.

There is also impossible to perform any OTA update as it simply does not work. I tested it also on very elementary sketch which did nothing more than send a counter to the controller with the same result.

My observations:
Finally I found workaround and procedure how I could make my nodes working with OTA/mysbootloader. I guess that the problem was that I uploaded a first sketch by using usbasp instead of OTA. When I burned bootloader without sketch I was able to work with OTA, update software and reboot nodes.

I just report it to you as I believe that you deserve this because you have done great job which is useful for many people. If you manage to fix this problem it would be wonderful. If not I would suggest to write some information to warn other people from repeating my mistake. I really spent a few days experimenting with this to get to this conclusions.

Regards,
Jordan Szwejda

No firmware download start, when trying to save the battery

Hi, love your MYSbootloader/Controller effort,

My sensors reports every 2 minutes, using "smartSleep", marked it as running on battery, and I can indeed download new firmware, great. I see my data and a heartbeat in MYScontroller every 2 minutes

This works very good (but only after adding the famous both 0.1 and 10 uF capacitors to the NRF)

But the "smartSleep" adds 0.5 second radio/MCU on time and that is killing the battery :
(0.5 sec * 20mA * 30 times per hour /3600)24365 = 730mAh right ?
So if I am correct, that .5 second every 2 minutes alone will empty an AA battery in 1 year

So as alternative :
I report every 2 minutes and then a "sleep", but every 30 times = 1 hour, I throw in a "smartSleep" and not a "sleep". I see my data every 2 minutes and I see a heartbeat every 30 times = 1 hour

I don't mind if it can take 1 hour, but I don't want to manually reset/power cycle, as the sensors are on difficult places so battery exchange and reset should be limited :-)

Problem :
But when I request a firmware download, it does not start on the "smartSleep"/heartbeat
Perhaps you ignore the firmware download when you have seen a "sleep" or it takes too long or ??
I did not manage to find the source of the MYSController, did you make that available ?

In a test I lowered the sleep time to 10 seconds, so 5 minutes for a heartbeat , same problem.

Reset and power cycle do start a download, so no major issues there.

Can you change is so that it will start the download on any first "smartSleep" for below ( battery saving script)? Lets say even if 24 hours :-)

void loop()
{
BatteryVoltage = readVcc() * BatteryCorrection ; // readVcc returns a long type
send(msgBatt.set (BatteryVoltage, 2));
if (count == 0)
{
smartSleep(SleepTime);
}
else
{
sleep(SleepTime);
}
count = (count + 1) % 30;
}

Makefile compatibility

Hi,

source cannot be compiled when arduino installed in a folder something like: "E:/Program Files x86)/Arduino" Problem is easy to solve.

Proposal from my side to change on line in the MAKEFILE.
Change:
"$(BINPATH)avr-gcc" $(CFLAGS) -I$(INCLUDES) $< -o $@
to:
"$(BINPATH)avr-gcc" $(CFLAGS) -I"$(INCLUDES)" $< -o $@

Please not the two extra quotes before and after $INCLUDES. As it is in case of BINPATH. Then no more compiling error when arduino is installed in a folder like Program Files (x86).

Thank you!

hex file for other frequencies

Hello,
Would you be able to publish ex files for 8Mhz and 1Mhz? Especially the 1Mhz as it is the frequency most used for battery devices. Thanks

Compiling the bootloader - Not bootloader working beside the precompiled ones

Hello,

I have tried to compile your source by using the make file.

No matter what i tried i can't get a bootloader that i compiled myself to work correctly. Only those precompiled that you publish work.
The bootloader is usually too big , it goes beyond address 8000 , I notice that the make file puts the bootloader at 0x7800.
-section-start=.text=0x7800

More information:
-Win 10
-using AVRWIN ( paths are correct in the make file)

The make result :
$ make rm *.o rm *.elf rm *.hex "C:/WinAVR-20100110/bin/avr-gcc" -funsigned-char -funsigned-bitfields -DF_CPU=16000000L -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -Wextra -Wundef -pedantic -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "MYSBootloader.d" -MT"MYSBootloader.d" -MT"MYSBootloader.o" -IC:/WinAVR-20100110/avr/include/avr/ MYSBootloader.c -o MYSBootloader.o
In file included from Core.h:40,
from MYSBootloader.c:69:
HW.h:51:2: warning: #warning is a GCC extension
HW.h:51:2: warning: #warning BAUD_RATE error greater than 2%
In file included from Core.h:42,
from MYSBootloader.c:69:
MyMessage.h:292: warning: ISO C doesn't support unnamed structs/unions
"C:/WinAVR-20100110/bin/avr-gcc" -nostartfiles -Wl,-s -Wl,-static -Wl,-Map=".map" -Wl,--start-group -Wl,--end-group -Wl,--gc-sections -mrelax -Wl,-section-start=.text=0x7800 -mmcu=atmega328p -o MYSBootloader.elf MYSBootloader.o -lm "C:/WinAVR-20100110/bin/avr-objcopy" -O ihex -R .eeprom MYSBootloader.elf MYSBootloader.hex
"C:/WinAVR-20100110/bin/avr-size" MYSBootloader.elf
text data bss dec hex filename
2386 6 72 2464 9a0 MYSBootloader.elf

If helping me compile this isn't easy, but you could somehow compile a bootloader for me with adding two lines :

DDRD |= 0x80; PORTD |= 0x80;

after line 100 in MYSbootloader.c.

Thank you for your time

MySensorsBootloader causes linker stack smashing on recent gcc versions

Trying to compile this bootloader with gcc shipped with debian stable (bullseye) or debian testing results in a stack smashing during linking.

0 ✓ necromant @ silverblade ~/Projects/mysensors/MySensorsBootloaderRF24 $ avr-gcc --version
avr-gcc (GCC) 5.4.0
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

0 ✓ necromant @ silverblade ~/Projects/mysensors/MySensorsBootloaderRF24 $ dpkg -l|grep gcc-avr
ii  gcc-avr                                       1:5.4.0+Atmel3.6.2-2                             amd64        G2 ✗ necromant @ silverblade ~/Projects/mysensors/MySensorsBootloaderRF24 $ make -B
rm *.o
rm *.elf
rm *.hex
rm: невозможно удалить '*.hex': Нет такого файла или каталога
make: [Makefile:28: clean] Ошибка 1 (игнорирование)
"/usr/bin/avr-gcc" -funsigned-char -funsigned-bitfields -DF_CPU=1000000L -DBAUD_RATE=9600 -Os -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -Wall -Wextra -Wundef -pedantic -mmcu=atmega328p -c -std=gnu99 -MD -MP -MF "MYSBootloader.d" -MT"MYSBootloader.d" -MT"MYSBootloader.o"  MYSBootloader.c -o MYSBootloader.o
"/usr/bin/avr-gcc" -nostartfiles -Wl,-s -Wl,-static -Wl,-Map=".map" -Wl,--start-group -Wl,--end-group -Wl,--gc-sections -mrelax -Wl,-section-start=.text=0x7800 -mmcu=atmega328p   -o MYSBootloader.elf MYSBootloader.o -lm
collect2: fatal error: ld terminated with signal 6 [Аварийный останов]
compilation terminated.
*** stack smashing detected ***: terminated
make: *** [Makefile:34: MYSBootloader.elf] Ошибка 1

development version hex file is not working properly

@tekka007 I tried development version hex file 8MHz from https://github.com/mysensors/MySensorsBootloaderRF24/tree/development/hex it did not work as expected. I noticed firmware request is too slow from node. I guess recent chnages has some huge performance issue. I tested with MyController.org. I do not have windows environment to test with MYSController.

I using 8MHz file from https://forum.mysensors.org/topic/4991/mysbootloader-1-3pre2-testing Which is working awesome and quick response from node.

compiling for CE pin 7, CSN pin 8

Hi,

I'm migrating from RF24Network to MySensors. My config used to be CE7, CSN8. I'm trying to build the bootloader for this configuration, but I can't get it to work.
Using a new node with the default pin config of CE9, CSN10 does work, but I'd prefer not to rewire my existing nodes if I can help it.

I added a new define to MYSbootloader.c and the following code to HW.h:

#elif defined(SPI_PINS_CE7_CSN8)
#define CE_PORT PORTD // port for CE
#define CE_DDR DDRD // DDR for CE
#define CE_PIN PD7 // Arduino Pin 7 <-> Bit 7 of port D

#define CSN_PORT	PORTB	// port for CSN
#define CSN_DDR		DDRB	// DDR for CSN
#define	CSN_PIN		PB0		// Arduino Pin  8 <-> Bit 2 of port B

#endif

...

#elif defined(SPI_PINS_CE7_CSN8)
	// PB0 is SS pin has to be defined as OUTPUT, else SPI goes to slave mode
	SPI_DDR = _BV(SPI_MOSI) | _BV(SPI_SCLK) | _BV(PB0) | _BV(CSN_PIN);
	CE_DDR = _BV(CE_PIN);
#endif

based on what I found for the existing defines. It's the last part I'm not sure about. Could anyone help me out?
Thanks!

Not working

Hi. I have tried the hex file for 328p 16mhz. When i power on i se an ID request on the gateway, but doesnt register with the Controller. When i use the MYSBootloader included with the latest MYSController the node registers and OTA works just fine. I use mycontroller.org and RasPI as gateway. Anyone got this bootloader working? Or can give me some tips on getting it to work?
Regrds
Sindre

Running the OTA will kill the node ID and will not complete

I use the latest pre-compiled hex from "compiled" folder with jkandasa MyController.org.
First OTA update went well.
But subsequent updates issue the BL_CMD_CLEAR_EEPROM command, which destroys NODE_ID and PARENT_NODE_ID.

for(uint16_t i = 0; i < EEPROM_SIZE; i++) eeprom_update_byte((uint8_t *)i, EEPROM_ERASED_BYTE);

As a result, the controller loses the device and cannot send firmware to it.

In my case, it's even worse, because I have 100 identical devices on the network with the same firmware, which I only distinguish by NODE_ID.
That is, if I push firmware to all devices, my system/network will be destroyed, and it may take several days to restore it - I will have to manually restore NODE_ID on each device.

It's OK, if I change this like to

for(uint16_t i = EEPROM_DISTANCE_ADDRESS; i < EEPROM_SIZE; i++)
    eeprom_update_byte((uint8_t *)i, EEPROM_ERASED_BYTE);

or I should erase EEPROM_FIRMWARE_xxxxx only?

Tired lastest hex files, verification error

Just downloaded the latest files from dev branch.
Copied boards from here.
When i try to upload any mysensorsBootloader i get:
avrdude: verification error, first mismatch at byte 0x7800
0x00 != 0x11
avrdude: verification error; content mismatch

Flash init error

I have freshly created pro mini 3.3 8 MHz.
I flashed MySbootloader (developer branch) and when I try on OTA update I always get:
!OTA:FWP:FLASH INIT FAIL

Why would firmware-less node proceed to startup after MAX_FIRMWARE_REQUEST_RESEND reached?

Hi @tekka007,

I was wondering why a node that I left last night without firmware stopped asking for it(firmware), this morning.
I read the code and found what's causing it.
Is this the intended behavior?

Wouldn't be nicer to have the node requesting firmware perpetually until firmware submitted?

Now, that node is in limbo state, without firmware, and there is no other way to restore communication with it, than with a hardware reset.

Let me know what you think, i can contribute with coding.

Regards.

Bootloader entered in to infinite loop.

When we do not have any node/gateway around the reachable area, bootloader gets stuck on searching something. I guess it's waiting for parent node id?

In this situation bootloader never enter into the application/user program.

I use 1.3.0-beta.3 bootloader.

OTA infinit loop

in some times, the bootloader keeps request a firmware request and aparently dont listen the response from gateway.

2903	09/07/2017 12:52:52	RX	3	INTERNAL	C_STREAM	NO	ST_FIRMWARE_REQUEST	28000100F303
2904	09/07/2017 12:52:52	TX	3	INTERNAL	C_STREAM	NO	ST_FIRMWARE_RESPONSE	28000100F3039C048CEE96E00E94401F8BEC96E00E94
2907	09/07/2017 12:52:56	RX	3	INTERNAL	C_STREAM	NO	ST_FIRMWARE_REQUEST	28000100F203
2908	09/07/2017 12:52:56	TX	3	INTERNAL	C_STREAM	NO	ST_FIRMWARE_RESPONSE	28000100F20396041092990410929A0410929B041092
2911	09/07/2017 12:52:59	RX	3	INTERNAL	C_STREAM	NO	ST_FIRMWARE_REQUEST	28000100F103
2912	09/07/2017 12:52:59	TX	3	INTERNAL	C_STREAM	NO	ST_FIRMWARE_RESPONSE	28000100F10395048093940486EC90E0909397048093

Compiling for different channels

Hi
I'm trying to compile hex files for channels different from the default one.
I'm using MySBootloader dev branch and the provided boards.txt

I changed the channel here and the board frequency to 8MHz here.

I then compiled (simply running a Make), no errors, but when I flash the obtained hex file on my Arduino (Pro Mini 3.3V 8MHz) it hangs and I'm not able to upload any sketch.

Thanks in advance for any help or suggestion
Daniele

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.